Page 1 of 1

STM32F429 FatFs misbehaving

Posted: Mon Oct 05, 2015 1:40 pm
by 0st3n
When i try to read a file with FATFS on a sd card attached through SPI.
I get a weird error, starting from when i have read the first 47 bytes, then there will be 56 bytes of data, which is not in my file, and the the text from my file starts again. This happens for every 512 bytes.

The 56 bytes of data is always the same, and is (in hex)

Code: Select all

A8 11 00 20 07 1E 00 08 30 3D 00 20 37 00 00 00 35 00 00 00 07 3D 00 08 80 00 00 00 0B 6F 00 08 00 00 00 00 51 19 00 08 00 00 00 00 00 00 00 00 51 19 00 08 FD FF FF FF


Is this a part of the sd card protocol, which is not filtered out in the mmcSequentialRead function or ?

- 0st3n

Re: STM32F429 FatFs misbehaving

Posted: Mon Oct 05, 2015 1:58 pm
by Giovanni
Is it the same with a different kind of card?

I never experienced this.

Giovanni

Re: STM32F429 FatFs misbehaving

Posted: Mon Oct 05, 2015 1:59 pm
by 0st3n
Yea, i have 2 brand new kingston sd cards, and the error is with both of them.

Re: STM32F429 FatFs misbehaving

Posted: Mon Oct 05, 2015 2:12 pm
by Giovanni
And another kind?

I expect the same result from equal cards.

Giovanni

Re: STM32F429 FatFs misbehaving

Posted: Mon Oct 05, 2015 2:34 pm
by 0st3n
I've now tried with two different brands (Kingston and Transcend) and still the same.

Re: STM32F429 FatFs misbehaving

Posted: Mon Oct 05, 2015 2:47 pm
by Giovanni
Not sure about what it could be, the HAL just provides block-level access to the card, everything else is done by FatFS.

It could be an SW error, for example an overflow corrupting the block buffer. I never experienced this.

You may try to invoke the block-level functions and see if there is corruption at that level.

Giovanni