Skip to main content
electronic tobi
Associate
June 26, 2018
Question

SDMMC on STM32 L476 L4

  • June 26, 2018
  • 2 replies
  • 2079 views
Posted on June 26, 2018 at 13:02

Hello,

I struggle to get SDMMC running.

I have a Discovery F4, I use the SDIO Module, open CubeMX, enable SDIO, gpio_input card detect, 2 dma (rx,tx) + interrupt

my code is simple

...

fres = f_mount(&_FileSys, SDPath, 1);

if (fres == FR_OK)

{

fres = f_open(&_File, 'TEST2.TXT', FA_READ);

if (fres == FR_OK)

{

..etc.

I can write to the card... works fine

But I also have a nucleo L476, when I do the same, enable SDMMC,dma...

it doesn't even mount the card

FR_DISK_ERR

I tested different clock sources, dividers, with dma , without dma

I wired the thing 3 times.

Did I miss something?

Is the there a big difference between the L4 and F4 / SDIO and SDMMC?

CubeMX 4.0 (+ L4 1.0)

TrueSTUDIO 9.0.1

Attached is the not working code for the L4

update:

the old CubeMX 4.21 works with the nucleo L476

The example without Cube from the current reposity package works also.

But the CubeMX 4.26 still doesn't 1 or 2 dma channels... whatever I try, allways

FR_DISK_ERR

.

#sdio-dma #sdmmc #sdio #l476 #dma-sdmmc

Note: this post was migrated and contained many threaded conversations, some content may be missing.
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
June 26, 2018
Posted on June 26, 2018 at 13:42

You might want to start using the example code in the HAL trees, it works better

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
electronic tobi
Associate
June 26, 2018
Posted on June 26, 2018 at 13:55

hmm I'm not sure what you mean,

should I try to port the application code from a different L4 board to my nucleo ?

Tesla DeLorean
Guru
June 26, 2018
Posted on June 26, 2018 at 14:45

>>should I try to port the application code from a different L4 board to my nucleo ?

Might be a shorter path than fighting with broken code, it is the approach I used. Easier to take working code and pivot.

STM32Cube_FW_L4_V1.12.0\Projects\STM32L476G-EVAL\Applications\FatFs\FatFs_uSD_Standalone

There are several others, and ones implementing DMA

With CubeMX code you'd want to make sure the IRQs and call-backs are plumbed properly

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Technical Moderator
July 2, 2018
Posted on July 02, 2018 at 15:50

Hello

t.greifenberg

 ,

I raised this issue internally to CubeMx team for check and come back to you.

With Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks