How to enable secure boot on STM32 MPU

Revision as of 10:41, 23 June 2022 by Registered User
Applicable for STM32MP13x lines, STM32MP15x lines

1. Article purpose[edit source]

The main purpose of this article is to give main steps on how to enable security on MPU platforms.

2. Overview[edit source]

A STM32 MPU offers multiple ways to control and enforce security on the device. It exists some hardware and software mechanism that can be adapted by the users to set the MPU to the expected security level. These security protection mechanism are offers to users and fully customizable.

3. Device life cycle[edit source]

The STM32MP1 proposes different hardware state that manage different protection levels when changing state.

There are 3 modes defined at hardware level:

Alternate text
Device states
  • OPEN state: By default the device is in open state. Authentication is not mandatory. It can be used to test authentication as error does not prevent FSBL from being started. Debugger is enabled with a limited access.
  • CLOSED state: Once product secrets keys have been provisioned into the device, it can be closed. On closed devices, authentication is mandatory. An authentication error prevents FSBL from being started. All debug access are default turn off.
  • RMA state: A closed device can be put once in RMA state and back again in CLOSED state. When the device is in RMA state, all ROM code features are disabled.

On STM32MP15x lines More info.png, it is possible to go back to close state.

4. Secure Boot[edit source]

Warning white.png Warning
Make sure that a device with Secure boot enabled is used: this is mentioned in the chip part number, for STM32MP13 and STM32MP15, otherwise the device will become permanently unusable.

The secure boot is essential to ensure the integrity and security of the platform at runtime.

The STM32 MPU trusted boot chain is designed to guarantee such a secure boot sequence.
It performs the following tasks:

  • Configuration of the platform firewall, which is the foundation for a safe execution of the platform
  • Configuration of the platform debug capabilities
  • Verification of the integrity (thanks to a hash algorithm) and authentication (using asymmetric cryptography algorithms) of the started software components, including the Secure and non-secure worlds.

TF-A is the recommended open source bootloader. Its implementation supports the trusted boot and peripheral access control with firewall.

Once the STM32 MPU is in CLOSED state, the secure boot is enabled and cannot be bypass.

4.1. STM32MPU keys[edit source]

The secure boot relies on different keys fit the secure boot implementation.
STM32MP15x lines More info.png:

  • PKH : Hash of the ECC Public Key (ECDSA is the authentication algorithm STM32MP15_OTP_mapping) used to compare the public root key. This file is automatically generated by the KeyGen_tool.
    • ROM code used it to compare against the public key included in the STM32 header.
    • TF-A BL2 used it to compare against the public root key from the trusted certificate.

STM32MP13x lines More info.png:

  • PKHTH : Hash of the 8 ECC Public Keys Hashes Table (ECDSA is the authentication algorithm STM32MP13_OTP_mapping) used to compare the public root key. This file is automatically generated by the KeyGen_tool.
    • ROM code used it to compare against the public key table hash included in the STM32 header.
    • TF-A BL2 used it to compare against the public key table hash included in the STM32 header.
  • EDMK :

4.1.1. Provisionning[edit source]

4.2. STM32MP1 secure boot[edit source]

The STM32MP1 secure boot implementation is described in :

5. References[edit source]