Skip to main content
Lukasz Przenioslo
Associate III
May 9, 2018
Question

SM32L4 interface with an eMMC

  • May 9, 2018
  • 6 replies
  • 6166 views
Posted on May 09, 2018 at 13:10

Hello there,

I am using STM32L452. I would like to interface with a SanDisk eMMC memory (

SDINBDG4-8G-XI1

).

In cubeMX, when I configure the project and choose SDMMC1->MMC 4 bits Wide bus, I get the following:

0690X0000060B22QAE.png

Does that mean that there is no ready HAL functions? Or, for instance, can I use the SD 4 bits Wide bus for communication? Are those interfaces compatible in STM32?

I would appreciate all help.

#sd-card- #emmc #mmc
This topic has been closed for replies.

6 replies

Tesla DeLorean
Guru
May 9, 2018
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Lukasz Przenioslo
Associate III
May 9, 2018
Posted on May 09, 2018 at 14:15

The hardware is there, the parts I am trying to use it for are:

STM32L452VETx

STM32L452RETx

No external SMPS there.

Tesla DeLorean
Guru
May 9, 2018
Posted on May 09, 2018 at 14:25

Well it could be a CubeMX 'Computer Says No' moment, I'd just use the HAL

Make sure you have the PLL enabled, not sure if that part allows routing of SYSCLK into the SDMMC

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Lukasz Przenioslo
Associate III
May 9, 2018
Posted on May 09, 2018 at 14:33

In the end will need to do that probably. But with having no examples for configuration the task is harder. Do you know either there are any eMMC BSP for other STM32 family MCU's? Also, will this be supported in cubeMX for L4 in future?

DAHMEN.IMEN

‌ ?

Also there is one thing not clear to me: For the L4 package i could find only the low layer MMC library, while F4 and F7 have HAL library. Are they compatible, or can I not use the HAL one for L4 device? This is additionally unclear, since in the cubeMX project options I cannot choose LL for eMMC but only HAL, which is not there...

0690X0000060B6JQAU.png

Tesla DeLorean
Guru
May 9, 2018
Posted on May 09, 2018 at 14:59

The whole SDIO/SDMMC and HAL/LL across the families is a bit quixotic, it might get more unified over time. My concerns tend to be whether things work or not, and keep my top-level code portable

I take this approach to finding the appropriate base example in HAL/LL/SPL, and hack it into shape, then merge in my functionality

https://www.youtube.com/watch?v=SkvY7HuaapE

 
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Lukasz Przenioslo
Associate III
May 9, 2018
Posted on May 09, 2018 at 15:02

I get the point. But I would just like to know on what I am standing in this eMMC situation- make sure the lib exists or not, but can be copied from F4 for example, because its the same. Also I had no idea there is so much overhead in making the coconut look the way it does after its taken from the tree.

Daniel O'Neill
Associate II
May 10, 2018
Posted on May 11, 2018 at 00:11

Instead of selecting 'MMC 4bits wide bus' change to 

'SD 4bits wide bus'.

Not sure why but I have used this for multiple uSD cards and think it should work for eMMC cards....

Maybe someone else could confirm this?

Lukasz Przenioslo
Associate III
May 11, 2018
Posted on May 11, 2018 at 06:27

Thanks for answer,

Unfortunately I tried this. The HAL implementation for SD card and eMMC differs at the lower level, different commands are sent. I tried to use the SD code and replace the LL part with eMMC code. The problem is the LL layer exist only for SDIO module, while STM32L4 uses SDMMC module. From the practical point of view I dont know whats the difference between them (apart from how is the code implemented and its a different peripheral).

At the moment I have ordered an STM32F412 development board in order to try it out there (it uses SDIO instead of SDMMC). If it will work there, I will have quite a dilemma- Should I change the MCU used in the project from STM32L4 to STM32F4? Thats why I am hoping to get an answer confirming how does the situation looks at the moment

DAHMEN.IMEN

‌ .

Tesla DeLorean
Guru
May 25, 2018
Posted on May 26, 2018 at 00:05

Ok, so making progress on this, I have eMMC running on L4 parts

Currently have builds working on L496ZG-NUCLEO, L4R5ZI-NUCLEO and STM32L4R9I-DISCO

0690X00000604k7QAA.jpg

Lukasz is tinkering with a 20-pin ''eMMC HAT'' that will plug onto the NUCLEO-144's SDMMC header

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
T J
Senior III
May 25, 2018
Posted on May 26, 2018 at 01:30

my wife is Quixotic

Houda GHABRI
ST Employee
July 13, 2018
Posted on July 13, 2018 at 18:24

Hello 

Przenioslo.Lukasz

,

Thanks for your feedback and sorry for the late reply.

MMC configuration by CubeMX  is not supported for STM32L452 MCU. Also SDMMC is not supported by LL drivres.

Please do not hesitate to contact me for furthers details.

Best regards,

Houda