jnaulet / OpenPicoRTOS

Very small, safe, lightning fast, yet portable preemptive RTOS with SMP support
MIT License
46 stars 4 forks source link

SAMD51 clock system stalls in -O2 and above #52

Open jnaulet opened 1 year ago

jnaulet commented 1 year ago

This is related to issue #19 We might have to implement some variant of activate wait, like delay_us() or delay_ms() for every arch & every clock speed.

This is not that obvious withotu a massive refactoring, unless maybe arch_counter() might be used differently (as a freerunnning counter, similar to MIPS and RISC-V).

jnaulet commented 11 months ago

Here's a possible workaround: let the clock driver allow to wait for a certain number of cycles / ns. This won't fix the sync between clock domains that occur on almost any sam related driver, though.