cancel
Showing results for 
Search instead for 
Did you mean: 

U-boots hangs when trying to load u-boot environment

edwardmcl
Associate II

I am booting from EMMC with this flash layout.

/dev/mmcblk1p1 : start= 34, size= 1024, type=8DA63339-0007-60C0-C436-083AC8230908, uuid=077BFE04-5B1A-41F8-8DC2-B47FCC4EA832, name="metadata1"
/dev/mmcblk0p2 : start= 1058, size= 1024, type=8DA63339-0007-60C0-C436-083AC8230908, uuid=9487F545-20A2-495E-A515-41B16AF75FE7, name="metadata2"
/dev/mmcblk1p3 : start= 2082, size= 4096, type=19D5DF83-11B0-457B-BE2C-7559C13142A5, uuid=4fd84c93-54ef-463f-a7ef-ae25ff887087, name="fip-a"
/dev/mmcblk1p4 : start= 6178, size= 4096, type=19D5DF83-11B0-457B-BE2C-7559C13142A5, uuid=09C54952-D5BF-45AF-ACEE-335303766FB3, name="fip-b"
/dev/mmcblk1p5 : start= 10274, size= 1024, type=3DE21764-95DB-54BD-A5C3-4ABE786F38A8, uuid=5BB4327D-D6F5-4007-BE5C-85681ED9C1E7, name="u-boot-env"
/dev/mmcblk1p6 : start= 11298, size= 974848, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=929FE52B-B9E0-459A-80AB-A8F82878CB57, name="bootfs", attrs="LegacyBIOSBootable"
/dev/mmcblk1p7 : start= 986146, size= 32768, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=F29C6C3E-6BCB-4313-8C5F-1D33BAEC7E85, name="vendorfs"
/dev/mmcblk1p8 : start= 1018914, size= 4194304, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=A260A1BB-7804-4861-93A2-715386D95582, name="rootfs"
/dev/mmcblk1p9 : start= 5213218, size= 4194304, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=62939A84-39BB-4108-9A17-96D7ECF0C6B8, name="userfs"

And it boots but hangs when loading the environment.

INFO: PMIC version = 0x21
NOTICE: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using EMMC
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r1.0(debug):devtool-patched-dirty
NOTICE: BL2: Built : 12:40:18, Feb 6 2024
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000khz
INFO: Memory size = 0x20000000 (512 MB)
INFO: BL2: Loading image id 31
INFO: Loading image id=31 at address 0x2ffff000
INFO: Image id=31 loaded: 0x2ffff000 - 0x2ffff226
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x2ffff000
INFO: FCONF: Reading firmware configuration information for: dyn_cfg
INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewall
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2ffc5000
INFO: Image id=4 loaded: 0x2ffc5000 - 0x2ffd9820
INFO: BL2: Skip loading image id 21
INFO: BL2: Skip loading image id 22
INFO: BL2: Loading image id 23
INFO: Loading image id=23 at address 0xc0500000
INFO: Image id=23 loaded: 0xc0500000 - 0xc0512910
INFO: BL2: Loading image id 26
INFO: Loading image id=26 at address 0x2ffc0000
INFO: Image id=26 loaded: 0x2ffc0000 - 0x2ffc4051
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0100000
INFO: Image id=5 loaded: 0xc0100000 - 0xc01ece98
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2ffc5000
INFO: SPSR = 0x1d3
NOTICE: SP_MIN: v2.6-stm32mp1-r1.0(debug):devtool-patched-dirty
NOTICE: SP_MIN: Built : 12:40:18, Feb 6 2024
INFO: ARM GICv2 driver initialized
INFO: SP_MIN: Initializing runtime services
INFO: SP_MIN: Preparing exit to normal world


U-Boot 2021.10-stm32mp-r1-00013-gd197821211-dirty (Feb 02 2024 - 10:52:21 +0000)

CPU: STM32MP157F?? Rev.Z
Model: xxxxx board V0.2
Board: stm32mp1 in trusted mode (st,stm32mp157c-osd32mp1-ads)
DRAM: 512 MiB
Clocks:
- MPU : 650 MHz
- MCU : 187.500 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
WDT: Started with servicing (32s timeout)
NAND: 0 MiB
MMC: STM32 SD/MMC: 0, STM32 SD/MMC: 1
Loading Environment from MMC...

Then it shows the CPU registers.

u-boot DTS has config

u-boot,mmc-env-partition = "u-boot-env";

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
edwardmcl
Associate II

The problem was a wrong pin assignment on one of the data lines of the u-boot DT which used bus-width=<8>. The EMMC could read & write when booted from SD which indicated that the pin assignments were correct but the default on mmc cards is one data line which in my case was assigned correctly in the DT. But as soon as it booted from EMMC where I assigned bus-width=<8> it started correctly with one data line but then it switched to 8 data lines and hung.

View solution in original post

7 REPLIES 7
Olivier GALLIEN
ST Employee

Hi @edwardmcl ,

I notice st,stm32mp157c-osd32mp1-ads  which is SiP from Octavo System 

Are you using a Octavo evalutation board or the SiP on custom board ?

Did you already try to contact Octavo for support? 

Else did you try to get more trace from U-Boot, see U-Boot - How to debug - stm32mpu

Hope it help 

Olivier 

 

 

 

Olivier GALLIEN
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.

I haven't contacted Octavo as I believe this isn't related to the SIP but I'll ask.

I'll follow your suggestion on the debug.

Thanks.

Hi,

 

/dev/mmcblk0p2--> this should be mmcblk"1"p2 ?

Did you try booting without the A/B scheme?

Did you try booting with Octavo image(dk2'st) with dts hand copied in the /boot?

Well spotted Eldam with the mmcblk0p2. It doesn't make a difference as it's metadata but obviously wrong.
I don't know what you mean about the A/B scheme.

 

About this fip-a & fip-b & A/B scheme,

It was a mistake from myside, I think it was related to A/B firmware update method. But it doesnt seem to.

Sorry for the inconvenience.

So I've debugged a bit further and have a trace of the EMMC commands.

The lines starting * are my extra debug.

U-boot hangs after the last CMD 8.

I'm using a THGBMHG6C1LBAIL EMMC chip.

I have restricted the speed to 26Mhz with the same result.

Loading Environment from MMC...

*host clock is enabled (400000Hz)
*ios - bus_with = 1, clock = 400000 sys_clock = 99000000
*ios - clk1 div 124

CMD_SEND:0
ARG 0x00000000
MMC_RSP_NONE


CMD_SEND:8
ARG 0x000001aa
RET -110

CMD_SEND:55
ARG 0x00000000
RET -110

CMD_SEND:0
ARG 0x00000000
MMC_RSP_NONE

CMD_SEND:1
ARG 0x00000000
MMC_RSP_R3,4 0x00ff8080

CMD_SEND:1
ARG 0x40300080
MMC_RSP_R3,4 0x00ff8080

CMD_SEND:1
ARG 0x40300080
MMC_RSP_R3,4 0x00ff8080

CMD_SEND:1
ARG 0x40300080
MMC_RSP_R3,4 0xc0ff8080

CMD_SEND:2
ARG 0x00000000
MMC_RSP_R2 0x11010030
0x30384742
0x3100939c
0xaea939d0

DUMPING DATA
000 - 11 01 00 30
004 - 30 38 47 42
008 - 31 00 93 9c
012 - ae a9 39 d0

CMD_SEND:3
ARG 0x00010000
MMC_RSP_R1,5,6,7 0x00000500

CMD_SEND:9
ARG 0x00010000
MMC_RSP_R2 0xd0270032
0x8f5903ff
0xffffffe7
0x864000a6

DUMPING DATA
000 - d0 27 00 32
004 - 8f 59 03 ff
008 - ff ff ff e7
012 - 86 40 00 a6

*host selecting mode MMC legacy (freq : 25 MHz)

CMD_SEND:7
ARG 0x00010000
MMC_RSP_R1,5,6,7 0x00000700

CMD_SEND:8
ARG 0x00000000
MMC_RSP_R1,5,6,7 0x00000900

*host clock is enabled (25000000Hz)
* try MMC High Speed (52MHz) width 8 (at 52 MHz)

CMD_SEND:6
ARG 0x03b70200
MMC_RSP_R1b 0x00000800

*ios - bus_with = 8, clock = 25000000 sys_clock = 99000000
*ios - clk1 div 2
*switch card speed 1

CMD_SEND:6
ARG 0x03b90100
MMC_RSP_R1b 0x00000800

CMD_SEND:8
ARG 0x00000000

hangs here

edwardmcl
Associate II

The problem was a wrong pin assignment on one of the data lines of the u-boot DT which used bus-width=<8>. The EMMC could read & write when booted from SD which indicated that the pin assignments were correct but the default on mmc cards is one data line which in my case was assigned correctly in the DT. But as soon as it booted from EMMC where I assigned bus-width=<8> it started correctly with one data line but then it switched to 8 data lines and hung.