cancel
Showing results for 
Search instead for 
Did you mean: 

EMMC not being detected in DFU mode

adnan_pasha
Associate III

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.

 

14 REPLIES 14
adnan_pasha
Associate III

Hi @PatrickF 

I was able to generate patch files for the Linux kernel, U-Boot, and TF-A sources using the devtool command shown below:

 
devtool modify virtual/kernel

 

I followed the steps provided in the link below, which I found to be extremely helpful:

https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Distribution_Package

I'm sharing this here in case someone else encounters the same issue—this guide proved to be a valuable resource for me.

now I am trying to modify device tree files and try to flash emmc will let you know if i'm facing any issue or if it get resolved.

Thanks,

adnan_pasha
Associate III

Hi @PatrickF 

Below is the log i am getting while trying to update os image to emmc

Core: 368 devices, 44 uclasses, devicetree: board
WDT: Started watchdog with servicing (32s timeout)
NAND: 0 MiB
MMC: STM32 SD/MMC: 0, STM32 SD/MMC: 1
Loading Environment from nowhere... OK
In: serial
Out: serial
Err: serial
invalid MAC address 0 in OTP 00:00:00:00:00:00
Net:
Error: ethernet@5800a000 address not set.
No ethernet found.

Card did not respond to voltage select! : -110
No EFI system partition

Error: ethernet@5800a000 address not set.

Error: ethernet@5800a000 address not set.
Hit any key to stop autoboot: 0
Boot over usb0!
DFU alt info setting: done
dwc2-udc-otg usb-otg@49000000: Type-C won't probe (ret=-5)
#
UPLOAD ... done
Ctrl+C to exit ...
#
FlashLayout received, size = 695
DOWNLOAD ... OK
Ctrl+C to exit ...
#
UPLOAD ... done
Ctrl+C to exit ...
Card did not respond to voltage select! : -110
Error: mmc device 1 not found
DFU alt info setting: done
dwc2-udc-otg usb-otg@49000000: Type-C won't probe (ret=-5)
Reset requested
#
UPLOAD ... done
Ctrl+C to exit ...

I have attached my patches please have a look

adnan_pasha
Associate III

Hi @PatrickF ,

I was able to detect and flash emmc after changing in stm32mp157f-dk2-u-boot.dtsi sdmmc2 status to okay.

But while trying to boot from emmc by configuring 010 boot pins I get below error and it's not booting.

Exception mode=0x00000016 at: 0x2ffec98b
NOTICE:  CPU: STM32MP157DAC Rev.Z
NOTICE:  Model: STMicroelectronics STM32MP157F-DK2 Discovery Board
INFO:    PMIC version = 0x21
INFO:    Reset reason (0x114):
INFO:      IWDG1 Reset (rst_iwdg1)
INFO:    FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO:    FCONF: Reading firmware configuration information for: stm32mp_io
INFO:    FCONF: Reading firmware configuration information for: stm32mp_fuse
INFO:    Using EMMC
INFO:      Instance 2
INFO:    Boot used partition fsbl1
ERROR:   CMD13 failed after 5 retries
ERROR:   SDMMC2 init failed
PANIC at PC : 0x2ffec98b
 
Exception mode=0x00000016 at: 0x2ffec98b
adnan_pasha
Associate III

Hi @PatrickF 

We are using EMMC04G-MT32-FBGA153 EMMC .

I had seen in few posts that certain EMMC's are not supported.
I wanted to know if our EMMC device is compatible with the STM32MP157DAC som.

Thanks

adnan_pasha
Associate III

Hi,

I was able to resolve this issue and the device to boot using EMMC By changing the MMC_DEFAULT_MAX_RETRIES in TFA_source/driver/mmc/mmc.c file from 5 to 10.

Below is the link to my other post where I was able to resolve it.

https://community.st.com/t5/stm32-mpus-embedded-software-and/not-able-to-boot-from-emmc-on-stm32mp157dac-panic-at-pc/m-p/799044#M4744


Thanks.