cancel
Showing results for 
Search instead for 
Did you mean: 

Using FreeRTOS with TrustZone in STM32CubeIDE - STM32L562

FHumb.1
Associate II

I have a development kit for the STM32L562, I'm trying to create a blinky-script that will use FreeRTOS to blink a led in the secure-world and the non-secure world simultaneously.

Steps to reproduce:

  • Install STM32CubeIDE 1.3.0
  • New STM32 Project
  • Look for the board that matches l562 in the search bar
  • Create project
  • Set project name
  • Set targeted language to c++
  • check "Enable TrustZone"
  • click finish
  • Click yes to both popups

Once the project is loaded, the following configuration needs to be done in the "projectname.ioc" :

  • Go to Middleware->FreeRTOS
  • Select "interface: CMSIS_V2"
  • save the configuration
  • generate the device configuration code
  • Right click "projectname_Secure" project and click on "build project"

You should now be getting errors about "FreeRTOS.h" not being found by several files.

If you add '/projectname/Middlewares/Third_Party/FreeRTOS/Source/include' to your include paths, you should no longer be getting the not found error, but should be getting multiple definition errors.

Does anyone know what I'm doing wrong?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Khouloud ZEMMELI
ST Employee

​Hello @FHumb.1​ ,

Thanks for your feedback, issue confirmed, it will be internally fixed.

Best Regards,

Khouloud

View solution in original post

10 REPLIES 10
FHumb.1
Associate II

It looks like it's a "known issue" in STM32CubeIDE V1.3.0 (ID: 79065) according to the release notes

Does anyone have a workaround for this?

KnarfB
Principal III

Not directly a workaround, but a remark: If you generate your project without FreeRTOS, but with HAL, one Drivers folder will be create in the file system, but two "Linked Folders" Drivers appear in the project: one in the secure world and one in the insecure world.

What if you create a new folder Middleware parallel to Drivers, copy the FreeRTOS stuff from elsewhere into it and create two linked folders: one in the secure world and one in the insecure world.

Thanks for your suggestion!

I've added FreeRTOS manually to the project, and after some compiler issues I'm able to build and flash the project. However, as soon as the chip starts it generates a hardfault. I have no idea what that is about or how to trace the issue... The example from freertos about hardfault debugging doesn't seem to work as it generates a hardfault in the secure-zone after getting the hardfault in non-secure.

Khouloud ZEMMELI
ST Employee

​Hello @FHumb.1​ ,

Thanks for your feedback, issue confirmed, it will be internally fixed.

Best Regards,

Khouloud

Hello @Khouloud ZEMMELI​ Thanks for getting back to me!

Do you have a timeline as to when this could be fixed? I badly need this to work if I want to be able to do the project.

Regards,

Florian

​We will try to fix this issue for the next release, I'll give you an update as soon as possible.

Best Regards,

Khouloud

Any idea when the next release will be? From looking at past releases it could take anywhere from a week to a few months...

I Might be better off getting a different chip if it is going to take that long.

​The CubeMX 6.0.0 will be available for the W27.

Hello @Khouloud ZEMMELI​ ,

Do you have any update on the release of CubeMX 6.0.0 as I would like to be able to start developing with FreeRTOS soon.

Thank you,

Clement