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 12, 2018 at 14:12

The constraining issue here tends to be that no ST board (NUCLEO, DISCO, EVAL) is provided with an eMMC memory, and thus no driver to have a software driver. The BSP library is constructed of things that actually exist in the ST universe.

I've seen people with eMMC to MMC (fullsize) card adapters, so I assume the internal mechanics are the same as SD/MMC cards and the sub-4G vs above relates to the command set used and the block addressing. The assumption again here is were talking about basically the same die and it is either encapsulated in a chip carrier vs a card form-factor.

I am mildly curious, so will fish around to see if I can find an eMMC break-out board with something in the 16-32GB range.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 12, 2018 at 14:23

Glad I have obtained you attention, thank you for help.

For my tests I have used

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-nucleo/nucleo-f412zg.html

  and

https://www.amazon.com/dp/B076HTDH2J

  adapter:0690X00000604ceQAA.jpg

Like I described the initialization code seems to work. What does not is writing to the memory (returns errors) and reading I cannot tell, since I cannot write, but I assume it works. Also I am concerned about maximum of 2 GB capacity. Even thought you say that its just about instruction set, maybe the MMC 4.2 standard which STM32 uses is not compatible with higher capacities?

Also, as long I understand that libs are there if the hardware is there (on demo boards) its hard to believe that someone wrote this HAL without testing it. Or...?

Posted on May 12, 2018 at 14:56

That looks like an reasonable adapter, but a little on the pricey side.

Something like this to interface to a board mounted device might be another route

https://www.amazon.com/eMMC-Module-Reader-Board-upgrade/dp/B074HQ4QHF/ref=pd_sbs_469_7?_encoding=UTF8&pd_rd_i=B074HQ4QHF&pd_rd_r=HW42KSKSKHD9TZ0PJ9J9&pd_rd_w=B0ZNy&pd_rd_wg=H1elq&psc=1&refRID=HW42KSKSKHD9TZ0PJ9J9

 

There are some other module/board mounted eMMC for the Nintendo Switch, couple of 32GB things dropped out of eBay

>>its hard to believe that someone wrote this HAL without testing it. Or...?

Yeah, my view of this is that very minimal or narrow testing is done. So if the example on the bench works with a little demo code it ships. This is not quite the same as something that is usable in the real-world with a part from Brand X instead of Brand Y, or on all parts 128MB thru 128GB. I don't think there is any 'dog-fooding' where they are forced to use a collections of drivers in some real-world demo where several components are pulled together in an application use-case that you or I might find remotely useful or deliverable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 12, 2018 at 15:36

Ok, I've gone with the ODROID approach, got a handful of the adapters, and an example 16 and 32 GB module, should arrive here Wednesday if I believe Amazon, and the parts are in the US somewhere.

That will work as a proof of concept across a number of STM32 and boards, I've got microSD sockets wired on everything.

I like the clamshell approach, and that might make a lot more sense with a broader selection of devices, and the 8-bit mode stuff on the L4+. We'll see if we can attract any more interest on the forum to move that along.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 12, 2018 at 15:46

Yes, it was quite expensive, but I wanted to test the exact memory chip I wanted to use in the end. I have an odroid sbc u der my tv set with an eMMC card but didnt thibk of it to be honest. I tried to use the SD card code but it simply differs a lot. Thank you very much for you input here, I really appreciate your support. Which approach are you planning to take? Because for L4s there is only LL code available. For some reason the peripheral is called SDMMC there not SDIO. My local ST FAE told me that its the same peripheral but he has no idea why the different name (and code i gues).

Posted on May 12, 2018 at 16:46

I'm going to start by just proving if it works the same way the the SD/MMC stuff works, not using eMMC on anything right now, but have some applications in mind. Mostly focused on L4(+), F7 and H7 parts at the moment.

SDIO vs SDMMC, I think it is a refresh of the IP, couple of bugs being resolved, and some changes in the DMA/FIFO, haven't dug in too deep as the core code seems mostly functional, at least on the HAL side, not much for CubeMX synthesized stuff which from forum reports is a bit sketchy. It also clocks a lot faster, the SDIO was about 75 MHz (37.5 MHz on the wire), the SDMMC on the H7 clocks at 200 MHz, and supports some SDR/DDR modes and external transceivers. Have to divide down the clocks, but have gotten SDXC cards running at 50-80 MHz on the wire.

I hope the ODROID path will allow for a quick way to try different capacities, and had a good balance of price and yield. If I can get some confidence in the technology the clamshell will be the next step.

I would think STM32+eMMC would have relatively broad appeal in the more industrial applications. Especially where vibration is an issue, or the mechanical stuff related to openings and socketing microSD cards is impractical. An eMMC that I can board mount and conformal coat has traction into several designs/applications.

One of the pet projects is the CORS-LITE RINEX data logger, here running on STM32F746G-DISCO, where the expectation is the thing can run for hundreds of days without crashing, and a good way to stress code and hardware.

0690X00000604hDQAQ.jpg
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 12, 2018 at 16:53

Yes, I have a simmilar goal in mind. I have tried many different mediums

for to utilize a perfect logger. I have failed miserably by trying to do

FatFs on a NOR memory. I implemented caching, but still had no static wear

leveling and the writing and erasing took ages. SD card seems obvious but

its not suita le for the industrial application like you said. eMMC seems

to be the promised land. I hooked it up with stm32 and you know the end of

the story. If you need anything from me regarding this topic please let me

know. I mysalfe dont know yet either I should try to make it work using

sdio or sdmmc. The latter seems more appropriate, since I am using an L4

device.

Posted on May 12, 2018 at 17:05

There seem to be a lot of what I'd call 'legacy' applications, where people have classically locked a PC in a shed to do some task, and have that run for 5-10 years before the thing fills with dust and the CPU fans or HD grind up. The kind of thing that can be replaced now with some thing that will run off a micro-USB jack supplying 500-1200mA and stuck in a small plastic utility box. With Cellular they can tear down the shed, and take the copper phone line too.

>>eMMC seems to be the promised land.

Doesn't seem to have reached critical mass yet, would expect to see more eBay/China or SparkFun type proto boards. I think the low price for consumer-off-the-shelf microSD cards of large capacity skews better for the Maker/Hacker space. A 200GB MicroSD runs $80 at WalMart (Peak Commodification), and if I had money to burn a 400GB card might run me $199 off Amazon.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Altamash Abdul Rahim
Associate II
Posted on May 17, 2018 at 13:47

Hello, I've used emmc with stm32f405 and stm32f429 and they work fine