
UM2262 Rev 6
79/94
UM2262
Firmware image preparation tool
93
The tool uses the appropriate set of files based on the cryptographic scheme selected by
means of
SECBOOT_CRYPTO_SCHEME
in file
Applications\2_Images\2_Images SECoreBin\Inc\se_crypto_config.h
.
E.3 Outputs
The tool generates:
•
The
se_key.s
file compiled in the
SECoreBin
project: this file contains the keys (private
symmetric key and public ECC key when applicable) embedded in the device and the
code to access them. When running the tool from the IDE, this file is located in
Applications\2_Images \2_Images SECoreBin\EWARM\
.
•
A
.sfb
file packing the user firmware header and the encrypted user firmware image
(when the selected cryptographic scheme enables user firmware encryption). When
running the tool from the IDE, this file is generated in
Applications\2_Images\2_Images UserApp\Binary\
.
•
A
.bin
file concatenating the SBSFU binary, UserApp binary, and active FW image
header. Flashing this file into the device with a flasher tool makes the UserApp
installation process simple, since the FW header and FW image are already correctly
installed. It is not needed to use the SBSFU application for installing the UserApp.
For STM32 devices with OTFDEC support and external Flash, two separate binary files
are generated:
–
A first binary concatenating SBSFU binary and active FW image header
(
SBSFU_UserApp_Header.bin
) to be programmed into the internal Flash memory.
–
A second binary (
UserApp.sfb
) to be Programmed into the external memory at the
Slot #0 start address.
Caution
:
–
Before programming the
.bin
file into the device, a mass erase must be performed.
In order to detect any malicious software, SBSFU verifies at start up that there is
no additional code after UserApp in Slot #0.
–
When Slot #0 is located in external Flash, Slot #0 must be erased before
programming the
.bin
file.
•
Two log files,
output.txt
, located in
Applications\2_Images \2_Images SECoreBin\EWARM\
and in
Applications\2_Images\2_Images UserApp\EWARM
to trace the executions of
prebuild.bat
and
postbuild.bat
.
E.4 IDE
integration
The
prepareimage
tool is integrated with the IDEs as Windows
®
batch files for:
•
Pre-build actions for the
SECoreBin
application: at this stage, the cryptographic keys
are managed
•
Post-build actions for the
UserApp
application: at this stage, the firmware image is built