cancel
Showing results for 
Search instead for 
Did you mean: 

How to use eMMC in H745i

Maximiliano
Senior

 

Good morning to all,

I would like to learn how to use the eMMC that has my STM32H745i-Disk, something simple a simple structure with data to save when the board is turned off and read when it turns on.

The data to save is the following structure:

 

typedef struct {
  char date1[11];
  char date2[11];
  unsigned int id;
} DateStruct;

 

In examples of STM cube ide I found 2 examples, one with DMA and another with IT but not having a structure as in the projects it is difficult for me to understand it.
Usually I found videos about the things I wanted to do with the board and I learned this way, in this case I didn't find any. Is there any other example of how to use it? or maybe where to learn more about it with practical examples?

and took a look at the following reference:
https://www.st.com/resource/en/application_note/an5200-getting-started-with-stm32h7-series-sdmmc-host-controller-stmicroelectronics.pdf

 

thanks to @HTD  I have a good starting point as he shared a blank project already configured.

Solved: STM32H745I-DISCO eMMC how to configure with FATFS? - STMicroelectronics Community

 

but how do you know what commands to use to use the eMMC? i.e. how do you usually find out how to do something in stm? i mean code.

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Hello,


@Maximiliano wrote:

In examples of STM cube ide I found 2 examples, one with DMA and another with IT but not having a structure as in the projects it is difficult for me to understand it.


Which example you are pointing to?

This is an example from STM32H7 Cube package that you can refer to for eMMc/FatFs.

Save your structure as values in a text file.

PS: the driver (stm32h745i_discovery_mmc.c / stm32h745i_discovery_mmc.h) is located under Drivers\BSP\STM32H745I-DISCO.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
SofLit
ST Employee

Hello,


@Maximiliano wrote:

In examples of STM cube ide I found 2 examples, one with DMA and another with IT but not having a structure as in the projects it is difficult for me to understand it.


Which example you are pointing to?

This is an example from STM32H7 Cube package that you can refer to for eMMc/FatFs.

Save your structure as values in a text file.

PS: the driver (stm32h745i_discovery_mmc.c / stm32h745i_discovery_mmc.h) is located under Drivers\BSP\STM32H745I-DISCO.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

 

11:31:23 **** Incremental Build of configuration Debug for project FatFs_Shared_Device_CM7 ****
make -j8 all 
arm-none-eabi-gcc "C:/Users/maxi/Desktop/nuevo/PP/eMMC soft/STM32CubeH7-master/STM32CubeH7-master/Projects/STM32H745I-DISCO/Applications/FatFs/FatFs_Shared_Device/Common/Src/mmc_diskio.c" -mcpu=cortex-m7 -std=gnu11 -g3 -DDEBUG -DSTM32H745xx -DUSE_HAL_DRIVER -DUSE_PWR_DIRECT_SMPS_SUPPLY -DUSE_PWR_DIRECT_SMPS_SUPPLY -DUSE_STM32H745I_DISCO -DCORE_CM7 -c -I../../../Common/Inc -I../../../CM7/Inc -I../../../../../../../../Drivers/CMSIS/Include -I../../../../../../../../Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../../../../../../../Drivers/STM32H7xx_HAL_Driver/Inc -I../../../../../../../../Drivers/BSP/STM32H745I-DISCO -I../../../../../../../../Middlewares/Third_Party/FatFs/src -I../../../../../../../../Utilities/Fonts -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middleware/FatFs/Drivers/mmc_diskio.d" -MT"Middleware/FatFs/Drivers/mmc_diskio.o" --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -o "Middleware/FatFs/Drivers/mmc_diskio.o"
make: *** No rule to make target 'C:/Users/maxi/Desktop/nuevo/PP/eMMC soft/STM32CubeH7-master/STM32CubeH7-master/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c', needed by 'Drivers/STM32H7xx_HAL_Driver/stm32h7xx_hal.o'.  Stop.
make: *** Waiting for unfinished jobs....
In file included from ../../../../../../../../Drivers/BSP/STM32H745I-DISCO/stm32h745i_discovery_mmc.h:29,
                 from ../../../Common/Inc/mmc_diskio.h:24,
                 from C:/Users/maxi/Desktop/nuevo/PP/eMMC soft/STM32CubeH7-master/STM32CubeH7-master/Projects/STM32H745I-DISCO/Applications/FatFs/FatFs_Shared_Device/Common/Src/mmc_diskio.c:21:
../../../Common/Inc/stm32h745i_discovery_conf.h:28:10: fatal error: stm32h7xx_hal.h: No such file or directory
   28 | #include "stm32h7xx_hal.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Middleware/FatFs/Drivers/subdir.mk:19: Middleware/FatFs/Drivers/mmc_diskio.o] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.

11:31:24 Build Failed. 4 errors, 0 warnings. (took 465ms)

 

Thank you for your reply @SofLit !

I was referring to the following examples seen in STMcubeIDE

Maximiliano_0-1733140702201.png

 

I understand that your code is like a template, I would have to pass it to a project created from 0 by me in stm32cubeIDE, right? because I copied the emmc.c and .h files that you indicate me and if I compile it I get the following message also does not have the .ioc as to see graphically the configuration. error code above (I don't know why I don't see it below)

 

When creating an oriyecto from 0 configuring it as it is in the HTD I missed in fatfs_m7 that I would not know what options to select.

Maximiliano_1-1733149486978.png

 

I share the project to see if maybe I missed to configure something before or just the fatfs to be able to pass the emmcc and . h and what you passed me in the main.c and start debugging to understand the steps.

 

There is no available project from scratch. You need to configure your ioc file by following the parameters in these examples.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.