cancel
Showing results for 
Search instead for 
Did you mean: 

Programming on board eMMC using Cube Programmer

NGajic
Associate III

Hi,

We have a custom board with onboard eMMC which is connected on SDMMC2 lines:

SDMMC2_D0 - PB14

SDMMC2_D1 - PB15

SDMMC2_D2 - PB3

SDMMC2_D3 - PB4

SDMMC2_D4 - PB8

SDMMC2_D5 - PB9

SDMMC2_D6 - PC6

SDMMC2_D7 - PC7

SDMMC2_CMD - PG6

SDMMC2_CLK - PE3

These pins are not all default pins for SDMMC2 so I'm interested if there is a way to program this eMMC using DFU mode with Cube Programmer. Is there a way to change pins which are used for programming?

Best regards,

Nenad

1 ACCEPTED SOLUTION

Accepted Solutions
Fee
Senior

Hi,

with CubeProgrammer and its DFU mode you will need to have a running TF-A and U-Boot. In those you can customize each device tree in order to get the sdmmc2 peripheral working with your pins (by defining your pins with a pinctrl). TF-A and U-Boot will then be able to detect your eMMC. You might have a look at these links:

https://wiki.st.com/stm32mpu/wiki/SDMMC_device_tree_configuration

https://wiki.st.com/stm32mpu/wiki/How_to_create_your_board_device_tree

I can recommend using CubeMX to define your sdmmc2 pin configuration for the device tree.

View solution in original post

5 REPLIES 5
Fee
Senior

Hi,

with CubeProgrammer and its DFU mode you will need to have a running TF-A and U-Boot. In those you can customize each device tree in order to get the sdmmc2 peripheral working with your pins (by defining your pins with a pinctrl). TF-A and U-Boot will then be able to detect your eMMC. You might have a look at these links:

https://wiki.st.com/stm32mpu/wiki/SDMMC_device_tree_configuration

https://wiki.st.com/stm32mpu/wiki/How_to_create_your_board_device_tree

I can recommend using CubeMX to define your sdmmc2 pin configuration for the device tree.

NGajic
Associate III

Thank you very much @Lukas Brückner​. Everything is clear now.

Best regards,

Nenad

PatrickF
ST Employee

Hello,

After the TF-A and uBoot customization as stated by @Lukas Brückner​, you should suceed to program the eMMC. Then in order to allow the BootROM to use your non-default pin for eMMC on SDMMC2, you also need to setup some OTP.

See an example on https://community.st.com/s/question/0D53W00000PoivmSAB/changing-the-emmc-pins-with-otp for instance

See also https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#Boot_from_e-E2-80-A2MMC-E2-84-A2

Regards.

In order 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.

Hi @PatrickF​ ,

I'm using those 3 pins for SDMMC2 and BootROM would use them by default.

SDMMC2_D0 - PB14

SDMMC2_CMD - PG6

SDMMC2_CLK - PE3

Do I need to change OTP, maybe no?

I wanted to say that my other pins (D4-D7) are not default for SDMMC2 (picture below). Are these SDMMC2 pins set with subsequent device tree-s (tf-a, u-boot, kernel dtb)?

Thanks in advance,

Nenad0693W000006FDffQAG.png

Sorry, I misread your first post.

In that case, no need to program OTP, just define the pins in Device Tree for TF-A, uBoot and Linux.

Regards.

In order 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.