cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157 – SD card works in ROM/TF-A (FSBL) but fails in U-Boot with CMD55 retries

Najib Kassab
Associate III

 

Problem description

I have a custom board based on STM32MP157FAA.
The SD card boots perfectly in:

  • ROM boot

  • TF-A BL2 (FSBL)

But once control reaches U-Boot, the SD card becomes completely unusable and U-Boot shows continuous:

 
stm32_sdmmc2 mmc@58005000: cmd 55 failed, retrying ...

U-Boot cannot read environment, cannot rescan the card, and reports “No block device”.

This is very confusing because the same SD card and hardware clearly work during ROM and TF-A stages.


Boot log

TF-A / BL2 (working)

INFO: Using SDMMC INFO: Instance 1 INFO: Boot used partition fsbl1 ... INFO: BL2: Loading image id 5 NOTICE: BL2: Booting BL32

No SD errors at all.


U-Boot (failing)

U-Boot 2023.10-stm32mp-r2
MMC: STM32 SD/MMC: 0, STM32 SD/MMC: 1
Loading Environment from MMC...
stm32_sdmmc2 mmc@58005000: cmd 55 failed, retrying ...
*** Warning - No block device, using default environment ...
Saving Environment to MMC... No block device

Also in U-Boot:

Clocks:
- MPU : 0 MHz
- MCU : 0 MHz
- AXI : 0 MHz
- PER : 0 MHz
- DDR : 0 MHz

Hardware notes

  • No external level shifter

  • No SD direction pin used

  • SD is wired directly to SDMMC1

  • Fixed 3.3V I/O

  • No card detect pin


Linux / TF-A SDMMC1 DTS (works)

 
&sdmmc1 {
status = "okay";
bus-width = <4>;
no-1-8-v;
vmmc-supply = <&vdd_sd>;
disable-wp;
broken-cd; };

PMIC regulator:

vdd_sd:ldo5{
regulator-name = "vdd_sd";
regulator-min-microvolt = <2900000>;
regulator-max-microvolt = <2900000>;
regulator-boot-on;
};

 

 

No special SDMMC settings exist in the *-u-boot.dtsi.

You can check the included log for more infomations

4 REPLIES 4
PatrickF
ST Employee

Hi,


@Najib Kassab wrote:

Also in U-Boot:

Clocks:
- MPU : 0 MHz
- MCU : 0 MHz
- AXI : 0 MHz
- PER : 0 MHz
- DDR : 0 MHz

 


that's very strange to have all clocks stated at 0 with uBoot. Maybe root cause of failing SDMMC access.

As far as I know, BootROM and TF-A uses default SDMMC settings while uBoot reconfigure SDMMC according to Device Tree. Maybe an issue with OpTee which manage the clocks after TF-A.

 

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.
Tip of the day: Try Sidekick STM32 AI agent, see here

@PatrickF 

 

So what do you suggest to do now , if the problem is with optee?

@PatrickF 

Also I have question, I am generating Devixe tree using stm32cubemx, the problem is whenever I made and change on GUI it does not affect the device tree whatever I do it always generates the same device tree.

Sometimes it works fine, but most of the time it does not work as expected.

Hi  @Najib Kassab 

unfortunately, I'm not very SW savvy. 
What I know is that CubeMx generates only very partial Device Tree which should be tailored to your HW.
Usually using existing working Device Tree from board like Evaluation or Discovery together with using wiki guidelines for each IPs.

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree#STM32CubeMX_generated_device_tree

 

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.
Tip of the day: Try Sidekick STM32 AI agent, see here