2018-06-25 07:21 PM
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 #stm32f72018-06-27 01:09 AM
Hi, Lin
Now, FreeRTOS has not been integrated to STM32-MAT/TARGET.
Best regards,
2018-06-27 04:10 AM
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?
2018-06-27 06:34 AM
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).
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.
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
2018-06-28 01:12 AM
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.