Skip to main content
Visitor II
February 27, 2022
Question

Using onboard eMMC as mass storage device available over USB?

  • February 27, 2022
  • 2 replies
  • 3303 views

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

    This topic has been closed for replies.

    2 replies

    Graduate II
    February 27, 2022

    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.

    Graduate II
    February 28, 2022

    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

    EMurp.1Author
    Visitor II
    February 28, 2022

    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).

    EMurp.1Author
    Visitor II
    February 27, 2022

    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.