Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mono delay never returns (sometimes) #1026

Open
Erhannis opened this issue Mar 9, 2025 · 0 comments
Open

Mono delay never returns (sometimes) #1026

Erhannis opened this issue Mar 9, 2025 · 0 comments

Comments

@Erhannis
Copy link

Erhannis commented Mar 9, 2025

RP2040, rtic-monotonics: 2.0.3, rustc 1.86.0-nightly (124cc9219 2025-02-09)

It's hard to say what the problem is, exactly, but there's one delay in my code that sometimes doesn't return. Specifically:

rp2040_timer_monotonic!(Mono);
...
...
info!("TXBG before wait");
Mono::delay(10_u64.micros()).await;
info!("TXBG after wait");

I see the first info, but not the second, and the task never loops again. Thing is, it used to do this, and then for no obvious reason stopped doing it, and now it's doing it again. There's some slim evidence it's related to the idle loop; seems like the delay runs sometimes (successfully) once before the idle task gets going, but once the idle task starts, the next run of that delay fails to complete. Btw, I've tried the idle loop with and without cortex_m::asm::wfi(), I've seen that in some examples and am not sure of when and whether to use it, but it doesn't seem to make a difference for this code. All the tasks (except idle) are priority 1. I've (previously) used Mono::delay in other places in the code with no issue I noticed, so I'm not sure what's special about this one. Are there special conditions I need to observe in order to use Mono::delay? Do I need to register an interrupt? Make sure to have such-and-such a call somewhere else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant