cancel
Showing results for 
Search instead for 
Did you mean: 

STMF4Discovery - FatFS write nonsense

vukasheen
Associate II
Posted on November 11, 2014 at 11:34

Hi,

I'm testing FatFS with STMF4Discovery board and I have issue when I write some bytes sequnce. Generally FatFS works well, reading, writing, format, but  when I try to write data sequence: '0xAEAE' I get the wrong value: '0xD0BED0BE' on a SD card.

I have made many similar experiments this days with different values and I have the issue with '0xEEEE' value too, when I'm getting the same problematic value: '0xD0BED0BE' .

For other bytes combination of '0xFEFE' , '0xFFFF' or '0xBEBE' everything works well.

Also I have try to write data byte by byte, and also I put f_sync function between two problematic calls of f_write and issues still persist. 

Just for clarification, my connection with SDcard is over SDIO interface in DMA mode. Form hardware side, I use http://www.element14.com/community/community/designcenter/stm32f4-discovery-expansion-boards for SDcard connection.

Also I have checked power supply, and I have changed many SD cards (2GB, 4GB,8GB) formatted either in FAT16 or FAT32 from windows or from FatFS driver.

If you have some suggestion, please let me know.

Thanks

#discovery #sdio #stm32f4 #fatfs
3 REPLIES 3
Posted on November 12, 2014 at 16:39

Hi,

Which FatFs version are you working with ?

Can you provide me the hole f_write() and f_read() functions' calls ?

You're checking the written data by f_read() call or by just exploring the uSD card via Windows ?

Regards,

Heisenberg.

vukasheen
Associate II
Posted on November 13, 2014 at 10:02

Hi Heisenberg,

Thank you for suggestions. Read goes well, and finally I found that the bug was in my hex editor.

Hex view plug-in for notepad++ have bugs when displays this sequences. 

Best regards,

Vukasin

Posted on November 13, 2014 at 11:51

Hi Vukasin,

Ah ok ! Good news.

Cheers,

Heisenberg.