Skip to main content
FHumb.1
Associate
Mar 17, 2020 1:47 PM UTC
Solved

Using FreeRTOS with TrustZone in STM32CubeIDE - STM32L562

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!

This topic has been closed for replies.
Khouloud ZEMMELI
Khouloud ZEMMELIBest answer
ST Employee
Mar 18, 2020 12:56 PM UTC

​Hello @FHumb.1​ ,

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

Best Regards,

Khouloud

10 replies

FHumb.1
FHumb.1Author
Associate
Mar 17, 2020 2:02 PM UTC

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
Super User
Mar 17, 2020 2:35 PM UTC

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.

FHumb.1
FHumb.1Author
Associate
Mar 18, 2020 10:51 AM UTC

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
Khouloud ZEMMELIBest answer
ST Employee
Mar 18, 2020 12:56 PM UTC

​Hello @FHumb.1​ ,

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

Best Regards,

Khouloud

FHumb.1
FHumb.1Author
Associate
Mar 18, 2020 1:47 PM UTC

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

Khouloud ZEMMELI
ST Employee
Mar 18, 2020 1:57 PM UTC

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

Best Regards,

Khouloud