STM32CubeMX

Table Of Contents

- STM32CubeMX documentation
- CubeMX User Manual
  - 1 STM32Cube overview
  - 2 Getting started with STM32CubeMX
  - 3 Installing and running STM32CubeMX
  - 4 STM32CubeMX user interface
  - 5 STM32CubeMX tools
  - 6 STM32CubeMX C Code generation overview
  - 7 Code generation for dual-core MCUs (STM32H7 dual-core product lines only)
  - 8 Code generation with TrustZone enabled (STM32L5 series only)
  - 9 Device tree generation (STM32MPUs only)
  - 10 Support of additional software components using CMSIS-Pack standard
  - 11 Tutorial 1: From pinout to project C code generation using an MCU of the STM32F4 series
  - 12 Tutorial 2 - Example of FatFs on an SD card using STM32429I-EVAL evaluation board
  - 13 Tutorial 3 - Using the Power Consumption Calculator to optimize the embedded application consumption and more
  - 14 Tutorial 4 - Example of UART communications with an STM32L053xx Nucleo board
  - 15 Tutorial 5: Exporting current project configuration to a compatible MCU
  - 16 Tutorial 6 - Adding embedded software packs to user projects
  - 17 Tutorial 7 - Using the X-Cube-BLE1 software pack
  - 18 Creating LPBAM projects
  - Appendix A STM32CubeMX pin assignment rules
  - Appendix B STM32CubeMX C code generation design choices and limitations
  - Appendix C STM32 microcontrollers power consumption parameters
  - Appendix D STM32Cube embedded software packages
  - Revision history
- Release Notes
  - Release details
  - Release fixes
  - Known limitations
    - Miscellaneous
    - 2.1. When selecting microcontrollers in the STM32C0 series
    - 2.2. When selecting microcontrollers in the STM32G0 series
    - 2.3. When selecting microcontrollers in the STM32G4 series
    - 2.4. When selecting microcontrollers in the STM32H5 series
    - 2.5. When selecting microcontrollers in the STM32H7 series
    - 2.6. When selecting dual-core microcontrollers in the STM32H7 series
    - 2.7. When selecting microcontrollers in the STM32L5 series
    - 3.4. How to improve the wake-up from Stop sequences without relying on the global SystemClock_Config()
    - 3.3. List pinout-compatible microcontrollers
    - 3.2. DDR binaries for the STM32MP1 boards
    - 3.1. Command line authentication required
    - 2.21. Symbolic links on Ubuntu
    - 2.20. User manual
    - 2.19. DDR test suite
    - 2.18. STM32CubeIDE toolchain
    - 2.13. When selecting microcontrollers in the STM32WL series
    - 2.11. When selecting microcontrollers in the STM32WB series
    - 2.17. When using additional software packs
    - 2.16. When using the Example Selector
    - 2.15. When using the Memory Management Tool
    - 2.14. When selecting microprocessors in the STM32MP1 series
    - 2.11.1. When selecting microcontrollers in the STM32WB0 product lines
    - 2.12. When selecting microcontrollers in the STM32WBA series
    - 2.13.1. When selecting microcontrollers in the STM32WL33 product lines
    - 2.10. When selecting microcontrollers in the STM32U5 series
    - 2.9. When selecting microcontrollers in the STM32U3 series
    - 2.8. When selecting microcontrollers in the STM32N6 series
- Running STM32CubeMX in command-line mode
- FAQ
- Community

# 8 Code generation with TrustZone enabled (STM32L5 series only)

• Arm Cortex-M4 core booting, Arm Cortex-M7 gated

> • A first core booting executing from flash, loads the second core code to the SRAM then enables the second core to boot.

> STM32CubeMX uses template files delivered with STM32CubeH7 MCU packages as reference.

> Code generation with TrustZone enabled (STM32L5 series only)

> 8 Code generation with TrustZone enabled (STM32L5 series only)

> In STM32CubeMX project manager view, all project generation options remain available.

> However, the choice of toolchains is limited to the IDEs/compilers supporting the Cortex ® -M33 core:

> • EWARM v8.32 or higher

> • MDK-ARM v5.27 or higher (ARM compiler 6)

> • STM32CubeIDE (GCC v4.2 or higher)

> • Makefile (GCC v4.2 or higher)

> Upon product selection, STM32CubeMX requires to choose between enabling TrustZone or not.

> • When TrustZone is enabled, STM32CubeMX generates two C projects: one secure and one nonsecure. After compilation, two images are available for download, one for each context.

> • When TrustZone is disabled, STM32CubeMX generates a nonsecure C project, as for other products not supporting it.

> Specificities

> When TrustZone is enabled, the project generation must be adjusted to ensure that secure and nonsecure images can be built.

> Figure 581. Building secure and nonsecure images with ARMv8-M TrustZone

> Code generation with TrustZone enabled (STM32L5 series only)

> When TrustZone is enabled for the project, STM32CubeMX generates three folders:

> • NonSecure for nonsecure code

> • Secure for secure code

> • Secure_nsclib for nonsecure callable region

> See Figure 582 (use TZ_BasicStructure_project_inCubeIDE.png) and Figure 583 (use STM32L5_STM32CubeMX_Project_settings_inCubeIDE.png).

> Figure 582. Project explorer view for STM32L5 TrustZone enabled projects

> Code generation with TrustZone enabled (STM32L5 series only)

> Figure 583. Project settings for STM32CubeIDE toolchain

> STM32CubeMX also generates specific files, detailed in Table 28.

> Table 28. Files generated when TrustZone is enabled

> File | Folder | Details
> The product core secure/nonsecure partitioning .h “template” file Example: partition_stm32l552xx.h | Secure | Initial setup for secure/nonsecure zones for ARMCM33 based on CMSIS CORE V5.3.1 partition_ARMCM33.h Template. It initializes Security attribution unit (SAU) CTRL register, setup behavior of Sleep and Exception Handling, Floating Point Unit and Interrupt Target.
> secure_nsc.h file | Secure_nsclib | Must be filled by the user with the list of nonsecure callable APIs. Templates are available as reference in STM32L5Cube embedded software package in Templates\TrustZone®\Secure_nsclib folders.
> System_stm32l5xx_s.c | Secure | CMSIS Cortex-M33 device peripheral access layer system source file to be used in secure application when the system implements security.

> Code generation with TrustZone enabled (STM32L5 series only)

> Table 28. Files generated when TrustZone is enabled (continued)

> File | Folder | Details
> System_stm32l5xx_ns.c | NonSecure | CMSIS Cortex-M33 device peripheral access layer system source file to be used in nonsecure application when the system implements security.

> System_stm32l5xx_ns.c | NonSecure | CMSIS Cortex-M33 device peripheral access layer system source file to be used in nonsecure application when the system implements security. |