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 17, 2018 at 13:49

Can you provide working examples?

Altamash Abdul Rahim
Associate II

Posted on May 18, 2018 at 06:55

I have attached a project which i did on a stm32f405 chip. I used the HAL MMC functions and FATFS for read write operations. I linked them by functions in /src/eMMC_drivers and /src/user_diskio. Feel free to ask if any doubt.

________________

Attachments :

heees.rar :

Posted on May 18, 2018 at 06:59

Thank you,

I will check it out monday morning. Have a nice weekend.

Posted on May 18, 2018 at 07:15

Sure.

Posted on May 19, 2018 at 07:27

Turvey.Clive

‌ I am looking at

altamash.ar96

‌ project and it seems like all using the standard functions. If he says it work, why only on this target? Of corse apart from things like 2 GB capacity max i believe? #define CAPACITY 0x400000U /*!< Log Block Nuumber for 2 G bytes Cards */

altamash.ar96

‌ which eMMC did you use exactly?

Posted on May 19, 2018 at 07:41

I used Kingston eMMC 16 GB M525

https://www.kingston.com/us/embedded/emmc

Are you able to initialize the eMMC using the HAL MMC functions?

Posted on May 19, 2018 at 07:44

Yes I was able to do that on F412 but I wasnt able to write.

Posted on May 19, 2018 at 07:48

Are you using any file system or using  HAL MMC functions to read write?

Posted on May 19, 2018 at 07:49

Just the HAL_MMC HAL functions, in blocking mode.

Posted on May 19, 2018 at 15:31

            printf('%d GB\n', hmmc.MmcCard.LogBlockNbr / (2048 * 1024)); // binary

            printf('%6.3lf GB\n', (double)hmmc.MmcCard.LogBlockNbr / 2000000.0); // media retail

I'm only dealing with this 16GB Samsung device, so not going to build an entire observation of CSD vs EXTCSD on that, but the ST code for the F4 is missing some code that is in the H7 libraries.

I have a 32GB eMMC at the office, will review that on Monday.

Also doing some serious sanity checking of the media integrity over the whole capacity.

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