2018-05-12 04:47 AM
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.
2018-05-21 02:54 AM
Some update from
Riddell.Gideon
on this topic:2018-05-21 02:31 PM
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.
2018-06-13 07:09 AM
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
().
2018-06-13 08:25 AM
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?
2018-06-13 09:50 AM
Hi
Turvey.Clive.002
,Actually I'm using STM32F779NI EVK and replace the SD Card interface bus by eMMC.
And this board using SDMMC1
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 ?
2018-06-13 11:03 AM
>>
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.
2018-06-13 11:12 AM
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
2018-06-13 02:27 PM
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=false2018-06-13 10:09 PM
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.
2018-06-13 10:36 PM
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.