diff options
-rw-r--r-- | ports/rp2/rp2_flash.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/rp2/rp2_flash.c b/ports/rp2/rp2_flash.c index 8b467fc6c8..d6b9e13653 100644 --- a/ports/rp2/rp2_flash.c +++ b/ports/rp2/rp2_flash.c @@ -54,7 +54,12 @@ static_assert(MICROPY_HW_FLASH_STORAGE_BYTES % 4096 == 0, "Flash storage size mu // On RP2040 if PICO_USE_FASTEST_SUPPORTED_CLOCK is set then SYS_CLK_HZ can be // 200MHz, potentially putting timings derived from PICO_FLASH_SPI_CLKDIV // out of range. +#ifdef PICO_FLASH_SPI_CLKDIV #define MICROPY_HW_FLASH_MAX_FREQ (SYS_CLK_HZ / PICO_FLASH_SPI_CLKDIV) +#else +// A default PICO_FLASH_SPI_CLKDIV of 4 is set in boot2_generic_03h.S +#define MICROPY_HW_FLASH_MAX_FREQ (SYS_CLK_HZ / 4) +#endif #endif #ifndef MICROPY_HW_FLASH_STORAGE_BASE |