diff options
| author | iabdalkader <i.abdalkader@gmail.com> | 2022-11-08 16:17:59 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-11-09 12:00:10 +1100 |
| commit | 345f1d23957be43e1157463a6405ba9cb04bd43d (patch) | |
| tree | ef40762e732274314d6b235c25815a5e155a46d8 | |
| parent | d68e3b03b1053a6de0c7eb28f5989132c138364b (diff) | |
rp2/cyw43_configport: Make sure only core0 executes a __WFI().
This commit executes __WFI() on core 0 only to avoid core1 locking up since
it doesn't enable any interrupts by default (except for `SIO_IRQ_PROC1`).
This fixes a lockup when calling `cyw43_do_ioctl` from core1.
Fixes issue #9597.
| -rw-r--r-- | ports/rp2/cyw43_configport.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ports/rp2/cyw43_configport.h b/ports/rp2/cyw43_configport.h index a5ce8a9e7..848fb9dbf 100644 --- a/ports/rp2/cyw43_configport.h +++ b/ports/rp2/cyw43_configport.h @@ -47,8 +47,15 @@ #define CYW43_THREAD_EXIT MICROPY_PY_LWIP_EXIT #define CYW43_THREAD_LOCK_CHECK -#define CYW43_SDPCM_SEND_COMMON_WAIT __WFI(); -#define CYW43_DO_IOCTL_WAIT __WFI(); +#define CYW43_SDPCM_SEND_COMMON_WAIT \ + if (get_core_num() == 0) { \ + __WFI(); \ + } \ + +#define CYW43_DO_IOCTL_WAIT \ + if (get_core_num() == 0) { \ + __WFI(); \ + } \ #define CYW43_ARRAY_SIZE(a) MP_ARRAY_SIZE(a) |
