To perform a firmware upgrade for CPU1 of an HS-FS device, compile the CPU1_APP build configuration of the project. This can be done by right-clicking the project, hovering over Build Configurations, and selecting CPU1_APP.
In the case of a Device Firmware Upgrade (DFU) command, the following steps take place:
- The kernel in CPU1 receives the command packet to
perform DFU.
- To prepare for a new application, the entirety of
flash is erased before programming.
- The kernel prepares to receive the X.509
certificate from the host.
- The kernel verifies that the incoming certificate
is of the proper size and format and derives the size of the incoming image. For
now, the certificate is stored in RAM.
- While there is no
authentication on the certificate or the incoming image during this process.
The certificate needs to still be generated properly as the kernel infers
the image size from the certificate and is authenticated during standalone
flash boot routine.
- If the certificate size and format are accepted,
then the kernel prepares to receive and program the new application to flash
- The kernel programs the incoming application in
chunks of 1024 bits. After each chunk is programmed, the kernel verifies that the
data and ECC were programmed correctly into flash.
- After successfully programming the entire image,
the kernel then programs the associated certificate into the first 0x1000 addresses
of FLC1 B0/B1. With the certificate programmed to this region of flash, the device
is able to boot to the existing application in the standalone flash boot mode.
To generate an application image that can be
loaded by the kernel, refer to the post-build step of Section 2.3. And see Section 5.1 for more details on usage.