Hello,
I started all over with 10.6, MQX 4.1.1 and the example on twrK60f120. The example worked well.
Then I ported the mqx tree to my location and did some code modifications to make the example code fit in my application: it still worked, as long as you onlky have one SHELL task.
The problem starts when you have several other tasks with higher priority:
I need RTSC (network + ftp), my own COMM task, my own custom task and SHELL including SAI (for playing audio): SHELL has the lowest priority because it is blocking.
RTSC and COMM need high priority in order not to miss network traffic.
At startup, the ffs device itself is always installed correctly. But then, the file system must be activated and this hangs most of the time (the lw_semaphore thing).
At a certain point after testing many task startup scenarios, I could FTP files to the NAND flash and I could see the files when typing "dir" in the shell, but the application could not open these files. Also when FTP'ing bigger files to the NAND, things look very unstable.
Note that all works well with a SD card! The reason I need the FFS NAND flash system, is that I don't want the SDcard holder: the pcb needs to be coated (for humidity).
Conclusion: the ffs example becomes very unstable when other higher priority tasks are running
below: EXEC is starting the orther tasks. Sdcard is NOT started....
.
#define EXEC_TASK 1 //+8 = 10
#define IP_TASK 2 //+8 = 11
#define COMM_TASK 3 //+8 = 12
#define SDCARD_TASK 4 //+8 = 13
#define INIT_TASK 5 //+8 = 14
#define SHELL_TASK 6 //+8 = 15
const TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
// Task Index, Function, Stack, Priority (>=8), Name, Attributes, Param, Time Slice
{ EXEC_TASK, Exec_task, 2000, (8+EXEC_TASK), "Exec", 0, 0, 0 },
{ IP_TASK, Ip_task, 3000, (8+IP_TASK), "Ip", 0, 0, 0 },
{ COMM_TASK, Comm_task, 4000, (8+COMM_TASK), "Comm", 0, 0, 0 },
{ SDCARD_TASK, Sdcard_task, 1500, (8+SDCARD_TASK), "sdcard", 0, 0, 0 },
{ INIT_TASK, Init_task, 2000, (8+INIT_TASK), "init", 0, 0, 0 },
{ SHELL_TASK, Shell_task, 4000, (8+SHELL_TASK), "Shell", MQX_AUTO_START_TASK, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};