Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8093

SDK • Re: [RP2040] sleep_us waits forever

$
0
0
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:

Code:

                uint32_t save = spin_lock_blocking(sleep_notifier.spin_lock);
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.
Are you using the debugger from VSCode?

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



Viewing all articles
Browse latest Browse all 8093

Trending Articles