From e6739fc87e9d633484aeb72fa2efac14e4ff7681 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Tue, 8 Jul 2025 14:02:42 +0100 Subject: [PATCH] rp2/rp2_flash: Add binary info for ROMFS. This describes the ROMFS location and size in Pico SDK's binary declaration format, so it can be read from a .uf2 file for use with various tools. Signed-off-by: Phil Howard --- ports/rp2/rp2_flash.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ports/rp2/rp2_flash.c b/ports/rp2/rp2_flash.c index d6b9e13653..4d41d45733 100644 --- a/ports/rp2/rp2_flash.c +++ b/ports/rp2/rp2_flash.c @@ -103,6 +103,18 @@ bi_decl(bi_block_device( BINARY_INFO_BLOCK_DEV_FLAG_WRITE | BINARY_INFO_BLOCK_DEV_FLAG_PT_UNKNOWN)); +#if MICROPY_HW_ROMFS_BYTES +// Tag the ROMFS partition in the binary +bi_decl(bi_block_device( + BINARY_INFO_TAG_MICROPYTHON, + "ROMFS", + XIP_BASE + MICROPY_HW_ROMFS_BASE, + MICROPY_HW_ROMFS_BYTES, + NULL, + BINARY_INFO_BLOCK_DEV_FLAG_READ | + BINARY_INFO_BLOCK_DEV_FLAG_PT_UNKNOWN)); +#endif + // This is a workaround to pico-sdk #2201: https://github.com/raspberrypi/pico-sdk/issues/2201 // which means the multicore_lockout_victim_is_initialized returns true even after core1 is reset. static bool use_multicore_lockout(void) {