According to the SDK documentation, there's a function pico_flash_bank_instance which returns "the singleton BT stack HAL instance, used for non-volatile storage". This implies that if you use the BT stack, then some of the flash is effectively "off-limits".
From reading the SDK source, it looks like this is a region of 2 sectors (so 2 x 4096 bytes) at the end of the flash.
Obviously, this will vary from one type of board to another (although is only used on boards which support BT, so not the Pico or Pico2, but it's there in different places on the PicoW and Pico2W).
So am I right in thinking that if I want to use flash within a 'simple' app (ie not using flash partitions), I should avoid writing to these areas if the app also uses BT?
Is there any other (possibly optional) functionality in the SDK which also makes use of "reserved" areas of flash?
As an aside, it looks like if I used BT and littleFS in my code, to determine the end of the flash I need to take PICO_FLASH_SIZE_BYTES (from the board file) and reduce it by 8192, when determining the littleFS size, or I'm just asking for data corruption further down the line.
From reading the SDK source, it looks like this is a region of 2 sectors (so 2 x 4096 bytes) at the end of the flash.
Obviously, this will vary from one type of board to another (although is only used on boards which support BT, so not the Pico or Pico2, but it's there in different places on the PicoW and Pico2W).
So am I right in thinking that if I want to use flash within a 'simple' app (ie not using flash partitions), I should avoid writing to these areas if the app also uses BT?
Is there any other (possibly optional) functionality in the SDK which also makes use of "reserved" areas of flash?
As an aside, it looks like if I used BT and littleFS in my code, to determine the end of the flash I need to take PICO_FLASH_SIZE_BYTES (from the board file) and reduce it by 8192, when determining the littleFS size, or I'm just asking for data corruption further down the line.
Statistics: Posted by SteveSpencer — Sun Dec 14, 2025 4:15 pm