STM32F429 FatFs misbehaving

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
0st3n
Posts: 11
Joined: Tue Aug 25, 2015 11:11 am

STM32F429 FatFs misbehaving

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F429 FatFs misbehaving

Post by Giovanni »

Is it the same with a different kind of card?

I never experienced this.

Giovanni
0st3n
Posts: 11
Joined: Tue Aug 25, 2015 11:11 am

Re: STM32F429 FatFs misbehaving

Post by 0st3n »

Yea, i have 2 brand new kingston sd cards, and the error is with both of them.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F429 FatFs misbehaving

Post by Giovanni »

And another kind?

I expect the same result from equal cards.

Giovanni
0st3n
Posts: 11
Joined: Tue Aug 25, 2015 11:11 am

Re: STM32F429 FatFs misbehaving

Post by 0st3n »

I've now tried with two different brands (Kingston and Transcend) and still the same.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F429 FatFs misbehaving

Post 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
Post Reply