Skip to main content

TF-M example on STM32U5

The stock firmware STM32U5-TFM (1.1.0) demonstrates use of Trusted Firmware for Cortex-M (TF-M) on a virtual STM32U5 IoT Discovery Kit for separating secure and non-secure programs.

For this example the firmware component in the firmware package is itself a ZIP archive, containing various binaries and load.txt file describing their location in memory:

name:tfm_s_init.bin load:0xc024000
name:tfm_ns_init.bin load:0xc052000
name:loader.bin load:0xc1fa000
name:TFM_SBSFU_Boot.bin load:0xc002000

Creating your device

To create your device, do the following:

  1. Create an STM32U5 device with the STM32U5-TFM (1.1.0) stock firmware. If you have any questions, please refer to our STM32U5 quickstart guide

    Create an STM32U5 board running TFM firmware

  2. On the Confirm Details screen you can specify the device name and verify your selections. Keep the advanced boot options unchecked and then click CREATE DEVICE.

    Confirmation screen

  3. The device will then be created. It takes a few moments...

    Creating device

  4. Your STM32U5 IoT Discovery Kit is now ready to go!

Running the example

To run the example:

  1. Click Console tab in the device's menu, if it is not open by default. You shall see a console menu to run various tests using Trusted Firmware. For example type 2 (Test TFM) followed by return.

    Test TFM

    :::Note You may see Invalid Number ! also menus printed twice this is because the device is interpreting the return keypress as a number. Please ignore this. :::

  2. Then type 0 ("TFM - Test All") followed by return to start tests.

    TFM - Test All

  3. Scroll through the Console to observe the results.