You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rp2/mpnetworkport: Fix lost CYW43 WiFi events when using both cores.
There's a very odd but predictable sequence of events that breaks Wi-Fi
when using both cores:
1) CPU1 calls pendsv_suspend() - for example sleep() causes
a softtimer node to be inserted, which calls pendsv_suspend().
2) CYW43 sends wakeup IRQ. CPU0 GPIO IRQ handler schedules PendSV
and disables the GPIO IRQ on CPU0, to re-enable after
cyw43_poll() runs and completes.
3) CPU0 PendSV_Handler runs, sees pendsv is suspended, exits.
4) CPU1 calls pendsv_resume() and pendsv_resume() sees PendSV
is pending and triggers it on CPU1.
5) CPU1 runs PendSV_Handler, runs cyw43_poll(), and at the end
it re-enables the IRQ *but now on CPU1*.
However CPU1 has GPIO IRQs disabled, so the CYW43 interrupt never runs
again...
The fix in this commit is to always enable/disable the interrupt on CPU0.
This isn't supported by the pico-sdk, but it is supported by the hardware.
Fixes issue micropython#16779.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <[email protected]>
0 commit comments