Closed haukepetersen closed 9 years ago
Question: do we need to make the UART thread safe?
If we are at it, let's do this.
Question: do we need to make the UART thread safe?
After thinking about it some more it would break usage of DEBUG() in ISR context and similar, so probably not. Other opinions?=
@thomaseichinger Can it be avoided by letting the UART IRQ have a higher priority? To be able to transmit while another ISR is waiting for the lock?
@gebart: I would not start with higher IRQ priorities - as for (i) some platforms do not support this and (ii) we have not really investigated if the kernel is actually able to run with different priorities (it's still an open task...).
But I think we could add a lock for the UART, but we can just not use it for stdout...
I got an idea: Using atomic counters it should be possible to implement the UART buffering functions without locking, with the drawback that we may drop bytes when the buffer gets full.
This would work if the UART driver would buffer... But it is explicitly designed not to buffer, as this is something intended to do by the higher-level modules put on top of the UART.
I updated the description to also include parts using the updated interfaces to track adoption.
Just for completeness I added the kinets_common stuff still being worked on in #2265
After #2326 was merged tonight I believe this can be closed as resolved.
jap, correct
As pointed out in #2289, our current bus driver implementations are not thread save. A solution is proposed in #2290 (for the STM32F4 cpu). If we use that proposed solution or if we do something else - either way we need to do this for all cpus and bus drivers. This issue is for tracking the implementation status of this effort.
Thread safe bus drivers:
Question: do we need to make the UART thread safe?
Edit [@thomaseichinger]: To keep things centralised I add a list of drivers needing adoption.