cancel
Showing results for 
Search instead for 
Did you mean: 

How do I open a uboot shell?

JayDev
Senior II

I know this is probably a really stupid/noob question but I was trying to flash the STM32MP157D-DK1 board I have for the first time following the following guide:

https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package 

I ran into an issue where it started the flash and then couldn't reconnect.  I did find this article that seems to describe exactly the issue I'm having:

https://community.st.com/t5/stm32-mpus/faq-stm32mp1-stm32cubeprogrammer-usb-reconnect-error-at-stm32mp1/ta-p/49263 

It recommends:

 

In Uboot shell run a Dfu command  :

  STM32MP> env set dfu_alt_info "DDR ram 0xC0000000 0x20000000"

  STM32MP> dfu 0 ram 0

 

 Unfortunately, I don't know how to run a uboot shell to try this.  I know this is probably a really stupid problem . . . but I'm also hoping that means it has an easy solution as well.  Any help you can give me would be greatly appreciated.  Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

Hi @JayDev ,

Did you tried another USB port on your PC, thru an USB hub ? With another PC, another USB cable ?

Maybe details your PC setup (W10 ? W11 ? USB-A or USB-C port ? ...)

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.

View solution in original post

10 REPLIES 10
JayDev
Senior II

I do have a ST-Link to the board and I'm watching the serial port @ 115200 and can see info coming in, I just don't know how to actually get to the u-boot to change the command.  Maybe I'm getting closer but I'm not 100% sure.  Thanks!

Hi @JayDev 

to reach uboot prompt, simply press a key on the serial console at right time during boot sequence.

.....
U-Boot 2022.10-stm32mp-r1 (Oct 03 2022 - 19:25:32 +0000)

CPU: STM32MP157FAC Rev.Z
Model: STMicroelectronics STM32MP157F-DK2 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157f-dk2)
Board: MB1272 Var4.0 Rev.C-02
DRAM:  512 MiB
optee optee: OP-TEE: revision 3.19 (afacf356)
Clocks:
- MPU : 800 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
Core:  367 devices, 43 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 MMC... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@5800a000
Hit any key to stop autoboot:  0
STM32MP>

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.

So, I've been trying to get this to work but still haven't seen the boot.  I've tried plugging in the USB power and USB Micro/STLink and clicking the reset button but get no output.  I've tried leaving STLink plugged in and resetting (both end up with LD6 blinking red on and off.  I can plug in the other USB-C connector and the light goes solid.  Still no output, even when resetting. 

The only time I can get an actual output is when trying to program the device over USB in STM32Prog.  This is the output screen I'm getting:

INFO:    Receive DFU Detach
INFO:    DFU USB STOP...
INFO:    BL2: Loading image id 1
INFO:    Loading image id=1 at address 0x2ffff000
INFO:    Image id=1 loaded: 0x2ffff000 - 0x2ffff1ea
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 0xde000000
INFO:    Image id=4 loaded: 0xde000000 - 0xde00001c
INFO:    OPTEE ep=0xde000000
INFO:    OPTEE header info:
INFO:          magic=0x4554504f
INFO:          version=0x2
INFO:          arch=0x0
INFO:          flags=0x0
INFO:          nb_images=0x1
INFO:    BL2: Loading image id 8
INFO:    Loading image id=8 at address 0xde000000
INFO:    Image id=8 loaded: 0xde000000 - 0xde036b68
INFO:    BL2: Skip loading image id 9
INFO:    BL2: Loading image id 2
INFO:    Loading image id=2 at address 0xc0500000
INFO:    Image id=2 loaded: 0xc0500000 - 0xc051ee40
INFO:    BL2: Skip loading image id 16
INFO:    BL2: Loading image id 5
INFO:    Loading image id=5 at address 0xc0100000
INFO:    Image id=5 loaded: 0xc0100000 - 0xc01f5d3c
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde000000
INFO:    SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Embedded DTB found
I/TC: OP-TEE version: 3.19.0-dev (gcc version 12.2.0 (GCC)) #1 Fri Oct 14 19:00:05 UTC 2022 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp157d-dk1.dts
I/TC: DTB enables console (non-secure)
I/TC: Primary CPU switching to normal world boot
optee optee: OP-TEE: revision 3.19 (afacf356)


U-Boot 2022.10-stm32mp-r1 (Oct 03 2022 - 19:25:32 +0000)

CPU: STM32MP157DAC Rev.Z
Model: STMicroelectronics STM32MP157D-DK1 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157d-dk1)
Board: MB1272 Var3.0 Rev.C-02
DRAM:  512 MiB
optee optee: OP-TEE: revision 3.19 (afacf356)
Clocks:
- MPU : 800 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
Core:  359 devices, 39 uclasses, devicetree: board
WDT:   Started watchdog with servicing (32s timeout)
NAND:  0 MiB
MMC:   STM32 SD/MMC: 0
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Previous ADC measurements was not the one expected, retry in 20ms
****************************************************
* ERROR USB TYPE-C connection in unattached mode   *
* Check that USB TYPE-C cable is correctly plugged *
*     Current too low, use a 3A power supply!      *
****************************************************

All signs appear to be pointing to the power supply, but that doesn't make sense to me as I'm currently using a 5V 3A supply (I'm using https://www.mouser.com/ProductDetail/TT-Electronics-IoT-Solutions/T7715DV?qs=vLWxofP3U2zWk%2FI5z4EHKA%3D%3D ).  Is it possible the issue really is the power supply?  Maybe it's dipping and browning out?  Or is my current process for getting to uboot incorrect?

Thanks for your help and sorry for the delay!  I should be faster to respond this week!

Ok, since the last post, I went and found a phone charger (which likely has better USB protocols than a straight USB C 3A charger.  It seemed to get past the previous issue so I was able to get into the boot mode and quickly type in

STM32MP> env set dfu_alt_info "DDR ram 0xC0000000 0x20000000"
STM32MP> dfu 0 ram 0

Now the issue I'm having is it seems to be timing out before it finishes programming the board.  This is what I'm seeing:

 

STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-weston/optee/FlashLayout_sdcard_stm32mp157d-dk1-optee.tsv
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.14.0                  
      -------------------------------------------------------------------



USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN          : 001F00283438511536383238
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP15xx
Device type : MPU
Revision ID : --  
Device CPU  : Cortex-A7

Start Embedded Flashing service



Memory Programming ...
Opening and parsing file: tf-a-stm32mp157d-dk1-usb.stm32
  File          : tf-a-stm32mp157d-dk1-usb.stm32
  Size          : 220.40 KB 
  Partition ID  : 0x01 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:02.588

RUNNING Program ... 
  PartID:      :0x01 
Start operation done successfully at partition 0x01


Memory Programming ...
Opening and parsing file: fip-stm32mp157d-dk1-optee.bin
  File          : fip-stm32mp157d-dk1-optee.bin
  Size          : 1.29 MB 
  Partition ID  : 0x03 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:01.771

RUNNING Program ... 
  PartID:      :0x03 

Reconnecting the device ...

USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : USB download gadget@Device ID /0x500, @Revision ID /0x2001, @Name /STM32MP157DAC Rev.Z,
SN          : 001F00283438511536383238
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP157DAC Rev.Z
Device type : MPU
Device CPU  : Cortex-A7
Start operation done successfully at partition 0x03

Flashlayout Programming ...
[==================================================] 100% 
Running Flashlayout Partition ...

Reconnecting the device ...

USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : USB download gadget@Device ID /0x500, @Revision ID /0x2001, @Name /STM32MP157DAC Rev.Z,
SN          : 001F00283438511536383238
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP157DAC Rev.Z
Device type : MPU
Device CPU  : Cortex-A7
Flashlayout partition started successfully


Memory Programming ...
Opening and parsing file: tf-a-stm32mp157d-dk1-sdcard.stm32
  File          : tf-a-stm32mp157d-dk1-sdcard.stm32
  Size          : 220.42 KB 
  Partition ID  : 0x04 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.171

RUNNING Program ... 
  PartID:      :0x04 
Start operation done successfully at partition 0x04


Memory Programming ...
Opening and parsing file: tf-a-stm32mp157d-dk1-sdcard.stm32
  File          : tf-a-stm32mp157d-dk1-sdcard.stm32
  Size          : 220.42 KB 
  Partition ID  : 0x05 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.184

RUNNING Program ... 
  PartID:      :0x05 
Start operation done successfully at partition 0x05


Memory Programming ...
Opening and parsing file: metadata.bin
  File          : metadata.bin
  Size          : 96.00 B 
  Partition ID  : 0x06 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.006

RUNNING Program ... 
  PartID:      :0x06 
Start operation done successfully at partition 0x06


Memory Programming ...
Opening and parsing file: metadata.bin
  File          : metadata.bin
  Size          : 96.00 B 
  Partition ID  : 0x07 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.006

RUNNING Program ... 
  PartID:      :0x07 
Start operation done successfully at partition 0x07


Memory Programming ...
Opening and parsing file: fip-stm32mp157d-dk1-optee.bin
  File          : fip-stm32mp157d-dk1-optee.bin
  Size          : 1.29 MB 
  Partition ID  : 0x08 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:01.085

RUNNING Program ... 
  PartID:      :0x08 
Start operation done successfully at partition 0x08


Memory Programming ...
Opening and parsing file: st-image-bootfs-openstlinux-weston-stm32mp1.ext4
  File          : st-image-bootfs-openstlinux-weston-stm32mp1.ext4
  Size          : 64.00 MB 
  Partition ID  : 0x10 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:59.657

RUNNING Program ... 
  PartID:      :0x10 
Start operation done successfully at partition 0x10


Memory Programming ...
Opening and parsing file: st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
  File          : st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
  Size          : 16.00 MB 
  Partition ID  : 0x11 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:14.982

RUNNING Program ... 
  PartID:      :0x11 
Start operation done successfully at partition 0x11


Memory Programming ...
Opening and parsing file: st-image-weston-openstlinux-weston-stm32mp1.ext4
  File          : st-image-weston-openstlinux-weston-stm32mp1.ext4
  Size          : 586.38 MB 
  Partition ID  : 0x12 

Download in Progress:
[======                                            ]  12% 

Error: failed to download data chunck [0]


Error: failed to download Segment[0]
Error: failed to download the File
Error: Download partition 0x12 failed
Error: TSV flashing service failed

 Any ideas how to get around this issue?  I'm not entirely sure how to change the timeout.  I've essentially got the same result from the STM32 Programmer and from the CLI tool. 

Thanks!

Hi @JayDev ,

 

Could you please try to replace in tsv : 

- 0x01 fsbl-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp157d-dk1-usb.stm32
- 0x03 fip-boot FIP none 0x0 fip/fip-stm32mp157d-dk1-optee.bin

by 

- 0x01 fsbl-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp157a-dk1-usb.stm32
- 0x03 fip-boot FIP none 0x0 fip/fip-stm32mp157a-dk1-optee.bin

 

Let me know the result

 

Thanks 

 

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.

Well, the good news is I got a different outcome but I'm not entirely sure what that tells me, to be honest (though you likely do). 

To be clear, my edited file currently looks like this (for confirmation):

#Opt	Id	Name	Type	IP	Offset	Binary
-	0x01	fsbl-boot	Binary	none	0x0	arm-trusted-firmware/tf-a-stm32mp157a-dk1-usb.stm32
-	0x03	fip-boot	FIP	none	0x0	fip/fip-stm32mp157a-dk1-optee.bin
P	0x04	fsbl1	Binary	mmc0	0x00004400	arm-trusted-firmware/tf-a-stm32mp157d-dk1-sdcard.stm32
P	0x05	fsbl2	Binary	mmc0	0x00044400	arm-trusted-firmware/tf-a-stm32mp157d-dk1-sdcard.stm32
P	0x06	metadata1	FWU_MDATA	mmc0	0x00084400	arm-trusted-firmware/metadata.bin
P	0x07	metadata2	FWU_MDATA	mmc0	0x000C4400	arm-trusted-firmware/metadata.bin
P	0x08	fip-a	FIP	mmc0	0x00104400	fip/fip-stm32mp157d-dk1-optee.bin
PED	0x09	fip-b	FIP	mmc0	0x00504400	none
PED	0x0A	u-boot-env	ENV	mmc0	0x00904400	none
P	0x10	bootfs	System	mmc0	0x00984400	st-image-bootfs-openstlinux-weston-stm32mp1.ext4
P	0x11	vendorfs	FileSystem	mmc0	0x04984400	st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
P	0x12	rootfs	FileSystem	mmc0	0x05984400	st-image-weston-openstlinux-weston-stm32mp1.ext4
P	0x13	userfs	FileSystem	mmc0	0x105984400	st-image-userfs-openstlinux-weston-stm32mp1.ext4

Below is what my output was.  Note it made it to 48% rather than the previous 12% and seems to have failed with chunk 2 instead of chunk 0. 

STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-weston/optee/EDIT_FlashLayout_sdcard_stm32mp157d-dk1-optee.tsv
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.14.0                  
      -------------------------------------------------------------------



USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN          : 001F00283438511536383238
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP15xx
Device type : MPU
Revision ID : --  
Device CPU  : Cortex-A7

Start Embedded Flashing service



Memory Programming ...
Opening and parsing file: tf-a-stm32mp157a-dk1-usb.stm32
  File          : tf-a-stm32mp157a-dk1-usb.stm32
  Size          : 220.40 KB 
  Partition ID  : 0x01 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:02.557

RUNNING Program ... 
  PartID:      :0x01 
Start operation done successfully at partition 0x01


Memory Programming ...
Opening and parsing file: fip-stm32mp157a-dk1-optee.bin
  File          : fip-stm32mp157a-dk1-optee.bin
  Size          : 1.29 MB 
  Partition ID  : 0x03 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:01.745

RUNNING Program ... 
  PartID:      :0x03 

Reconnecting the device ...

USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : USB download gadget@Device ID /0x500, @Revision ID /0x2001, @Name /STM32MP157DAC Rev.Z,
SN          : 001F00283438511536383238
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP157DAC Rev.Z
Device type : MPU
Device CPU  : Cortex-A7
Start operation done successfully at partition 0x03

Flashlayout Programming ...
[==================================================] 100% 
Running Flashlayout Partition ...

Reconnecting the device ...

USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : USB download gadget@Device ID /0x500, @Revision ID /0x2001, @Name /STM32MP157DAC Rev.Z,
SN          : 001F00283438511536383238
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP157DAC Rev.Z
Device type : MPU
Device CPU  : Cortex-A7
Flashlayout partition started successfully


Memory Programming ...
Opening and parsing file: tf-a-stm32mp157d-dk1-sdcard.stm32
  File          : tf-a-stm32mp157d-dk1-sdcard.stm32
  Size          : 220.42 KB 
  Partition ID  : 0x04 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.195

RUNNING Program ... 
  PartID:      :0x04 
Start operation done successfully at partition 0x04


Memory Programming ...
Opening and parsing file: tf-a-stm32mp157d-dk1-sdcard.stm32
  File          : tf-a-stm32mp157d-dk1-sdcard.stm32
  Size          : 220.42 KB 
  Partition ID  : 0x05 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.203

RUNNING Program ... 
  PartID:      :0x05 
Start operation done successfully at partition 0x05


Memory Programming ...
Opening and parsing file: metadata.bin
  File          : metadata.bin
  Size          : 96.00 B 
  Partition ID  : 0x06 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.006

RUNNING Program ... 
  PartID:      :0x06 
Start operation done successfully at partition 0x06


Memory Programming ...
Opening and parsing file: metadata.bin
  File          : metadata.bin
  Size          : 96.00 B 
  Partition ID  : 0x07 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:00.006

RUNNING Program ... 
  PartID:      :0x07 
Start operation done successfully at partition 0x07


Memory Programming ...
Opening and parsing file: fip-stm32mp157d-dk1-optee.bin
  File          : fip-stm32mp157d-dk1-optee.bin
  Size          : 1.29 MB 
  Partition ID  : 0x08 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:01.182

RUNNING Program ... 
  PartID:      :0x08 
Start operation done successfully at partition 0x08


Memory Programming ...
Opening and parsing file: st-image-bootfs-openstlinux-weston-stm32mp1.ext4
  File          : st-image-bootfs-openstlinux-weston-stm32mp1.ext4
  Size          : 64.00 MB 
  Partition ID  : 0x10 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:01:04.933

RUNNING Program ... 
  PartID:      :0x10 
Start operation done successfully at partition 0x10


Memory Programming ...
Opening and parsing file: st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
  File          : st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
  Size          : 16.00 MB 
  Partition ID  : 0x11 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:16.113

RUNNING Program ... 
  PartID:      :0x11 
Start operation done successfully at partition 0x11


Memory Programming ...
Opening and parsing file: st-image-weston-openstlinux-weston-stm32mp1.ext4
  File          : st-image-weston-openstlinux-weston-stm32mp1.ext4
  Size          : 586.38 MB 
  Partition ID  : 0x12 

Download in Progress:
[========================                          ]  48% 

Error: failed to download data chunck [2]


Error: failed to download Segment[0]
Error: failed to download the File
Error: Download partition 0x12 failed
Error: TSV flashing service failed

 

If it helps, I also just tried to run:

STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-weston/optee/FlashLayout_sdcard_stm32mp157a-dk1-optee.tsv

It appears this time it failed at 50% of chunk 0x12 and gave the following output:

Memory Programming ...
Opening and parsing file: st-image-weston-openstlinux-weston-stm32mp1.ext4
  File          : st-image-weston-openstlinux-weston-stm32mp1.ext4
  Size          : 586.38 MB 
  Partition ID  : 0x12 

Download in Progress:
[=========================                         ]  50% 

Error: failed to download data chunck [3]


Error: failed to download Segment[0]
Error: failed to download the File
Error: Download partition 0x12 failed
Error: TSV flashing service failed

 

JayDev
Senior II

@Olivier GALLIEN 

@PatrickF 

Any other ideas on where to proceed from here?  I'm running out of ideas, unfortunately.  Anything else I can try to get more information? 

PatrickF
ST Employee

Hi @JayDev ,

Did you tried another USB port on your PC, thru an USB hub ? With another PC, another USB cable ?

Maybe details your PC setup (W10 ? W11 ? USB-A or USB-C port ? ...)

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.