Skip to content

Perform serial prints in a critical section

rahix requested to merge rahix/fix-serial into master

Sometimes during initialization, one log_msg() intercepts another one, leading to a whole lot of weird issues in other modules (like I2C). I suspect this to be memory corruption of some kind. The issues can be fixed by performing serial prints in a critical section, thus ensuring atomicity of prints. Note that this does not mean log messages will not interleave.

A possible downside of this approach is that prints can take quite some time. We did not notice any issues with that so far though. Apart from that, not many prints happen anyway.

Merge request reports