cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO/SDMMC1 does not work with SPI2 at the same time

Posted on September 15, 2016 at 12:53

Hello everyone,

i am using CubeMX 4.16.0/1 with Nucleo-F401RE or Nucleo-144_F746ZG. I want to attach an ili9341 Display on SPI2 and an SDcard in ''SD 1bit'' mode. If the initialisation of the SDcard is performed (MX_SDIO_SD_Init() or MX_SDMMC1_SD_Init() ), SPI2 has no Output Signal. I checked this with an oscilloscope and logic analyzer. If i comment the SDcard initialisation, SPI2 is working with the ili9341 Display flawless. I can not find a hint that the SDcard Controller and SPI2 are a shared Hardware and CubeMX is not complaining activating both the same time. Can somebody help? I attached the CubeMX files for the Hardware config, my target Hardware is the Nucleo-144_F746ZG, i only cross-checked it with the F401RE to be sure it is not related to some defective hardware of one board.

Best regards, Markus.

4 REPLIES 4
Posted on September 16, 2016 at 10:38

for further tests, i switched from SPI2 to SPI3 on the Nucleo-F401RE Board and from SPI2 to SPI5 on the Nucleo-F746ZG Board. It is still the same behaviour. No SDIO/SDMMC1 initialisation, SPI works, with initialisation, SPI is dead. Is there a bug in CubeMX ? In the data Sheets, i can only see that SPI and I2S share ressources, but CubeMX blocks the corresponding SPI if I2S is used. Can anybody give a hint ?

Best regards, Markus.

Posted on September 20, 2016 at 10:20

Hello everybody,

I still have Problems using SDMMC1 on the Nucleo-F746ZG. I disabledSPI and activated instead USART3 (connected via ST-Link to the PC)to be able to start with reading from an SDcard. But also like with SPI, USART is inactive when SDMMC1 is initialised. For further informations, i checked the Project C:\..\STM32Cube_FW_F7_V1.3.0\Projects\STM32746G-Discovery\Examples\BSP for differences in configuring the SDcard, but i did not find a hint. Can give me anybody advice ? I attached my SW4STM32 Project/CubeMX Settingsto this post.

Desperate searching for help, Markus.

________________

Attachments :

STM32F746ZGT_Basics_20160919.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I10J&d=%2Fa%2F0X0000000bgl%2FGPpI9wcESs60E0k5RPLyQTzDKA92bVo9OJrj3w8hG50&asPdf=false
stm32cube-t
Senior III
Posted on September 20, 2016 at 13:00

Hello Markus,

Can you please try to invert the calls in main.c, calling MX_SDMMC1_SD_Init() last

and let us know if there is any improvement there.

Thank you

Posted on September 21, 2016 at 12:40

I also tried to swap the calls of SPI and SDIO / SDMMC1 initialisation, it has no effect.

But I found a ''solution''. I did not select ''SD-1bit'' with limited pinout, (CMD, CLK, D0)but ''SD-4bit'' with the full pinout(CMD, CLK, D0-D3) for SDcards in CubeMX. In this configuration, SPI works and i can communicate with a SDcard via the HAL_SD generic Drivers of CubeMX. The clock signal and the CMD signal is active, i can get the Status of a SDcard. But for some of my hardware designs, I would prefer a slim solution with only 3 lines because speed is not as important as a small pin footprint for the SDcard. For the Nucleo-F746ZG, a SD-4bit config is OK (see attached picture), but for other targets, only 3-pin configs would be useful. I only found a Nucleo-F091RC example for SPI with an Adafruit shield in the CubeMX examples, but SPI is not supported by CubeMX for SDcards. An external lib is needed which is not easy to use in an CubeMX Project and SPI needs 4 Pins and I expect it is slower compared to the CubeMX SDMMC / SDIO solution.

Best regards,

Markus.

________________

Attachments :

SDcard_SD-4bit.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0zz&d=%2Fa%2F0X0000000bgj%2Fw2puHQR1efLaADzC_uZpdQawVGK3tGzQcJzfoDhLovg&asPdf=false