From fced9d6e8bba4d3d8967fc8995b3d5a38522d51a Mon Sep 17 00:00:00 2001 From: Adrien Ricciardi Date: Mon, 18 Dec 2023 15:23:22 +0100 Subject: [PATCH] examples: rh850: can_demo: Added a build step to generate a flashable firmware. Signed-off-by: Adrien Ricciardi --- examples/rh850/can_demo/build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/rh850/can_demo/build.sh b/examples/rh850/can_demo/build.sh index 667af96d2..0ff22ffe5 100644 --- a/examples/rh850/can_demo/build.sh +++ b/examples/rh850/can_demo/build.sh @@ -2,7 +2,9 @@ set -e +TRAMPOLINE_BASE_PATH="$(realpath ../../..)" PROGRAM_NAME=can_demo +FLASH_TOOL_PROGRAM_NAME=App_CDD_ICCOM_S4_Sample_G4MH echo "*** Run Goil ***" mkdir -p _build @@ -14,3 +16,10 @@ cmake -G "Unix Makefiles" -D CMAKE_TOOLCHAIN_FILE=../${PROGRAM_NAME}/compiler.cm echo "*** Run Make ***" make + +# Create the S-Record file to provide to Flash_Tool to set the G4MH core default firmware on board boot +# The flashing procedure expects 32-bit addresses, so use S3 records instead of S1 +objcopy -O srec --srec-forceS3 ${PROGRAM_NAME}_exe.abs ${FLASH_TOOL_PROGRAM_NAME}.s3 +# Add a specific header +rlink "$(cygpath -w ${TRAMPOLINE_BASE_PATH}/machines/rh850/g4mh/G4MH_Head.srec)" ${FLASH_TOOL_PROGRAM_NAME}.s3 -FOrm=SType -OUtput=${FLASH_TOOL_PROGRAM_NAME}.srec +rm -f ${FLASH_TOOL_PROGRAM_NAME}.s3