USB/DFU

Overview

AM62Ax USB peripheral boot (also called device boot) mode receives a second bootloader image from a USB host using the Device Firmware Update (DFU) specification defined by USB-DFU.

This section demonstrates how to use DFU to boot phyCORE-AM62Ax to a U-Boot prompt using a Linux Ubuntu PC.

Requirements

Hardware

  • Ubuntu 22.04 LTS, 64-bit Host Machine

    • If using a virtual machine, VMWare Workstation, VMWare Player, and VirtualBox are all viable solutions.

  • USB-C to USB-A cable

phyBOARD-AM62Ax boot switches

Software

Prepare the following U-Boot images by building the BSP (Build the BSP) or downloading the pre-built (Pre-Built Binaries) image files. These images will be used for downloading to and booting on the phyCORE-AM62Ax via DFU:

* tiboot3.bin-perif
* tispl.bin
* u-boot.img

Note

tiboot3.bin-perif is built along side tiboot3.bin and is used for periferal boots on the phyCORE-AM62Ax.

Install & Configure Snagboot

  • Install python3, pip, and swig:

    host:~$ sudo apt update && sudo apt install python3 python3-pip python3-venv swig
    
  • Now we can create and source our python virtual environment in the same folder that we have our U-Boot images.

    host:~$ python3 -m venv myenv
    host:~$ source myenv/bin/activate
    
  • Install snagboot in our venv using pip

    host:~$ pip install snagboot
    
  • Export the PHYTEC template

    host:~$ snagrecover -t am62x-phyboard-lyra > am62x-phyboard-lyra.yaml
    

We can cat the template to verify it is exported correctly:

host:~$ cat am62x-phyboard-lyra.yaml

tiboot3:
  path: tiboot3.bin-perif
tispl:
  path: tispl.bin
u-boot:
  path: u-boot.img
  • Add udev rules to allow snagrecover to access our USB devices:

    host:~$ snagrecover --udev > 50-snagboot.rules
    host:~$ sudo cp 50-snagboot.rules /etc/udev/rules.d/
    host:~$ sudo udevadm control --reload-rules
    host:~$ sudo udevadm trigger
    

Note

If we run ls our folder should include at least the following files to begin recovery:

host:~$ ls

am62x-phyboard-lyra.yaml
myenv
tiboot3.bin-perif
tispl.bin
u-boot.img

Booting from USB/DFU

Here are the basic steps for booting from USB/DFU on the phyCORE-AM62Ax development kit. The steps for establishing a serial communication are outlined in the Quickstart.

Note

Two terminals should be open on your host Linux machine.
  • One for running commands via USB-C

  • One for Serial communication to see the SOMs boot status.

Boot Switch Settings

SD Boot Switch phyBOARD-AM62Ax boot switches
  • Plug a USB-C cable from the phyCORE-AM62Ax development kit into your Ubuntu machine.

  • Adjust boot switch settings on the phyCORE-AM62Ax development kit.

  • Power on the phyCORE-AM62Ax development kit.

You should see the kit appear on your Ubuntu machine via the USB-C. To verify this, run the following:

host:~$ lsusb | grep 0451:6165

Bus 005 Device 060: ID 0451:6165 Texas Instruments, Inc. AM62x DFU

We can now begin our recovery by running snagrecover on our Ubuntu machine in our USB-C terminal.

host:~$ snagrecover -s am625 -f am62x-phyboard-lyra.yaml

Starting recovery of am625 board
Installing firmware tiboot3
Searching for partition id...
Downloading file...
Could not read status after end of manifest phase
Done
Done installing firmware tiboot3
Installing firmware u-boot
Searching for partition id...
Downloading file...
Done
Done installing firmware u-boot
Installing firmware tispl
Searching for partition id...
Downloading file...
Done
Sending detach command...
Done installing firmware tispl
Done recovering am625 board

We should see the following response on our serial terminal:

Target (Serial)
U-Boot SPL 2023.04-ti-g59f060e92e96 (Mar 14 2024 - 22:53:08 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.1--v09.02.01 (Kool Koala)')
am62a_init: board_init_f done
SPL initial stack usage: 17088 bytes
am62a_init: spl_boot_device: devstat = 0x453 bootmedia = 0xa bootindex = 1
Trying to boot from DFU
#################################################DOWNLOAD ... OK
Ctrl+C to exit ...
###############################################DOWNLOAD ... OK
Ctrl+C to exit ...
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Loading Environment from nowhere... OK
am62a_init: spl_boot_device: devstat = 0x453 bootmedia = 0xa bootindex = 1
am62a_init: spl_boot_device: devstat = 0x453 bootmedia = 0xa bootindex = 1
init_env from device 10 not supported!
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
NOTICE:  BL31: Built : 16:09:05, Feb  9 2024

U-Boot SPL 2023.04-ti-g59f060e92e96 (Mar 14 2024 - 22:53:08 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.1--v09.02.01 (Kool Koala)')
am62a_init: board_init_f done
am62a_init: spl_boot_device: devstat = 0x453 bootmedia = 0xa bootindex = 1
Trying to boot from DFU
####DOWNLOAD ... OK
Ctrl+C to exit ...
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted


U-Boot 2023.04-ti-g59f060e92e96 (Mar 14 2024 - 22:53:08 +0000)

SoC:   AM62AX SR1.0 GP
Model: PHYTEC phyBOARD-Lyra AM62A7
DRAM:  2 GiB
Core:  65 devices, 30 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
phytec_eeprom_data_init: EEPROM data is all zero. Erased?
phytec_eeprom_data_setup: EEPROM data init failed
Net:   Could not get PHY for ethernet@8000000port@1: addr 1
am65_cpsw_nuss_port ethernet@8000000port@1: phy_connect() failed
No ethernet found.

Hit any key to stop autoboot:  0
=>

We should see U-Boot start up and attempt to boot from the SD-Card. We can stop in U-Boot by pressing any key at this point.

Boot Switch Settings

  • S7 should be ON to overide default boot settings.

SD Boot Switch phyBOARD-AM62Ax boot switches