Skip to main content
JChun.4
Associate
March 22, 2021
Question

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

  • March 22, 2021
  • 3 replies
  • 6007 views

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.

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
March 22, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
JChun.4
JChun.4Author
Associate
March 22, 2021

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 ?

Tesla DeLorean
Guru
March 22, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Associate III
August 7, 2023

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?