Avenger96 UMS Image Programming

From Wiki-DB
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

This guide is about how to flash the AV96 board via universal mass storage.

Start UMS mode in U-Boot and flash the image

  • Set Avenger96 boot mode to SPI boot.
COM Avenger96Board
  • Start the board and stop in U-Boot by pressing any key.
  • Connect USB cable between USB OTG and PC host port and call the following from U-Boot command line.
ums 0 mmc 1 

-> Mass storage is detected from the host PC.

  • Now you can use balena etcher to flash the dh-image-demo to eMMC.

Update U-Boot from USB stick

After the image update you will have the problem, that the originally flashed U-Boot is not capable to load the new Image. To fix this you have to update the U-Boot on the SPI flash:

  • Copy the U-Boot and SPL binaiers to a USB stick and plugin the flash drive at the AVenger96 Host port
  • Start U-Boot and set the following ENV variable:
env set update_sf 'usb start && env set loadaddr 0xc2000000 && env set loadaddr1 0xd2000000 && load usb 0 ${loadaddr1} u-boot-spl.stm32 && env set filesize1 ${filesize} && load usb 0 ${loadaddr} u-boot.itb && sf probe && sf erase 0 0x200000 && sf update ${loadaddr1} 0 ${filesize1} && sf update ${loadaddr1} 0x40000 ${filesize1} && sf update ${loadaddr} 0x80000 ${filesize} && env set filesize1 && env set loadaddr1'
  • Run the script
run update_sf

Note: Output from "update_sf"

STM32MP> run update_sf
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
      scanning usb for storage devices... 1 Storage Device(s) found
123312 bytes read in 24 ms (4.9 MiB/s)
635832 bytes read in 42 ms (14.4 MiB/s)
SF: Detected w25q16dw with page size 256 Bytes, erase size 64 KiB, total 2 MiB
SF: 2097152 bytes @ 0x0 Erased: OK
device 0 offset 0x0, size 0x1e1b0
123312 bytes written, 0 bytes skipped in 2.597s, speed 48584 B/s
device 0 offset 0x40000, size 0x1e1b0
123312 bytes written, 0 bytes skipped in 2.641s, speed 47775 B/s
device 0 offset 0x80000, size 0x9b3b8
635832 bytes written, 0 bytes skipped in 13.123s, speed 49607 B/s
STM32MP>
  • Restart the board -> New U-Boot will start up and will load the flashed dh-image-demo

Get the U-Boot binaries