cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575 FreeRTOS

Suthan
Associate II

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 2
Suthan
Associate II

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

Saket_Om
ST Employee

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