raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.26k stars 838 forks source link

flash_safe_execute() doesn't recognise FreeRTOS SMP define for the number of cores #1624

Closed antonwtw closed 4 months ago

antonwtw commented 5 months ago

Hello, in pico-sdk/src/rp2_common/pico_flash/flash.c, on line 18, when compiled with FreeRTOS SMP support, configNUM_CORES is expected to be set to 2 through FreeRTOSConfig.h. But the FreeRTOS uses a different name for this define: configNUMBER_OF_CORES. See for instance line 100 in https://github.com/FreeRTOS/FreeRTOS-Community-Supported-Demos/blob/main/CORTEX_M0%2B_RP2040/Standard_smp/FreeRTOSConfig.h This leads to an assert/error when calling flash_safe_execute() with FreeRTOS SMP, see line 172 in flash.c. As a quick fix I had to add the following in my FreeRTOSConfig.h: #define configNUM_CORES configNUMBER_OF_CORES With best regards, Anton

lurch commented 5 months ago

I guess this'll be fixed by #1530 ?

antonwtw commented 5 months ago

That's true. Sorry I didn't find the 1530 before.

peterharperuk commented 4 months ago

Duplicate