feat: linker support for firmware in external flash (#5290)

This commit is contained in:
Raphael Coeffic
2024-07-26 21:34:43 +10:00
committed by GitHub
parent 4b917b762c
commit 3d8854abdf
17 changed files with 312 additions and 213 deletions
+9 -1
View File
@@ -590,9 +590,17 @@ if(ACCESS_DENIED)
target_link_libraries(firmware AccessDenied)
endif()
if(FIRMWARE_STRIP_BOOTLOADER)
# Strip bootloader from binary
message("-- Strip bootloader from firmware binary")
set(OBJCOPY_ARGS -R .bootloader)
else()
message("-- Bootloader contained in firmware binary")
endif()
add_custom_command(
TARGET firmware POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O binary firmware.elf firmware.bin
COMMAND ${CMAKE_OBJCOPY} -O binary ${OBJCOPY_ARGS} firmware.elf firmware.bin
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)