MQX crashes or locks up when calling _io_mfs_dir_read

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

MQX crashes or locks up when calling _io_mfs_dir_read

891 Views
Thad
Contributor III

I've been having difficulty getting MFS to work consistently.  I am able to open and read files that I know exist on the SD card, but if I try to iterate a directory, it sometimes locks up or crashes on the call to _io_mfs_dir_read.  Sometimes reformatting the file system on the SD card seems to help, but usually not.  The call to _io_mfs_dir_open seems to work fine, and like I said I can open and read files via fopen... so the file system layer itself seems to be up.  Has anyone else encountered anything like this?  Any suggestions on how to dig into this?

Labels (1)
0 Kudos
Reply
2 Replies

552 Views
timias
Contributor IV

What error does MQX Task List show when the call fails? When that call fails I believe it should flag an error which is viewable via task aware debugging.

0 Kudos
Reply

552 Views
pavel_chromy
NXP Employee
NXP Employee

Dear Thad,

how much memory do you allocate for the string returned from _io_mfs_read_dir via pointer? As I looked into the code the current version of MFS does not restrict the size of the buffer despite the parameter is passed to _io_mfs_read_dir.

Current workaround is to allocate buffer of sufficient size so that text returned from _io_mfs_read_dir fits.

Otherwise I do not see other issue in _io_mfs_read_dir at first sight. If you problem persist, could you, please, provide us with more details or prefferably also a compilable code snippet to reproduce reproduce the issue?

0 Kudos
Reply