Page 1
UM2745 User manual ® STM32CubeL5 TFM security guidance for SESIP profile for Arm PSA Level 2 chip Introduction This document describes how to prepare STM32L5 microcontrollers to make a secure system solution compliant with SESIP Profile for PSA L2 using the STM32Cube_FW_L5_V1.1.0 SW package.
Memory protection unit Platform security architecture. Framework for securing devices. Root of trust Secure boot and secure firmware update. In the STM32CubeL5 this is the name of the TF-M based application, SBSFU with secure boot and secure firmware update functionalities only.
Page 3
UM2745 General information Acronym Description Write protection UM2745 - Rev 1 page 3/36...
User Flash. The software package can be downloaded directly from the STMicroelectronics. Note that it is the responsibility of the integrator to choose the correct STM32CubeL5 package version. • How to accept STM32L5 microcontroller: by reading, with STM32CubeProgrammer (for more details, refer to...
Copy STM32Cube_FW_L5_V1.1.0 SW package on your Windows host hard disk at the following location “C:\data” Development toolchains and compilers TFM tests will be done using CubeIDE projects delivered in the STM32CubeL5 SW Package, so STM32CubeIDE tool (version: 1.2.0.19w47 Build: 4750_20191121_1215 or version: 1.2.0 Build: 5034_20300108_0926) shall be installed on the host.
UM2745 Secure installation Software tools for programming STM32 microcontrollers STM32CubeProgrammer V2.2.0 (STM32CubeProg) is an all-in-one multi-OS software tool for programming STM32 microcontrollers. It provides an easy-to-use and efficient environment for reading, writing and verifying device memory through both the debug interface (JTAG and SWD) and the bootloader interface (UART and USB).
UM2745 Secure installation Step1: Connection: Menu Target / Connect with Hot plug mode selected Figure 1. STM32CubeProgrammer connection menu Step2: Option bytes settings: Menu Target / Option bytes On a virgin chip, the following Option byte values shall be set: •...
UM2745 Secure installation 3.3.2 Application compilation process With STM32CubeIDE IDE, build the 3 TFM related projects (refer to Figure 6. STM32CubeIDE TFM projects) provided in the STM32Cube_FW_L5_V1.1.0 SW package (strictly following the order described hereafter): • TFM_SBSFU project compilation: \Projects\STM32L562E-DK\Applications\TFM\TFM_SBSFU\ In the context of security certification, TFM_SBSFU project shall be compiled in “production mode”...
UM2745 Secure installation Figure 7. STM32L5 User Flash memory mapping Non secure area Secure area Non-secure image secondary slot Non secure area Area 3 (72 KB) FLASH_AREA_3_OFFSET: 0x0C06E000 Non-secure image secondary slot Non secure area Area 2 (144 KB) FLASH_AREA_2_OFFSET: 0x0C04A000 Non-secure image secondary slot Non secure Area 1...
UM2745 Secure installation • Step3: TFM_SBSFU binary at Flash memory address FLASH_AREA_PERSO_OFFSET. 3.3.4 Configuring STM32L5 static security protections Static security protections in STM32L5 option bytes are configured by means of the STM32CubeProg TOOL through the following 3 steps: Step1: Connection: Menu Target / Connect with Hot plug mode selected Figure 9.
ST-LINK disable The security mechanisms managed by TFM_SBSFU forbid JTAG connection (interpreted as an external attack). The ST-LINK must be disabled to establish a Tera Term connection. The following procedure applies from ST- LINK firmware version V2J29 onwards: Power cycle the board after flashing binaries (unplug/plug the USB cable and remove jumper on STM32L562E-DK board).
UM2745 Tera Term connection preparation procedure Figure 13. Jumper to remove on STM32L562E-DK board 3.4.2 Tera Term launch The Tera Term launch requires that the port is selected as COMxx: STMicroelectronics STLink Virtual COM port. Figure hereafter illustrates an example based on the selection of port COM44. Figure 14.
UM2745 Tera Term connection preparation procedure Figure 15. Tera Term setup screen Note: After each plug / unplug of the USB cable, the Tera Term Serial port setup menu may have to be validated again to restart the connection. Press the Reset button to display the welcome screen. The virtual COM port is used to log information;...
STMicroelectronics. The integrator has full access to the source code delivered in the STM32CubeL5 SW package, has full access to the STM32L5 chip security features (STM32L5 IC is delivered as virgin state without any security features activated) that will be integrated on its board and has full access to the tools needed to program the TOE.
Page 20
UM2745 Operational guidance for the role integrator Follow procedures described in the Section 3.1 Secure acceptance to check if you use the TOE in the certified configuration. The certified configuration of the TOE could be impacted when changing some parts of the TOE but could also be impacted when changing some parts located outside the TOE scope.
Instance ID (sha256 of public EAT key - unique per chip) Figure 18. Integrator minimum customizations Non secure area Secure area ST TFM application example Non-secure image secondary slot Non-secure image secondary slot Non secure area Non secure area Area 3...
UM2745 Operational guidance for the role integrator Figure 19. Integrator personalized data in source code Figure 20. Integrator personalized data in TFM_SBSFU binary (huk_value example) The flexibility for an integrator to personalize the “Integrator Perso data” binary data without compromising the TOE security falls within the scope of this evaluation and remains the certified configuration.
UM2745 Operational guidance for the role integrator Secure Storage size change The integrator can also choose to change the size of secure storage areas located in the TOE (size of the protected Storage area used by the Protected Storage API of the TOE and/or size of the Internal Trusted Storage area used by the Internal Trusted Storage API).
Page 24
UM2745 Operational guidance for the role integrator • Always initialize/clear allocated memory – do not rely on uninitialized data, prevent from leakage of residual information. • The API extension shall not modify any global system variables. It is permitted to use only local private variables and memory allocated/mapped by the API extension itself and care must be taken not to reveal sensitive system variable values (ie keys).
UM2745 Operational guidance for the role integrator Figure 21. Secure image secondary slot region mapping Non secure area Secure area Non-secure image secondary slot Non secure area Area 3 (72 KB) FLASH_AREA_3_OFFSET: 0x0C06E000 Non-secure image secondary slot Non secure area Area 2 (144 KB) FLASH_AREA_2_OFFSET: 0x0C04A000...
UM2745 Operational guidance for the role integrator Errors: Candidate image is not installed in the “Secure image primary” slot in case of following errors: • Version dependency failure: version of secure image non consistent with version of the non-secure image. Candidate image is not installed in the “Secure image primary”...
UM2745 Operational guidance for the role integrator To use the Non-Secure image secondary slot, data shall be written at the correct format in the Non-Secure image secondary slot area as illustrated hereafter: Figure 24. Non-secure image format Parameters Candidate image written in the “Non-Secure image secondary” slot. Actions At each product reset TOE (TFM_SBSFU application) checks if a new Non-Secure image has been pre-loaded by the non- secure application in the “Non-Secure image secondary”...
Page 28
UM2745 Operational guidance for the role integrator Non secure application interacts with the secure application via the standard PSA APIs as described in the Open Source documents [PSA_ST_API], [PSA_CRYPTO_API] and [PSA_ATTESTATION_API] which describe each PSA API. As an example, psa_cipher_decrypt API is illustrated hereafter: Method of use: Call the following function.
UM2745 Operational guidance for the role integrator JTAG interface Standard JTAG with SWD interface allows debugging of the TOE and integrator application. It is used according to [IEE1149] and [ADI5]. JTAG interface can be used by the integrator in a secure environment during product manufacturing phase (STM32L5 internal flash programming, STM32L5 security configuration) but JTAG interface shall be disabled at least for the secure part (automatically blocked when setting RDP level >=0.5 in STM32L5 option bytes) as soon as the product leaves the secure area manufacturing secure area.
UM2745 Operational guidance for the role integrator • PSA APIs violation: Any calls to PSA APIs go through a secure/privilege fix entry point managed by the TOE. The TOE secure/privilege entry point controls the access to each TF-M Secure Partition, from the non- secure application or from the secure/non-privileged services, by checking the validity of parameters of any operation requested.
UM2745 Operational guidance for the role integrator In order to achieve TOE_PERSONALIZATION, the following measures shall be taken: • As described in section TOE specific information personalization Section 4.2.1 User-accessible functions and privileges (AGD_OPE.1.1C), some TOE immutable data are unique per product (EAT public key, EAT private key and HUK).
UM2745 List of figures List of figures Figure 1. STM32CubeProgrammer connection menu ..........8 Figure 2.
Page 36
ST’s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers’...
Need help?
Do you have a question about the STM32CubeL5 and is the answer not in the manual?
Questions and answers