cancel
Showing results for 
Search instead for 
Did you mean: 

How Can I use freeRTOS in STM32-MAT/TARGET for stm32f7?

Lin Li
Associate II
Posted on June 26, 2018 at 04:21

Hello,

I want use freeRTOS in my program, But I don't know how to add it with STM32-MAT/TARGET, then can generation code with simulink.  

Is it possible to do this and how? 

Any suggestions will be greate helpful for me. Thanks.

#freertos #stm32f7
4 REPLIES 4
Posted on June 27, 2018 at 10:09

Hi, Lin

Now, FreeRTOS has not been integrated to STM32-MAT/TARGET.

Best regards,

Posted on June 27, 2018 at 11:10

Well, i know , Thanks for your reply. 

So if i port freeRTOS on  my own board, and my board driver based on the HAL-library, how can i  use simulink to generation c-code-tasks for freeRTOS?

Posted on June 27, 2018 at 13:34

Hi, Lin

My company uses FreeRTOS also. For testing and developing algorithm I uses possibilities of the STM32/MATTARGET without the FreeRTOS (PIL.., algorithm is runninig in bareboard, just generated from STM32 target in simulink). For the final implementaion (or well running algorithms) only generated source files are added to manualy created project (in Atollic TrueSTUDIO in my case). It is the most easier way without possibility online connecting with simulink, so debuging is complicate. Short description bellow.

I use generated code from simulink with FreeRTOS in that way:

1) In simulink, for code generation I have set Generate code only. Folder with source and header files is created (in my case folder interlocks_boad_controll_algorithm_stm32).

0690X0000060LUYQA2.png

2) in Atollic TrueSTUDIO the link to the folder is added to the project (simulink model modification and regeneration of source files are provide automatically to the development tool, in this way)

3) FreeRTOS Task which uses generated step and initialization functions from simulink is created manualy. Some code to satisfy sample time is added line47.

0690X0000060LUZQA2.png

In this application the generated codes running together with proprietal communication stack (legacy C++ codes). In simulink I have created interface from and to the communication stact throught data structures. The communication stack is running in the same main_loop function without the sample time (to eliminate multiprocess communication issues). It was very easy controll board. I used it for testing codegeneration and stateflow (8 state machine is running paralel).  

If there is somebody more experience with similar task I will happy to read your knowledge and experiences.

Martin

Posted on June 28, 2018 at 08:12

Hi Martin, thanks for your valuable idea.

Although can't resolve my whole problem, but this is very helpful to me at present.

Before there is another perfect resolution, I will use your idea to do my experiment.