Skip to content

Commit

Permalink
examples: rh850: can_demo: Added a build step to generate a flashable…
Browse files Browse the repository at this point in the history
… firmware.

Signed-off-by: Adrien Ricciardi <[email protected]>
  • Loading branch information
RICCIARDI-Adrien committed Dec 18, 2023
1 parent 82ae9fb commit fced9d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/rh850/can_demo/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit fced9d6

Please sign in to comment.