Read() MFS

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

Read() MFS

609 Views
amleng
Contributor IV

I have a 200Kbyte file on sd card. I use the following code on MQX 3.8 to read the file read (log_fp, data,3); using this code I can only read the first 900 bytes of the file. I have problem to  read the rest of the file correctly! I tried fread() and fgetc() I got the same issue. Any suggestion for me?

Thnaks

Labels (1)
4 Replies

416 Views
netra
Contributor IV

How to check whether there is a sector problem or file system problem??

0 Kudos

416 Views
pavel_chromy
NXP Employee
NXP Employee

At first, please make sure that the issue is not caused by a damaged SD card or corrupted filesystem on it.

Try to read the file on PC and also try a different newly formatted SD card with a file of the desired size.

If the problem persists, please provide us with more details. Such erratic behaviour of MFS read function was not observed so far, so the actual reason cannot be identified with the brief description provided.

416 Views
timias
Contributor IV

I understand amleng is asking for help for a specific problem, but I would like tools, and or APIs to verify a disk functionally so that logic can be built to heal issues that might occur in the field.

0 Kudos

416 Views
amleng
Contributor IV

That's true. It was sd card problem. Sounds a few bad sectors issue! Thanks

0 Kudos