cancel
Showing results for 
Search instead for 
Did you mean: 

EMMC not being detected in DFU mode

adnan_pasha
Associate

Hi,

We have a custom carrier board based on STM32MP157DAC. We have built a custom yocto image.

  • Yocto Version: Mickledore
  • Machine: stm32mp15-disco
  • SoM: STM32MP157DAC
  • Distro: openstlinux-weston
  • Linux Kernel: 6.1.82-stm32mp-r2-r0

I was able to get a EMMC binaries by adding below line in my local.conf
STM32MP_DT_FILES_EMMC += "stm32mp157f-dk2"

I have also attached the modified flashlayout for EMMC.

I came across a post here saying if default pins are changes we will have to do otp for emmc to be detected.

below are the pins we are using:-

PB14SDMMC2_D0
PB15SDMMC2_D1
PB3SDMMC2_D2
PB4SDMMC2_D3
PA8SDMMC2_D4
PA15SDMMC2_D5
PC6SDMMC2_D6
PC7SDMMC2_D7
PE3SDMMC2_CLK
PG6SDMMC2_CMD


Do we need to do otp for these pins or what can be done for EMMC to be detected during dfu(0,0,0) mode for flashing to emmc.

below is my flash layout file for emmc:-

#OptIdNameTypeIPOffsetBinary
-0x01fsbl-bootBinarynone0x0arm-trusted-firmware/tf-a-stm32mp157f-dk2-usb.stm32
-0x03fip-bootFIPnone0x0fip/fip-stm32mp157f-dk2-optee-emmc.bin
P0x04fsbl1Binarymmc1boot1arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-emmc.stm32
P0x05fsbl2Binarymmc1boot2arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-emmc.stm32
P0x06metadata1FWU_MDATAmmc10x00084000arm-trusted-firmware/metadata.bin
P0x07metadata2FWU_MDATAmmc10x00100000arm-trusted-firmware/metadata.bin
P0x08fip-aFIPmmc10x00180000fip/fip-stm32mp157f-dk2-optee-emmc.bin
PED0x09fip-bFIPmmc10x00580000none
PED0x0Au-boot-envENVmmc10x00980000none
P0x10bootfsSystemmmc10x00A00000st-image-bootfs-openstlinux-weston-stm32mp15-disco.ext4
P0x11vendorfsFileSystemmmc10x04A00000st-image-vendorfs-openstlinux-weston-stm32mp15-disco.ext4
P0x12rootfsFileSystemmmc10x05A00000st-image-qt-openstlinux-weston-stm32mp15-disco.ext4



Thanks.

 

6 REPLIES 6
PatrickF
ST Employee

Hi @adnan_pasha 

Regarding OTP for pin changes, they are required for Boot Phase on CMD/CK and D0 pins only (only those are used by BootROM).

The pins you listed above does not need OTP fusing according to the AN5031 and wiki Boot from e•MMC™

 

For uBoot or else, pins are defined by Device Tree pinmux, which might miss in your case as you seems to have started your config from stm32mp157f-dk2 which does not have eMMC. 

In your case, better to look at STM32MP157D-ED1 or STM32MP157D-EV1. See https://wiki.st.com/stm32mpu/wiki/How_to_create_your_board_device_tree and https://github.com/STMicroelectronics/dt-stm32mp/tree/v5-stm32mp

 

For Flashlayout, please refer to Typical Flashlayout for e•MMC

 

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.
adnan_pasha
Associate

Hi @PatrickF 

Thanks for clarification about opt configuration.

i have made the below change in my stm32mp15xx-dkx.dtsi device tree in kernel-source and modified stm32mp157f-dk2.dts where to use sdmmc3 instead of 2.

do I need to do these coniguration in STM32MP157D-ED1 or STM32MP157D-EV1 files ?

 

/* changed from 3 to 2 for emmc */
&sdmmc2 {
u-boot,dm-pre-reloc;
u-boot,dm-spl;
pinctrl-names = "default", "opendrain", "sleep";

pinctrl-0 = <&sdmmc2_b4_pins_a>;
pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;

non-removable;
no-sd;
no-sdio;
st,neg-edge;
bus-width = <8>;
vmmc-supply = <&v3v3>;
vqmmc-supply = <&vdd>;
mmc-ddr-3_3v;
status = "okay";

};

adnan_pasha
Associate

Hi @PatrickF ,

With the above configuration i was able to detect emmc in linux boot.
but when trying to flash OS image to emmc from stm32cubeprogrammer it shows no device found mmc1.

thanks,

Hi,

you might miss the data 4-7 pinmux in your DT.

https://github.com/STMicroelectronics/linux/blob/v6.6-stm32mp/arch/arm/boot/dts/st/stm32mp15-pinctrl.dtsi#L1999

https://github.com/STMicroelectronics/linux/blob/v6.6-stm32mp/arch/arm/boot/dts/st/stm32mp157a-ed1.dts#L395

 

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.
adnan_pasha
Associate

Hi @PatrickF ,

I would like some clarification on how modifying the Device Tree configuration impacts eMMC detection in DFU mode, given that there is no operating system running before the eMMC image is flashed. Do I need to update the Device Tree, flash the image to an SD card first, and then use that setup to flash the eMMC?


Thanks.

Hi,

during first Flashload phase, the CubeProgrammer <-> BootROM in DFU will load two images ID = 0x01 (fsbl-boot in SYSRAM) and 0x03 (fip-boot in DDR). These are not loaded in any flash, they are the supporting SW to do the real flash later. Here DT is important mostly for DDR as uboot is loaded/running from DDR.

Then this loaded FIP/uBoot is started, will reconnect to CubeProgrammer in DFU for the real external flashing phase of other partitions as listed in the Flashlayout file (CubeProgrammer <-> uBoot in DFU <-> Flash). Here Device tree is important as uBoot need to configure correctly the external flash accesses (clock, IP, pins, etc..)

You don't need to Flash SD-Card if your target is to Flash the eMMC.

 

Maybe share your Cubeprogrammer error message and most important the board UART console messages.

 

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.