Skip to main content
Associate II
January 27, 2026
Question

STM32U575 FreeRTOS

  • January 27, 2026
  • 2 replies
  • 226 views

I have been trying to add freeRTOS to simple LED - TrustZone enabled project (default LED project). I just followed the instructions as given here: How to use STM32U5 with FreeRTOS™ in tickless mode - STMicroelectronics Community

This instruction shows enabling X_CUBE-FREERTOS for NS but this gave me the following errors: 

Suthan_0-1769532261766.png

So, I enabled for both, secure and non-secure versions in Cube MX

Suthan_1-1769532304214.png

This solved my previous errors but code hang in HAL_GTZC_MPCBB_ConfigMem() [Note: before enabling RTOS I did not see any issues in calling this function]

 

Suthan_2-1769532366826.png

Any suggestions?

2 replies

SuthanAuthor
Associate II
January 27, 2026

Also, I tried Solved: FreeRTOS in Trustzone - STMicroelectronics Community to compilation error with no luck!

Technical Moderator
January 29, 2026

Hello @Suthan 

To solve the build errors, keep FreeRTOS only in the Non‑Secure (NS) project and disable TrustZone awareness inside FreeRTOS, so that no secure‑context support is required. In practice, you do not enable X‑CUBE‑FREERTOS on the Secure side; instead, in the NS project’s FreeRTOSConfig.h you set configENABLE_TRUSTZONE to 0, configRUN_FREERTOS_SECURE_ONLY to 1, and (unless specifically needed) configENABLE_MPU to 0. This removes all references to SecureContext_LoadContext, SecureContext_FreeContext, SecureContext_Init, and SecureInit_DePrioritizeNSExceptions, because FreeRTOS is now built as a normal NS kernel without per‑task secure context management.

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question.Saket_Om"