cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f103 SDIO+DMA SDcard write is not working and gives output as FR_INVALID_OBJECT

JChun.4
Associate

Hello,

In my application, I want to implement the SDcard write funcitonality using SDIO+DMA in STM32f103RGT6 processor. I could able to perform SDcard read functionality but the write does not work. Does anybody have any samply code or reference would be really helpful to me.

Thanks in advance.

4 REPLIES 4

STM32Cube_FW_F1_V1.8.2\Drivers\BSP\STM3210E_EVAL\stm3210e_eval_sd.c

STM32Cube_FW_F1_V1.8.2\Projects\STM3210E_EVAL\Applications\FatFs\FatFs_uSD\readme.txt

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

Hello,

Thank you so much for your reply. I forgot to mention that I have Freertos also in my project. Do you have any refenrence to any with SDIO+DMA+FREERTOS with Read and write for STM32F103R processor ?

I do not, I moved beyond the F1 parts a decade ago, and predominantly used the SPL with them at that time.

FatFs doesn't have the RTOS/DMA template drivers (diskio) for the F1, but things like the F4 do, perhaps you can draw inspiration from them?

STM32Cube_FW_F4_V1.24.1\Middlewares\Third_Party\FatFs\src\drivers\sd_diskio_dma_rtos_template.c

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

I'm having the same issue. I'm trying to use sdcard on stm32f103RE with dma. the read works. but the write doesn't work. 

when I tried to see what's happening, I could see that after it sets up the write to sdio with dma, the dma transfer complete gets called and in the SD_DMATransmitCplt call back it only enables the dataend interrupt. which I assume that it's going to wait until the last byte (word) of the data from sdio's fifo is shifted out, then the actual sd transfer complete call back should happen in sdio interrupt. however, sdio interrupt never happens. 
Has anyone actually get stm32f1 sdio working with dma?