cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 eMMC support

Posted on May 12, 2018 at 13:47

Hello there,

I am writing in regard to those 2 topics:

https://community.st.com/thread/49792-sm32l4-interface-with-an-emmc

I am using an STM32L452 chip and trying to fully utilize the SanDisk 8GB eMMC memory (

SDINBDG4-8G

). I have found out that the is no eMMC HAL written for the L4 family. Because of that, I tried STM32F412, as it uses SDIO not SDMMC peripheral (the same thing but other name?), and it has HAL written. I have found out however, that as pointed out here

it doesnt work. There are no examples of eMMC usage in STM32Cube_FW_F4_V1.0. From the code it also seems that it only supports memories up to 2 GB. Trying to use the code I was unable to write anything to the momory, like the mentioned topic, even though over a year passed since it was posted.

At the moment I have a serious design dilemma. I cannot afford the time to write the driver from scratch or try to fix the existing one. Could I please ask for an explanation what is the state of the eMMC driver for each STM32F4 and STM32L4 devices, do they indeed not work? Is there a way to make them work? Also, what is the real difference between SDIO which F4 utilize and SDMMC peripherals which L4 utilize? I would appreciate all help.

https://community.st.com/people/DAHMEN.IMEN

‌ ?

Note: this post was migrated and contained many threaded conversations, some content may be missing.

42 REPLIES 42
Posted on May 21, 2018 at 11:54

Some update from

Riddell.Gideon

‌ on this topic:

https://community.st.com/0D70X000006SzPlSAK

Altamash Abdul Rahim
Associate II
Posted on May 21, 2018 at 23:31

I looked into the HAL_MMC_GetCardCSD() function and it seems to be fine and i tallied the BlockNbr and Block Size from the eMMC datasheet the capacity turns out to be 1 GB.

from a formula i looked up on internet:

{

capacity = BLOCKNR *BLOCK_LEN 

MULT = 2^(C_SIZE_MULT+2)

BLOCKNR = (C_SIZE+1) * MULT

BLOCK_LEN = 2^READ_BL_LEN

}

where from the eMMC datasheet (Kingston)  C_SIZE = 0xfff, C_SIZE_MULT = 0x07 (Bytes) and READ_BL_LEN = 0x09 (512 Bytes)

capacity = (0x1000)*(2^(9))*(2^(9)) = 1073741824 Bytes.

So it turns out for eMMC greater than 2GB read EXT_CSD register where, capacity is SEC_COUNT*512.

Posted on June 13, 2018 at 14:09

Hi

altamash.ar96

‌,

When u try STMF4 with eMMC, do u make any modifycation in MMC HAL layer to make it work ?

Because i using SMTF7 + eMMC Sandisk v5.1, but

I can not init eMMC, look into the driver I see it failed at the step send CID command

HAL_MMC_InitCard

().

Posted on June 13, 2018 at 15:25

ST's code is broken

How is your STM32F756 wired up? Specifically HSE and debug USART.

Assuming the eMMC uses PC8-PC12, and PD2 for 4-bit signalling.

Do you have the SDINBDG4 wired in 4-bit or 8-bit configuration?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 13, 2018 at 16:50

Hi

Turvey.Clive.002

‌,

Actually I'm using STM32F779NI EVK and replace the SD Card interface bus by eMMC.

And this board using SDMMC1

0690X0000060BeaQAE.png

Specifically HSE and debug USART

the HSE and debug USART also effect SDMMC1 pin. But the thing is I alr test with SD Card using SDMMC1 , it working fine.

And you say ST 's code is broken mean their HAL MMC has issues ? we need to do some modification to get it work ?

Posted on June 13, 2018 at 18:03

>>

And you say ST 's code is broken mean their HAL MMC has issues ?

Without doubt.

>>we need to do some modification to get it work ?

That would be my expectation.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Posted on June 13, 2018 at 18:12

This:

http://www.st.com/en/evaluation-tools/stm32f779i-eval.html

So VCP is USART1 PA9/PA10

I found this to be a less invasive approach - ODROID uSDcard adapter

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 13, 2018 at 21:27

Ok, so this is a blind port to the STM32F779I-EVAL (or F769I-EVAL)

http://www.st.com/en/evaluation-tools/stm32f779i-eval.html

eMMC via SD1 (CN17)

User interaction is implemented via the VCP/RS232 USART1 at 115200 8N1

________________

Attachments :

EMMC_F779_DEMO_001.hex.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxTD&d=%2Fa%2F0X0000000az1%2FihBvpktkqA8B_qLk98ObV_qjvAQVPJqf_80UjqkOqbg&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 14, 2018 at 05:09

Hi

Turvey.Clive.002

‌,

I tried to flash ur binary to the board, it doesn't work, nothing detected when power on the board.

And can i know how much effort to make the eMMC work ? Because we already asked ST support, they said it totally not support eMMC, we have to fix the mmc driverourselves. So we r going to change back to SD card.

Posted on June 14, 2018 at 05:36

Do you get any output via the serial port? You have the VCP and RS232 jumpers set properly? Other EVAL board you need to set the jumpers properly.

To use the ST-LINK VCP to connect you need to ensure the following are set:

JP21 2-3

JP26 2-3

I don't have either the STM32F779I-EVAL or the 769I-EVAL boards, perhaps someone at ST can furnish those? How do you normally output diagnostic information?

I have working eMMC drivers on F4, F7 and L4 platforms. I've got several man-days of effort, and several hundred dollars of parts invested.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..