Skip to main content
willcfj
Associate III
October 24, 2018
Question

STM32L4 SDMMC standalone mode (no RTOS): Works polled, not with DMA

  • October 24, 2018
  • 42 replies
  • 8813 views

Hi, pretty sure this is a newbie type question. I'm using the SDMMC interface on an STM32L476. Right now it is just wired to a Nucleo board so I can do some benchmarking before committing it to a layout. I'm using STM32CubeMX and following the example in section 3.3 of UM1721 (Fatfs on CubeMX). After learning the hard way pullup resistors *are* necessary (some other posts said not), I am able to talk to a card, but only if I use polled mode ("Use DMA Template" set to disable in STM32CubeMX Fatfs settings). When enabled, the code hangs in the sd_diskio_dma.c SD_Read() routine right after the BSP_SD_ReadBlocks_DMA() call.

The note for "Use DMA Template" says to ensure that DMAs are properly configured but no more info. In the SDMMC configuration I've tried tried selecting SDMMC1 and then both SDMMC1_TX_SDMMC1_RX. I always get the stall. I am sure there i something basic I'm missing, but been at it for a couple days now and deciding to ask. Since this seems a very basic "follow the app note", rationalizing it might be useful for others too.

I've only recently migrated from the basic StcPeriph libraries to STMCube, starting with the LL routines, this is my attempt using HAL.

will

    This topic has been closed for replies.

    42 replies

    Beachmiles
    Associate II
    June 5, 2019

    Found some decent success, posted code here. Only doing a small write and read but it freaking works which is a start.

    https://community.st.com/s/feed/0D70X000006SpXHSA0

    willcfj
    willcfjAuthor
    Associate III
    June 10, 2019

    Beachmiles:

    Bummer, not much of an answer in terms of guidance unforutnately, but was worth a try... I've been spending time again on this project for a good part of my day today, but still no luck. I did migrate to STM32CubeIDE which looks to have been a mistake. Two crashes so far during code re-generation and for both crashes it completely tashed all my source files. For the first one, I did't lose anything, for the second i lost about 2 hours of work. Not getting off to a good start. Grumble, grumble.

    will

    HHako.1
    Associate III
    July 18, 2023

    Hello, do you need it with DMA or without ?