Post-Build Script imgtool

The compiler output requires a post-build step to generate a .bin file that can be used by MCUboot. An MCUboot compatible image tool must be executed called imgtool. It is responsible for adding the MCUBoot image header, managing keys and sign the image. More detailed description is provided on the imgtool documentation page. This tool requires Python3 and is included in the SimpleLink SDK in the folder <simplelink-install-dir>\source\third_party\mcuboot\scripts.

The script can be executed automatically after every build by adding below lines as Post-Build steps in Properties > Build as shown below. This command defines the image version. To update the version number, adjust the string --version 1.0.0.

Post-Build Steps
1${CG_TOOL_ROOT}/bin/tiarmobjcopy -O binary ${ProjName}.out ${ProjName}.bin --remove-section=.ccfg
2${COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR}/tools/common/mcuboot/imgtool sign --header-size 0x100 --align 4 --slot-size 0x4BF00 --version 1.0.0 --pad-header --pad --key ${COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR}/source/third_party/mcuboot/root-ec-p256.pem ${ProjName}.bin ${ProjName}.bin
../_images/mcuboot_postscriptsteps-cc13xx_cc26xx.png

Post-Build steps included in CCS properties