Open MauroMombelli opened 1 year ago
I have also run into this issue, but when using embassy_rp
instead. Adding a yield_now
to my SPI task also addressed the problem.
This is happening because without yield_now().await
you just do not have any await-points in a
task, so it blocks entire executor in this endless loop
loop {
info!("A");
yield_now().await; // await point, here executor can switch tasks
}
@nikvoid read the issue again, you are completely missing what is going on here
Oh, get it wrong, sorry
Minimal example to reproduce the issue follow.
EXPECTED: START A and START B are both printed (order can be inverted) A and B are printed, in different order/frequency
OBSERVED: START A and A are NEVER printed. START B and B are always printed.
FUN FACT: Adding a third task, is also never run. "spi.transfer().await;" seems to monopolize the executor Adding a little delay with "Timer::after(Duration::from_millis(100)).await;" to the spi's task will let START A and A get printed. Also works if adding yield_now().await;
CODE: