cancel
Showing results for 
Search instead for 
Did you mean: 

stm32F4 sdio write multiblock problem

jimmjimmshen
Associate III
Posted on January 10, 2014 at 03:32

when i try to write data into a file use SD_WriteMultiBlocks function then some blocks didnt fill the data i want, the block looks filled with old deleted file data and all this blocks start with XXXXXe00 end with XXXXXX000, i used fatfs as my file system attached file is my scheme of sd card, i tried some examples but all this problem so i thing maybe its my board problem?

4 REPLIES 4
Posted on January 10, 2014 at 04:37

Hard to say, I've been using MicroSD cards, running them at 2.8V and 3.0V, and had pull-up's real close to the socket in the 33K/47K range.

When writing pay very careful attention to when the DMA completes, and the SD FIFO clears. It's important the previous write completes before starting the next.

Be sure you know what your SDIO clocks and divisors are, there is an errata in the BYPASS mode.

Evaluate some known good hardware, STM32F4-DISCO + STM32F4-DIS-BB would be a relatively cheap cross-check.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
jimmjimmshen
Associate III
Posted on January 10, 2014 at 09:06

Hi, i am so confuse why single block is fine but multiblock didnt work and there is check transfer end after DMA trnasfer everything return OK but shit happen. I checked this for 1 week still didnt get ant idea

chen
Associate II
Posted on January 10, 2014 at 10:43

Have you tired a different SD card from, from a different manufacturer?

It is well known that different SD devices (even from the same manufacturer) can behave differently.

Posted on January 10, 2014 at 12:57

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/stm32f407%20write%20data%20into%20sd%20card%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&c...

Still using:

* @file stm324xg_eval_sdio_sd.c

* @author MCD Application Team

* @version V1.0.0

* @date

30-September-2011

Use STM32F4xx_DSP_StdPeriph_Lib_V1.3.0\Utilities\STM32_EVAL\STM3240_41_G_EVAL\stm324xg_eval_sdio_sd.c :

* @file stm324xg_eval_sdio_sd.c

* @author MCD Application Team

* @version V1.1.2

* @date

19-September-2013

* @brief This file provides a set of functions needed to manage the SDIO SD

* Card memory mounted on STM324xG-EVAL evaluation board.

It should use 64-bit addressing, AND resolves the DMA/FIFO issues. Make sure to use both SDIO and DMA IRQs

Also review what you're doing in diskio.c for FatFs, and that you're waiting for the write to actually complete.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..