pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Pico w SDK "cyw43_arch_init" asserts in irq.c line 124 when run on core1

Open inthestillofthenight opened this issue 2 years ago • 2 comments

Requested to raise a defect on this issue, I have a simple network project written in C for the Pico w that works fine on core 0 but when moved to core 1 fails when calling cyw43_arch_init. It asserts in irq.c line 124 when run on core1. I can see it calls low_prio_irq_init(...) which calls irq_set_exclusive_handler(...) which is where it asserts. If I put the "cyw43_arch_init" in core 0 and the other code in core 1 it init's ok, receives data but does not send data.

Cutdown code attached. Built with VSCode running on Win11 PC with Pico used for SWD and Pico sdk 1.4 when run the output is: It's all gone well on core 0! Its all gone well on core 1 assertion "current == __unhandled_user_irq || current == handler" failed: file "C:\pico\pico-sdk\src\rp2_common\hardware_irq\irq.c", line 124, function: irq_set_exclusive_handler

PicoW-Bug report network assert on core1.zip

inthestillofthenight avatar Oct 06 '22 16:10 inthestillofthenight

If I removed these lines, your code worked for me.

#pico_enable_stdio_usb(${PROJECT_NAME} 1) #pico_enable_stdio_uart(${PROJECT_NAME} 1)

I got the assertion with these lines included. Which is a bit odd.

peterharperuk avatar Oct 06 '22 18:10 peterharperuk

that is expected; the problem is an interaction with stdio_usb (although that is not the bug)

The issue is that the IRQ claiming is done per core, however the vector table is shared between cores.

kilograham avatar Oct 06 '22 20:10 kilograham

merged into develop

kilograham avatar Jan 24 '23 14:01 kilograham