8000 Change BT flash storage default for rp2350 A2 (#2412) · raspberrypi/pico-sdk@6fea77f · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fea77f

Browse files
Change BT flash storage default for rp2350 A2 (#2412)
The workaround for errata RP2350-E10 overwrites the last block in flash. This will overwrite the BT flash storage causing a paired BT connection to fail. Move the default flash storage location to 3 sectors from the end of flash for RP2350 where A2 support is required. This will require existing BT pairings to a Pico device to be removed and readded. Fixes #2322
1 parent 1721f9d commit 6fea77f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/rp2_common/pico_btstack/include/pico/btstack_flash_bank.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,24 @@ extern " C547 C" {
2020
#define PICO_FLASH_BANK_TOTAL_SIZE (FLASH_SECTOR_SIZE * 2u)
2121
#endif
2222

23-
// PICO_CONFIG: PICO_FLASH_BANK_STORAGE_OFFSET, Offset in flash of the Bluetooth flash storage, type=int, default=PICO_FLASH_SIZE_BYTES - PICO_FLASH_BANK_TOTAL_SIZE, group=pico_btstack
23+
// PICO_CONFIG: PICO_FLASH_BANK_STORAGE_OFFSET, Offset in flash of the Bluetooth flash storage, type=int, default=PICO_FLASH_SIZE_BYTES - FLASH_SECTOR_SIZE - PICO_FLASH_BANK_TOTAL_SIZE on RP2350 otherwise PICO_FLASH_SIZE_BYTES - PICO_FLASH_BANK_TOTAL_SIZE, group=pico_btstack
2424
#ifndef PICO_FLASH_BANK_STORAGE_OFFSET
25+
#if PICO_RP2350 && PICO_RP2350_A2_SUPPORTED
26+
#define PICO_FLASH_BANK_STORAGE_OFFSET (PICO_FLASH_SIZE_BYTES - FLASH_SECTOR_SIZE - PICO_FLASH_BANK_TOTAL_SIZE)
27+
#else
2528
#define PICO_FLASH_BANK_STORAGE_OFFSET (PICO_FLASH_SIZE_BYTES - PICO_FLASH_BANK_TOTAL_SIZE)
2629
#endif
30+
#endif
2731

2832
/**
2933
* \brief Return the singleton BTstack HAL flash instance, used for non-volatile storage
3034
* \ingroup pico_btstack
3135
*
32-
* \note By default two sectors at the end of flash are used (see \c PICO_FLASH_BANK_STORAGE_OFFSET and \c PICO_FLASH_BANK_TOTAL_SIZE)
36+
* \note By default, two sectors near the end of flash are used.
37+
* For RP2350 when PICO_RP2350_A2_SUPPORTED is true, two sectors that are three sectors from the end of flash are used.
38+
* This keeps the last sector free for a workaround for chip errata RP2350-E10. See the RP2350 datasheet for more details about this.
39+
* Otherwise, two sectors directly at the end of flash are used.
40+
* See \c PICO_FLASH_BANK_STORAGE_OFFSET and \c PICO_FLASH_BANK_TOTAL_SIZE)
3341
*/
3442
const hal_flash_bank_t *pico_flash_bank_instance(void);
3543

0 commit comments

Comments
 (0)
0