picow_ds4 icon indicating copy to clipboard operation
picow_ds4 copied to clipboard

Assertion failed when pairing

Open agaeb opened this issue 1 year ago • 0 comments

When trying to pair a device, I got assertion "false" failed: file ".../pico/pico-sdk/src/rp2_common/pico_flash/flash.c", line 183, function: default_enter_ss and the pico halted. This seems to be related to the Bluetooth stack trying to write to flash from the second core, without having been given the guarantee that it is safe to do so, see https://www.raspberrypi.com/documentation/pico-sdk/high_level.html#pico_flash. To give this guarantee (assuming the first core isn't actually writing to flash), flash_safe_execute_core_init(); must be called somewhere early in the main function, which is declared in #include "pico/flash.h". With this addition, I was able to pair the device alright. Another possibility would be to set PICO_FLASH_ASSUME_CORE0_SAFE=1, but I did not try that.

agaeb avatar Dec 21 '23 20:12 agaeb