cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX FATFX + FreeRTOS

dr23
Associate
Posted on August 31, 2016 at 14:50

Hello!

I use STM32CubeMX, STM32F429ZIT microcontroller project contains FATFX and FreeRTOS. I have three questions:

1) When the STM32CubeMXcode generates function MX_FATFS_Init () is in the code void StartDefaultTask (void const * argument). I want to place MX_FATFS_Init () in main (). How do I do it?

2) How to pass an argument to a function void StartDefaultTask (void const * argument) and the description of the creation of the task?

3) How to enable STemWin in STM32CubeMX project?

Help please.

Best Regards!

Vadim

#stm32cubemx-fatfx-freertos
2 REPLIES 2
Walid FTITI_O
Senior II
Posted on September 01, 2016 at 13:53

Hi khodyrev.vadim, 

To make the change in the CubeMx generated code, just add you own in the user-code parts /* user code begin */ ... /* user code end */, in  that way you will note lose it in the next generation. Be careful, the function will be generated bydefaut in the same place next code generation.

Check the ''code generator'' setting and ensure that you pick ''Keep user code when re-generating'' 

The current CubeMx version does not yet automatically integrate STemWin in the CubeMx project. User should add it by him self in generated project.

For further information , check the user manual

http://www.st.com/content/ccc/resource/technical/document/user_manual/10/c5/1a/43/3a/70/43/7d/DM00104712.pdf/files/DM00104712.pdf/jcr:content/translations/en.DM00104712.pdf

.

-Hannibal-
Osto
Senior
Posted on September 08, 2016 at 14:01

Hi,

Hanibal answers the most of your questions except the StartDefaulTask argument.

In StartDefaultTask it is recommended to call your own function which initialize the system, start the application tasks and then die.

To do this, in freertos.c in the body of StartDefaultTask, before endless loop, add the call to your code which starts the other tasks.

Dont forget that this function dont exit. The function have to end with vTaskDelete(NULL) which means to kill the actual task.

Regards,

Osto