Provisioned device
If you have provisioned the device, the hex file must be signed with the same key used during provisioning using the ModusToolbox™ Edge Protect Security Suite. To do this, add a
postbuild.bat
file with a command similar to the following, all on one line. Update the paths, file names, and key to match your configuration.
[path-to-edgeprotecttools]
\bin\edgeprotecttools sign-image --image "Debug/Exe/Empty_App.hex" --output "Debug/Exe/Empty_App.hex" --header-size 0x400 --slot-size 0x20000 --key keys/oem_rot_priv_key_0.pem --hex-addr 0x32000000 --align 1 --pad --security-counter 0 --erased-val 0 --public-key-format full --pubkey-encoding raw --signature-encoding raw --min-erase-size 0x200 --overwrite-only
Then, there are a few settings to configure the device before programming and debugging.
Open the options dialog to
Build Actions
and click
New
:

On the New Build Action dialog, type the
postbuild.bat
file in the
Command line
field, select "Run after linking" in the
Build order
field, and click
OK
:


Switch to
Output Converter
, enable
Generate additional output
, and select "Intel Hex file" in
Output format
:

Click
OK
to close the Options dialog.
On the IAR main menu, select
Project > Make
to build the application.
Go the
Program and debug
section.