I want to use MFS to write data to SD card. now I have three task(main_task, init_task, temp_task), the main task is a auto_start task, the init task and temp task are created by the main task. the sd and mfs is inited in init_task, I can create and write data in main_task using mfs, but I can't do this in temp_task. Is there any method to make the mfs work in any task?
I am using MQX 4.1, and the board is my own demo board which is tested to be ok.
Hi Botao:
In your case, init_task and temp_task are not in the same context. If you need several tasks to write data to the same SD card, you need to pay attention to the communication and synchronization between tasks.
You can refer to the web_hvac example,
C:\Freescale\Freescale_MQX_4_2\demo\web_hvac\logging_task.c
In this example, several tasks need to write data to USB. There is a light weight semaphore and a message queue to achieve this.
Regards
Daniel