2020-12-08 09:52 AM - last edited on 2023-07-11 10:31 AM by Kevin HUBER
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
Solved! Go to Solution.
2020-12-08 11:32 PM
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.
2020-12-08 11:32 PM
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.
2020-12-09 01:30 AM
Thank you very much @Lukas Brückner. Everything is clear now.
Best regards,
Nenad
2020-12-09 06:43 AM
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.
2020-12-09 01:55 PM
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,
Nenad
2020-12-09 11:22 PM
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.