DHSBC STM32MP13 DFU and UMS usage

From Wiki-DB
Revision as of 16:38, 5 August 2024 by Ageisreiter (talk | contribs) (Created page with "<!-- https://wiki.dh-electronics.com/index.php?title=U-Boot_recovery_for_STM32MP1_DHSOM_via_DFU --> To recover a corrupted U-Boot on a STM32MP1-based DHCOM, we can use the default fallback boot source DFU via serial link or USB to temporarily boot U-Boot SPL and U-Boot. From this U-Boot shell we can write both bootloader images from the SD card to the boot flash. <div class="toclimit-3">__TOC__</div> == Requirements == === Software === * Linux host computer (Virtual...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


To recover a corrupted U-Boot on a STM32MP1-based DHCOM, we can use the default fallback boot source DFU via serial link or USB to temporarily boot U-Boot SPL and U-Boot. From this U-Boot shell we can write both bootloader images from the SD card to the boot flash.

Requirements

Software

Hardware

  • DHSBC STM32MP13 board
  • USB-A to Type-C cable (for DFU and UMS data connection)
  • Type-C power supply for DHCBS STM32Mp13 board
  • FTDI cable TTL-232R-3V3 for console connection

Preparation

This installation was made on the Virtual Machine for Application Development. All console expressions refer to this Debian system, but any other debian based system should also work.

Install dfu-util (debian)

apt-get install dfu-util

Collect artifacts from OE build:

  • tf-a-stm32mp135f-dhcor-dhsbc.stm32-stm32mp1
  • fip.bin-stm32mp1
  • *image*.wic

Start U-Boot via USB DFU upload:

$ dfu-util -a 0 -D tf-a-stm32mp135f-dhcor-dhsbc.stm32 -R
$ dfu-util -a 0 -D fip.bin -R

Install bootloader to SPI NOR:

  • U-Boot side:
=> sf probe
=> env set dfu_alt_info "mtd nor0=fsbl1 raw 0x0 0x40000;fsbl2 raw 0x40000 0x40000;uboot raw 0x80000 0x160000;env1 raw 0x3e0000 0x10000;env2 raw 0x3f0000 0x10000"
=> dfu 0 mtd
  • Host PC side
$ dfu-util -a 2 -D fip.bin
$ dfu-util -a 1 -D tf-a-stm32mp135f-dhcor-dhsbc.stm32
$ dfu-util -a 0 -D tf-a-stm32mp135f-dhcor-dhsbc.stm32

Power off the board, switch boot mode to 123=OFF-ON-ON (QSPI NOR boot)

Reset Environment to default of new bootloader

=> env default -a
=> saveenv
=> saveenv

Install root filesystem to eMMC:

  • U-Boot side:
=> ums 0 mmc 0
  • Host PC side
$ dd if=*image*wic of=/dev/sdX bs=4M

Power off the board, switch boot mode to 123=OFF-ON-ON (QSPI NOR boot)

Power on and boot