Problems writing to two files on an SD card simultaneously

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems writing to two files on an SD card simultaneously

Jump to solution
538 Views
ARQuattr
Contributor IV

We are testing writing to an SD card using the TWR-K60F120M board, running MQX4.1, with the HVAC demo and SD driver and MFS library included.  We can open a file and read from it, then open two more files in write mode, but it will only work with the first file that is written to.  Upon trying to write to the second file the task is blocked.  This is the same whether I use fprintf(), or write().  The file handles are not NULL, and it doesn't block when the files are open, only when written to some time later.  I doubled the stack size (to 10kB) and it didn't help.

Is there a limitation with accessing multiple files through MQX MFS, or are we doing something wrong?

Thanks

Angelo

Labels (1)
Tags (4)
0 Kudos
1 Solution
315 Views
ARQuattr
Contributor IV

I added Kernel logging in the user_config to monitor the stack usage to confirm I was not running out of stack space, and after recompiling the PSP the file writing issue went away.  I'm pretty sure nothing was changed in the PSP before, but I'm not sure if perhaps the projects (i.e. MFS, PSP, BSP, etc.) were built in the wrong order.

View solution in original post

0 Kudos
1 Reply
316 Views
ARQuattr
Contributor IV

I added Kernel logging in the user_config to monitor the stack usage to confirm I was not running out of stack space, and after recompiling the PSP the file writing issue went away.  I'm pretty sure nothing was changed in the PSP before, but I'm not sure if perhaps the projects (i.e. MFS, PSP, BSP, etc.) were built in the wrong order.

0 Kudos