Skip to main content
Associate II
July 24, 2024
Solved

STM32MP157 custom board TF-A SDMMC init failed

  • July 24, 2024
  • 3 replies
  • 2961 views

Hello, we are trying to start our custom STM32MP157 board. We encountered some problems that I want to ask about. First is with TF-A, it gets to the SD card init (boot source) and it fails. We have eMMC on MMC2 and it also gives error message.

 

NOTICE: CPU: STM32MP157DAC Rev.Z
NOTICE: Model: Zegarson board TF-A testing 0.0.10
ERROR: stm32_sdmmc2_mmc_init: DT error
ERROR: SDMMC1 init failed
PANIC at PC : 0x2ffeb8cf

 

What is really weird about that, after some time playing with MMC configs (pull-ups, 1-bit 4-bit wide bus, speed, etc.) it randomly started working and got to DDR init and only then failed.

 

NOTICE: CPU: STM32MP157DAC Rev.Z
NOTICE: Model: Zegarson board TF-A testing 0.0.8
NOTICE: BL2: v2.8-stm32mp1-r2.0(release):v2.8-stm32mp-r2-1-g648de4789-dirty(648de478)
NOTICE: BL2: Built : 03:58:54, Jul 13 2024
ERROR: DDR addr bus test: can't access memory @ 0xc0000004
PANIC at PC : 0x2ffeac63

 

But a few days after we made clean build and it again has SD init problem.
What we discovered is that when we bumped final images and compared DTS files converted from DTB, it looks like the version that does not work do not contain sdmmc1 or sdmmc2 configuration, but working one has that.
Please help us what is going on and how to troubleshoot that?

 

Second problem is with STM32DDRFW-UTIL. We configured it for our board and got .stm32 file. 
I flashed first two partitions on SD card with this file instead of tf-a.stm32, LED on PA13 is lit (so boot failure); and of course nothing on UART4. 
Also we tried to use stm32wrapper4dbg on this .stm32 image but it returned an incorrect signature error. Is it only for TF-A or can we use it on STM32DDRFW-UTIL?
Am I flashing it wrong? What should I look for?

 

Thanks!

Best answer by Badzonor

So, we managed to solve the problem by compiling BL2 TF-A first. Really strange as it should be independent from BL32. Also SP_min does not work and we don't know why, but we switched to OPTEE and it start and gets much much further.

3 replies

Lead
July 25, 2024

@Badzonor 

I'm facing the same problem as you do.

I think you need to configure the .dts files from STM32CubeIDE. They are generated inside the CA7 folder. 

They must be compiled into .dtb files. But I have problems to compile .dts and .dtsi files into .dtb files. 

When .dts files, you can control which pin should be active and which pin should be not active.

 

Default eMMC is eMMC1 for booting. I have too eMMC2 as default, but have not configured it yet. 

 

See this threads:

* Unable to compile .dtb files for U-boot - STMicroelectronics Community

* STM32MP157-DK2 Conversion of DTS to DTB Problem - STMicroelectronics Community

ST32MP1 - CUBEMX Generated dts file , unable to co... - STMicroelectronics Community

 

 

 

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-ComputerSTM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer
BadzonorAuthor
Associate II
August 5, 2024

Hi, I already edited .dts files from STM32CubeIDE and it looks like its compiles ok. Board name, PMIC config, DDR, PLL and everything else is present in final .stm32 file but the sdmmc is not.

Actually even more concerning is that after I removed sdmmc2 config as it is not essential (booting from sdmmc1 SD card) it still gives error message

ERROR: stm32_sdmmc2_mmc_init: DT error

I don't know how it is even possible.

 

I also edited binary that is working to DDR init. I changed clock speed and some timing and then it looks like my LPDDR3 works fine 

NOTICE: CPU: STM32MP157DAC Rev.Z
NOTICE: Model: Zegarson board TF-A testing 0.0.8
NOTICE: Bootrom authentication failed
NOTICE: BL2: v2.8-stm32mp1-r2.0(release):v2.8-stm32mp-r2-1-g648de4789(648de478)
NOTICE: BL2: Built : 17:38:53, Jul 12 2024
ERROR: stm32_sdmmc2_read: timeout 1s (status = 201000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = 12,status = 22b000)
ERROR: stm32_sdmmc2_send_cmd_req: timeout 10ms (cmd = ERROR:

Some other sdmmc2 errors idk why but maybe this will help someway.

 

Thank you, Dominik.

asadullah4571
Associate III
September 5, 2024

may i know where you have done the change and how yoc compiled after changes for ddr 
please help me this one 

BadzonorAuthor
Associate II
July 26, 2024

Hello, thank you so much for your reply. We will try that soon and let you know how it goes

BadzonorAuthorBest answer
Associate II
August 10, 2024

So, we managed to solve the problem by compiling BL2 TF-A first. Really strange as it should be independent from BL32. Also SP_min does not work and we don't know why, but we switched to OPTEE and it start and gets much much further.