cancel
Showing results for 
Search instead for 
Did you mean: 

Using onboard eMMC as mass storage device available over USB?

EMurp.1
Associate II

I'm trying to use an STM32H745I-DISCO to log values from a sensor, append the values on a .txt file on the onboard eMMC, and have the text file accessible when plugging in the board over usb (so using the board as a usb device). In other words, I want to use the internal eMMC as an SD card available over mass storeage. This all should happen using only the H7 core. I have screenshots of all the cubemx configurations attached. I'm running the code from this tutorial https://www.youtube.com/watch?v=I9KDN1o6924 to get the FatFS filesystem working. It errors out at a call to SD_PowerOn. I think the issue is in the FATFs configuration in CubeMX under platform settings, but none of the options match the tutorial. I looked at the FatFs_Shared_Device example, but it looks like a totally different middleware.

0693W00000Kai3QQAR.png0693W00000Kai31QAB.png0693W00000Kai3pQAB.png0693W00000Kai2wQAB.png

5 REPLIES 5

SD Card and eMMC are sufficiently different in their behaviour and expectations that they are not interchangeable.

My approach here would be to take an USB MSC Device example (H747I-DISCO), and merge in the eMMC support, replacing the SD Card usage.

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

Ok. Thanks for the tip. This may be better for a separate thread in the forum, but I am looking at the FatFS_Shared_Device example in the CubeIDE with the goal of merging it with a USB mass storage example. This example is for the specific board, and should just write to the eMMC. It errors out on the first call to f_mkfs, which is line 147 of the example -- the serial communication works fine. Is there another example or any tips on how to debug? It's somewhat concerning that the example doesn't work.

Did these with my HAL H7 eMMC port in Keil, not using CubeMX boiler plate code generator.

https://github.com/cturvey/RandomNinjaChef/tree/main/STM32H745I_DISCO_eMMC

The MSC Device perhaps needs some more work, but should illustrate proof-of-concept

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

Thanks for the build! I ran it, and I get the "Here#1" and "Here#2" debug messages over serial. Would the issue with the FatFS_Shared_Device example be with the example or my build environment in that case? Also, would you have any suggestions on starting points for getting the eMMC device working? Looks like there's only one documented example of its useage (the FatFS example).

Should be additional messages if the device enumerates via the USB-FS Micro-AB connector.

Might be some powering jumper, or power-on-reset robustness issues.

As I recall the Example\BSP and Example\MMC exist too, but as I recall I had to spend a lot of time with the H7's generally for eMMC, and especially the DDR modes, with code going back before v1.5.0 and perhaps V1.2.0 using the SD-to-MMC adapter cards

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