2022-05-20 01:48 AM
The prototype of the generated function by STM32CubeMx when using FATFS is:
int32_t MX_FATFS_Process(void)
This cannot be used with FreeRTOS as a task entry function since it has the wrong return and argument type.
The function prototype should be :
void MX_FATFS_Process(void *argument)
So that it could be accepted while creating FATFS task:
FatFsTaskHandle = osThreadNew(MX_FATFS_Process, NULL, &FatFsTask_attributes);
In the example project provided in STM32Cube MCU Package for STM32L5 series, the function prototype is correct. The code generated by STM32CubeMX does not match this example.
Solved! Go to Solution.
2022-05-25 08:40 AM
Hello @ABENA.1 ,
Unfortunately we cannot accept this request, it is not possible to change the prototype of MX_FATFS_Process to void.
Since the beginning, the functions prototype was declared as int32_t and it was not targeted to be used by FreeRTOS threads. The prototype was changed to void in the FW examples for FreeRTOS use.
The recommended way to define FreeRTOS tasks is by adding them to FreeRTOS configuration using CubeMX (for example void StartTaskxx(void *argument) ).
The FatFS task can be created while configuring FreeRTOS. It can be named StartTaskFatFS and you can copy or use the code of MX_FATFS_Process given in the example in the generated void StartTaskFatFS(void *argument).
I hope this helps :smiling_face_with_smiling_eyes:
If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-05-23 05:30 AM
Hello @ABENA.1 ,
Thanks for having reported,
I submitted your request internally for further check, I will keep you posted.
Internal ticket number: 128982(This is an internal tracking number and is not accessible or usable by customers).
Sara.
2022-05-25 08:40 AM
Hello @ABENA.1 ,
Unfortunately we cannot accept this request, it is not possible to change the prototype of MX_FATFS_Process to void.
Since the beginning, the functions prototype was declared as int32_t and it was not targeted to be used by FreeRTOS threads. The prototype was changed to void in the FW examples for FreeRTOS use.
The recommended way to define FreeRTOS tasks is by adding them to FreeRTOS configuration using CubeMX (for example void StartTaskxx(void *argument) ).
The FatFS task can be created while configuring FreeRTOS. It can be named StartTaskFatFS and you can copy or use the code of MX_FATFS_Process given in the example in the generated void StartTaskFatFS(void *argument).
I hope this helps :smiling_face_with_smiling_eyes:
If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-05-30 02:32 AM
Thanks @Sara BEN HADJ YAHYA