Skip to content

Mono delay never returns (sometimes) #1026

@Erhannis

Description

@Erhannis

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    UnconfirmedCurrently unable to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions