Skip to content

Commit ed4833d

Browse files
committed
stm32/modmachine: Add SPI flash size to machine.info dump.
Signed-off-by: Damien George <[email protected]>
1 parent de08190 commit ed4833d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/stm32/modmachine.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,14 @@ static mp_obj_t machine_info(size_t n_args, const mp_obj_t *args) {
247247
mp_printf(print, " 1=%u 2=%u m=%u\n", info.num_1block, info.num_2block, info.max_block);
248248
}
249249

250+
// SPI flash size
251+
#if defined(MICROPY_HW_SPIFLASH_SIZE_BITS)
252+
mp_printf(print, "SPI flash size: %d\n", MICROPY_HW_SPIFLASH_SIZE_BITS / 8);
253+
#endif
254+
#if defined(MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2)
255+
mp_printf(print, "QSPI flash size: %d\n", 1 << (MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2 - 3));
256+
#endif
257+
250258
// free space on flash
251259
{
252260
#if MICROPY_VFS_FAT

0 commit comments

Comments
 (0)