Skip to content

Commit e6739fc

Browse files
Gadgetoiddpgeorge
authored andcommitted
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 <[email protected]>
1 parent a9dd741 commit e6739fc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ports/rp2/rp2_flash.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ bi_decl(bi_block_device(
103103
BINARY_INFO_BLOCK_DEV_FLAG_WRITE |
104104
BINARY_INFO_BLOCK_DEV_FLAG_PT_UNKNOWN));
105105

106+
#if MICROPY_HW_ROMFS_BYTES
107+
// Tag the ROMFS partition in the binary
108+
bi_decl(bi_block_device(
109+
BINARY_INFO_TAG_MICROPYTHON,
110+
"ROMFS",
111+
XIP_BASE + MICROPY_HW_ROMFS_BASE,
112+
MICROPY_HW_ROMFS_BYTES,
113+
NULL,
114+
BINARY_INFO_BLOCK_DEV_FLAG_READ |
115+
BINARY_INFO_BLOCK_DEV_FLAG_PT_UNKNOWN));
116+
#endif
117+
106118
// This is a workaround to pico-sdk #2201: https://github.com/raspberrypi/pico-sdk/issues/2201
107119
// which means the multicore_lockout_victim_is_initialized returns true even after core1 is reset.
108120
static bool use_multicore_lockout(void) {

0 commit comments

Comments
 (0)