Skip to content

Commit 230dd3e

Browse files
committed
Always package encrypted binaries with embedded decryption stages
The embedded decryption stage only works if the binary is written to Flash and then loaded to SRAM by the bootrom
1 parent fdc61ca commit 230dd3e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,14 @@ function(pico_encrypt_binary TARGET AESFILE IVFILE)
491491
set_target_properties(${TARGET} PROPERTIES
492492
PICOTOOL_EMBED_DECRYPTION TRUE
493493
)
494+
495+
# Embedded decryption stage only works with packaged binaries
496+
get_target_property(uf2_package_addr ${TARGET} PICOTOOL_UF2_PACKAGE_ADDR)
497+
if (NOT uf2_package_addr)
498+
set_target_properties(${TARGET} PROPERTIES
499+
PICOTOOL_UF2_PACKAGE_ADDR 0x10000000
500+
)
501+
endif()
494502
endif()
495503

496504
if (ENC_MBEDTLS)

0 commit comments

Comments
 (0)