From 10794dc271d19e7eec5bd02442810ce9c95c63a3 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Tue, 4 Feb 2025 16:36:42 +0000 Subject: [PATCH] Mark flash_devinfo_ptr() as RAM code to avoid flash call during flash_range_erase() --- src/rp2_common/hardware_flash/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rp2_common/hardware_flash/flash.c b/src/rp2_common/hardware_flash/flash.c index 26d47a68b..adae07878 100644 --- a/src/rp2_common/hardware_flash/flash.c +++ b/src/rp2_common/hardware_flash/flash.c @@ -288,7 +288,7 @@ void flash_get_unique_id(uint8_t *id_out) { #if !PICO_RP2040 // This is a static symbol because the layout of FLASH_DEVINFO is liable to change from device to // device, so fields must have getters/setters. -static io_rw_16 * flash_devinfo_ptr(void) { +static io_rw_16 * __no_inline_not_in_flash_func(flash_devinfo_ptr)(void) { // Note the lookup returns a pointer to a 32-bit pointer literal in the ROM io_rw_16 **p = (io_rw_16 **) rom_data_lookup_inline(ROM_DATA_FLASH_DEVINFO16_PTR); assert(p);