Skip to content

Commit

Permalink
Add SREC hex dump to the app flow (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmallasen authored Nov 11, 2024
1 parent a39bc88 commit 0f28c2c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ FOREACH(file_path ${new_list})
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Prune list

if( add EQUAL 1 ) # If the file path mathced one of the criterion, add it to the list
if( add EQUAL 1 ) # If the file path matched one of the criterion, add it to the list
# Get the path of the obtained directory
GET_FILENAME_COMPONENT(dir_path ${file_path} PATH)

Expand Down Expand Up @@ -478,17 +478,20 @@ add_custom_command(TARGET ${MAINFILE}.elf POST_BUILD
# Post processing command to create a hex file
if((${LINKER} STREQUAL "flash_load") OR (${LINKER} STREQUAL "flash_exec"))
add_custom_command(TARGET ${MAINFILE}.elf POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O verilog --adjust-vma=-0x40000000 ${MAINFILE}.elf ${MAINFILE}.hex
COMMAND ${CMAKE_OBJCOPY} -O verilog --adjust-vma=-0x40000000 ${MAINFILE}.elf ${MAINFILE}.hex
COMMENT "Invoking: Hexdump")
else()
add_custom_command(TARGET ${MAINFILE}.elf POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O verilog ${MAINFILE}.elf ${MAINFILE}.hex
COMMAND ${CMAKE_OBJCOPY} -O verilog ${MAINFILE}.elf ${MAINFILE}.hex
COMMENT "Invoking: Hexdump")
add_custom_command(TARGET ${MAINFILE}.elf POST_BUILD
COMMAND ${CMAKE_OBJCOPY} --srec-forceS3 --srec-len 1 -O srec ${MAINFILE}.elf ${MAINFILE}.hex.srec
COMMENT "Invoking: SREC Hexdump")
endif()

add_custom_command(TARGET ${MAINFILE}.elf POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O binary ${MAINFILE}.elf ${MAINFILE}.bin
COMMENT "Invoking: Hexdump")
COMMENT "Invoking: Binary dump")

# Pre-processing command to create disassembly for each source file
if ((${COMPILER} MATCHES "gcc") OR (${COMPILER} MATCHES "clang"))
Expand Down

0 comments on commit 0f28c2c

Please sign in to comment.