diff options
author | Damien George <damien@micropython.org> | 2025-04-02 12:50:23 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-04-09 22:36:55 +1000 |
commit | ed4833d495e1a328ef35edda1666799a9c84802c (patch) | |
tree | 98102022c0894265ade916e0cdf95586601dae01 | |
parent | de08190cb736f3bb1027d15bdf88135e49603c23 (diff) | |
download | micropython-ed4833d495e1a328ef35edda1666799a9c84802c.tar.gz micropython-ed4833d495e1a328ef35edda1666799a9c84802c.zip |
stm32/modmachine: Add SPI flash size to machine.info dump.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r-- | ports/stm32/modmachine.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/stm32/modmachine.c b/ports/stm32/modmachine.c index 7c1c4da60b..620ae468cb 100644 --- a/ports/stm32/modmachine.c +++ b/ports/stm32/modmachine.c @@ -247,6 +247,14 @@ static mp_obj_t machine_info(size_t n_args, const mp_obj_t *args) { mp_printf(print, " 1=%u 2=%u m=%u\n", info.num_1block, info.num_2block, info.max_block); } + // SPI flash size + #if defined(MICROPY_HW_SPIFLASH_SIZE_BITS) + mp_printf(print, "SPI flash size: %d\n", MICROPY_HW_SPIFLASH_SIZE_BITS / 8); + #endif + #if defined(MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2) + mp_printf(print, "QSPI flash size: %d\n", 1 << (MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2 - 3)); + #endif + // free space on flash { #if MICROPY_VFS_FAT |