raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.78k stars 950 forks source link

Pico 2 W - FreeRTOS - cyw43_arch_init within Task causes Panic #2101

Open jondurrant opened 8 hours ago

jondurrant commented 8 hours ago

I'm using Raspberry Pi version of FreeRTOS, current version which was last updated about 3 months ago. Linking: pico_cyw43_arch_lwip_sys_freertos and calling cyw43_arch_init from within a task. I get error as below. Any suggestions?

Error: assertion "!(raw_irq_mask[get_core_num()] & gpio_mask)" failed: file "/Users/jondurrant/pico/pico-sdk-2.1 .0/src/rp2_common/hardware_gpio/gpio.c", line 222, function: gpio_add_raw_irq_handler_with_order_priority _masked

This is a migration of code that runs flawlessly on Pico W.

jondurrant commented 8 hours ago

SDK is 2.1.0

peterharperuk commented 6 hours ago

Could you be calling cyw43_arch_init twice? That's the only way I could think that this could happen off the top of my head. I assume it's the cyw43_irq_init call that's causing the problem.

This is a migration of code that runs flawlessly on Pico W.

I can't think why this would be different on Pico W.

jondurrant commented 4 hours ago

Certain this is only calling once at the top of the main thread.

kilograham commented 2 hours ago

a stack trace would be helpful