Porting FreeRTOS to STM32F429ZI Discovery

Hello All,

This is my first experience to port freeRTOS on a real target. I am using Atollic studio version 9.3.0 based on Eclipse Neon. I am facing some problems and I want to list them, if anybody can help.

1- I started from scratch and used this demo of Cortex-M3 https://www.freertos.org/FreeRTOS-for-Cortex-M3-STM32-STM32F100-Discovery.html
and did everything, but always I am facing undefined reference with some APIs like xTaskCreate, vTaskStartScheduler, etc. Although the include paths are correct and I can reach the functions declaration and definitions easily. I think this problem might be related to IDE based when you have many files and includes the linker might lose its capability of correct linking and you should exclude some files from the build to pass.

2- I started again from scratch but this time for M4 processor, I added the FreeRTOS core manually and configured it, set include paths and everything then I created my first program to toggle a LED. but once the program reaches vTaskStartScheduler, the task didn’t start. even the xtaskcreate returned pdPASS and the program didn’t return from vTaskStartScheduler. Could you please help me to figure out the problem

Sounds like you’re on the right track with #2.

Have you seen this help page? It’s very helpful for getting started. It will tell you about

  • installing the 3 interrupt vectors critical for FreeRTOS on Cortex-M4
  • defining configASSERT()
  • staying out of trouble with Cortex M interrupt priorities
  • stack overflow checking

which are all really helpful. In your case, specifically the first bullet point is a good thing to check next.

Also note you can use CubeIDE to generate a good starting point for FreeRTOSConfig.h. At least it could make a good point of reference.

Thanks Jefftenney, I solved the problem and It sounds like a naive problem. the systick rate in config was very small and I put a large number in vTaskDelay which leads to a very big delay in the task. when I adjusted the delay time It works well.