From b51fa1b747e0499da4f48a23c365dc8f5f27b8ad Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Tue, 4 Feb 2025 22:06:56 +0000 Subject: [PATCH] Mark flash_devinfo_ptr() as RAM code to avoid flash call during flash_range_erase() (#2235) --- 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 26d47a68..adae0787 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);