When compared to the C28-based designs,
the UART flash kernel for F29H85x is quite different due to the integration of the HSM.
A high-level overview of the features implemented in this example is provided below.
- CPU1 DFU (HS-FS only)
- Device need to be configured
for Bank Mode 0.
- Flash kernel in CPU1 programs
application to the flash banks.
- Certificate is programmed in
0x10000000 - 0x10000FFF, certificate is not used for authentication but
rather to infer the size of the kernel binary.
- Application can be programmed
in the remaining flash addresses, and TI recommends to program codestart at
0x10001000. As 0x10001000 is the flash entry address in flash boot
mode.
CAUTION: For users not concerned
with the security features provided by the HSM, simply use the CPU1 DFU flow to upgrade
the CPU1 firmware.
- Load HSMRt (prerequisite for Key
& Code Provisioning)
- Flash kernel in CPU1 receives
key provisioning HSM run-time (HSMRt) and places in LDAx RAM.
- HSM authenticates HSMRt image
and begin executing the run time in LDAx RAM.
- CPU1 Key Provisioning (HS-FS ->
HS-KP )
- Flash kernel in CPU1 loads
HSMRt
- Flash kernel receives key
certificate and places in LDAx RAM
- HSM validates key certificate
and programs them to OTP
- CPU1 Code Provisioning (HS-SE
only)
- Flash kernel in CPU1 loads in
HSMRt
- Flash Kernel receives the
CPU1 application image certificate and shares the same with HSMRt
- After successful
authentication of the image, HSMRt responds with an acknowledgment, after
which flash kernel starts importing the chunk of data via UART into the LDAx
memory.
- After each 16KB (size of LDAx
memory) of data received, the flash kernel sends an HSM requests to program
the data for further processing
- After all chunks are received
and programmed, HSMRt is requested to verify the code programmed in HSM
active and dormant banks. When the HSMRt firmware authenticates the
programmed image against the certificate, the certificate is further
programmed to make sure of a successful boot in the subsequent power
cycles.
- Upon successful
authentication, the HSM programs the firmware to CPU1 flash
- HSM Code Provisioning ( HS-KP/HS-SE
-> HS-SE )
- Flash kernel in CPU1 loads in HSMRt
- Flash kernel receives the HSM application image certificate and
shares the same with HSMRt
- After successful
authentication of the image, HSMRt responds with an acknowledgment, after
which flash kernel starts importing the chunk of data via UART into the LDAx
memory.
- After each 16KB (size of LDAx
memory) of data received, the flash kernel sends an HSM requests to program
the data for further processing
- After all chunks are received
and programmed, HSMRt is requested to verify the code programmed in HSM
active and dormant banks. When the HSMRt firmware authenticates the
programmed image against the certificate, the certificate is further
programmed to make sure of a successful boot in the subsequent power
cycles.
- SECCFG Code Provisioning (HS-KP ->
HS-SE )
- Flash kernel in CPU1 loads in
HSMRt
- Flash kernel receives the
image certificate and shares the same with HSMR
- After successful
authentication of the image, HSMRt responds with an acknowledgment, after
which flash kernel starts importing the SecCfg data via UART into the LDAx
memory
- After all the SecCfg data are
received and programmed, the HSMRt is requested to verify the SecCfg
programmed in the dormant banks with valid counter values. When the HSMRt
authenticates the programmed image against the certificate, the certificate
is further programmed to make sure of a successful boot in the subsequent
power cycles.
- Note in the case of HS-SE
device, the decision of programming of the certificate is made on the swap
value of the SSU registers.
CAUTION:
Key and code provision both require a
RAM-based HSMRt image to be running on the HSM. Nonetheless, the image requires a
different key certificate at each stage of provisioning.
In key provisioning, user must provide
the HSMRt image with default TI key certificate to complete authentication on an
HS-FS device, whereas code provisioning requires an image with user key certificate
to complete authentication on an HS-KP/HS-SE device.
The OTP Keywriter firmware described
in the Hardware Security Module section contains a binary image that can
perform these tasks.
The UART flash kernel is designed for CPU1
while in Bank Mode 0. This means that all flash banks are allocated to CPU1 and the bank
swapping feature is not available. For more details on Bank Modes, please see the
Bank Modes and Swapping section of the TRM. The flash kernel communicates
with the host PC application provided in the F29H85x MCU SDK (MCU_SDK_F28H85x >
utilities > flash_programmers > serial_flash_programmer) and provides
feedback to the host on the receiving of packets and completion of commands given.
After loading the kernel into RAM and
executing by the UART ROM bootloader, the kernel first initializes the PLLs, GPIOs, the
UARTA module, and the flash module. The UART communication is configured with a baud
rate of 115200, similar to the UART boot flow. After this, the kernel begins a while
loop, which waits on commands from the host, executes the commands, and sends a status
packet back to the host. This while loop breaks when a Run or Reset command is sent.
Commands are sent in a packet described in
Table 4-2 and each packet is either acknowledged or not-acknowledged. All commands, except for
Run and Reset, send a packet after completion with the status of the operation. The
status packet sends a 16-bit status code and 32-bit address. In case of an error, the
address in the data specifies the address of the first error. In case of
NO_COMMAND_ERROR, the address is 0x1000.