Most probably it's the VSCode debugger activating the spinlocks by reading those registers.
That's why it gets stuck here waiting (forever) for the spinlock to be unlocked:
That's why it gets stuck here waiting (forever) for the spinlock to be unlocked:
Code:
uint32_t save = spin_lock_blocking(sleep_notifier.spin_lock);Are you using the debugger from VSCode?Observation:
I'm able to build, and start the debugger. However, when I get to the sleep_ms(1000) part, it never returns, and seems to be stuck in the while loop linked above.
Try not to read SIO registers from PERIPHERALS view (or keep the SIO collapsed/closed), otherwise it triggers hardware spinlocks, get you locked, and waiting forever to be unlocked.
Statistics: Posted by gmx — Sat Aug 16, 2025 12:00 am