OpenPicoRTOS icon indicating copy to clipboard operation
OpenPicoRTOS copied to clipboard

CONFIG_DEADLOCK_COUNT in the drivers is a bad idea !

Open jnaulet opened this issue 2 years ago • 1 comments

A lot of drivers use CONFIG_DEADLOCK_COUNT as a way to avoid infinite loops. This doesn't work. Depending on the CPU power or level of optimization, this could trigger an assert and make a perfectly good software stall.

The solution is not obvious... We can increase the countdown but take the risk to see it fail anyway or find a way to determine the max counter depending on the CPU frequency. This one is available in the clock HAL, but this means the clocks must be initialized, which is not satisfying either.

jnaulet avatar Apr 15 '23 19:04 jnaulet

Partially "solved" with the use of arch_delay_us()

jnaulet avatar Oct 15 '23 07:10 jnaulet