Read() MFS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Read() MFS

1,422件の閲覧回数
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

ラベル(1)
4 返答(返信)

1,229件の閲覧回数
netra
Contributor IV

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

0 件の賞賛
返信

1,229件の閲覧回数
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.

1,229件の閲覧回数
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 件の賞賛
返信

1,229件の閲覧回数
amleng
Contributor IV

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

0 件の賞賛
返信