2026-01-25 8:27 AM - edited 2026-01-25 8:29 AM
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:
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.
No SD errors at all.
Also in U-Boot:
No external level shifter
No SD direction pin used
SD is wired directly to SDMMC1
Fixed 3.3V I/O
No card detect pin
PMIC regulator:
No special SDMMC settings exist in the *-u-boot.dtsi.
You can check the included log for more infomations
2026-01-26 5:45 AM
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.
2026-01-26 5:59 AM - edited 2026-01-26 6:00 AM
2026-01-26 6:03 AM
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.
2026-01-26 6:20 AM
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.