Skip to content

Commit dc8daad

Browse files
committed
rp2/rp2_flash: Add default MICROPY_HW_FLASH_MAX_FREQ.
Set a default MICROPY_HW_FLASH_MAX_FREQ if PICO_FLASH_SPI_CLKDIV is unset. Use a divider of 4, which is the default in boot2_generic_03h.S. Signed-off-by: Phil Howard <[email protected]>
1 parent b725c26 commit dc8daad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/rp2/rp2_flash.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ static_assert(MICROPY_HW_FLASH_STORAGE_BYTES % 4096 == 0, "Flash storage size mu
5454
// On RP2040 if PICO_USE_FASTEST_SUPPORTED_CLOCK is set then SYS_CLK_HZ can be
5555
// 200MHz, potentially putting timings derived from PICO_FLASH_SPI_CLKDIV
5656
// out of range.
57+
#ifdef PICO_FLASH_SPI_CLKDIV
5758
#define MICROPY_HW_FLASH_MAX_FREQ (SYS_CLK_HZ / PICO_FLASH_SPI_CLKDIV)
59+
#else
60+
// A default PICO_FLASH_SPI_CLKDIV of 4 is set in boot2_generic_03h.S
61+
#define MICROPY_HW_FLASH_MAX_FREQ (SYS_CLK_HZ / 4)
62+
#endif
5863
#endif
5964

6065
#ifndef MICROPY_HW_FLASH_STORAGE_BASE

0 commit comments

Comments
 (0)