This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] How to boot SK-AM62B/SK-AM62A via Ethernet and flash U-boot and Linux binaries into eMMC via Ethernet ?

Other Parts Discussed in Thread: SK-AM62B

How do I boot an SK-AM62B or SK-AM62A using Ethernet and subsequently flash the required U-boot binaries and Kernel, DTB, and root filesystem to eMMC?


The solution is divided into two sections:

1) This section describes how to boot into U-boot, via Ethernet boot mode.

2) This section describes how to flash required U-boot binaries and filesystem into eMMC, and completely boot Linux from EMMC, using Ethernet to flash images.




  • How to boot SK-AM62B/SK-AM62A into U-boot using Ethernet as primary boot mode?

    ***IMPORTANT NOTES ***

    SK-AM62B: Booting via Ethernet is not recommended for production purposes and should only really be used for development. The reason is because of Errata i2329 which mentions that there is no workaround to guarantee the primary Ethernet boot mode is successful.

    SK-AM62A: On SDK v9.1, booting via Ethernet is not supported out-of-the-box despite what is indicated by the SDK documentation. There is a patch that could be applied in order to get booting via Ethernet working which can find in this E2E thread: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1307981/sk-am62a-lp-rgmii-boot-mode-problem/4968147#4968147 

    1. Build the u-boot binaries (tiboot3.bin, tispl.bin, u-boot.img) with the ethboot defconfig

    Follow the steps indicated in https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/latest/exports/docs/linux/Foundational_Components/U-Boot/UG-Network-K3.html?highlight=am62x_evm_r5_ethboot_defconfig#booting-over-ethernet-ethernet-rgmii 

    Make sure to build with "am62x_evm_r5_ethboot_defconfig" instead of the default "am62x_evm_r5_defconfig". You can change this by going into "Rules.make" in the top-level directory of your SDK installation and changing "UBOOT_MACHINE_R5=am62x_evm_r5_defconfig".

    Afterwards, to build the u-boot binaries just enter "make u-boot" in the top-level directory of your SDK installation. Details on how to build u-boot binaries can also be found at our Linux Academy

    Key Notes:

    • You may find the following error message when you attempt to build the u-boot binaries. If you see this, you can try adding "CONFIG_SYSCON=y" and "CONFIG_SPL_SYSCON=y" to the ethboot defconfig. 
      • /home/a0500327/Documents/ti-processor-sdk-linux-rt-am62xx-evm-09.01.00.08/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-ld.bfd: drivers/net/ti/am65-cpsw-nuss.o: in function `am65_cpsw_am654_get_efuse_macid':
        /home/a0500327/Documents/ti-processor-sdk-linux-rt-am62xx-evm-09.01.00.08/board-support/ti-u-boot-2023.04+gitAUTOINC+b0d717b732-gb0d717b732/drivers/net/ti/am65-cpsw-nuss.c:550: undefined reference to `syscon_regmap_lookup_by_phandle'
        make[3]: *** [/home/a0500327/Documents/ti-processor-sdk-linux-rt-am62xx-evm-09.01.00.08/board-support/ti-u-boot-2023.04+gitAUTOINC+b0d717b732-gb0d717b732/scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
        make[2]: *** [/home/a0500327/Documents/ti-processor-sdk-linux-rt-am62xx-evm-09.01.00.08/board-support/ti-u-boot-2023.04+gitAUTOINC+b0d717b732-gb0d717b732/Makefile:2043: spl/u-boot-spl] Error 2
        make[2]: Leaving directory '/home/a0500327/Documents/ti-processor-sdk-linux-rt-am62xx-evm-09.01.00.08/board-support/u-boot-build/r5'
        make[1]: *** [Makefile:177: sub-make] Error 2
        make[1]: Leaving directory '/home/a0500327/Documents/ti-processor-sdk-linux-rt-am62xx-evm-09.01.00.08/board-support/ti-u-boot-2023.04+gitAUTOINC+b0d717b732-gb0d717b732'
        make: *** [makerules/Makefile_u-boot:28: u-boot-r5] Error 2
    • You may find the following error when attempting to boot into U-boot after setting up the BOOTP/DHCP server and TFTP server on your host PC and configuring the board to Ethernet as primary boot mode. If you see this, you may need to use the patches provided at this site in order to rebuilt your u-boot binaries for boot via Ethernet to work. These patches have not yet been upstreamed as of SDK release 9.1.
      • U-Boot SPL 2023.04-dirty (Jan 30 2024 - 14:21:23 -0600)
        SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
        alloc space exhausted
        am65_cpsw_nuss ethernet@8000000: Failed to bind to port@1 node
        Failed to probe am65_cpsw_nuss driver
        SPL initial stack usage: 13384 bytes
        Trying to boot from eth device
        Loading Environment from nowhere... OK
        No ethernet found.
        No Ethernet devices found
        SPL: failed to boot from all boot devices
        ### ERROR ### Please RESET the board ### 

    2. Change bootswitches to Ethernet as primary bootmode and UART as secondary bootmode.

    Make sure to use only RGMII1 (eth0), port closest to the USB Type-A socket. 

    Primary Bootmode = Ethernet

    Secondary Bootmode = UART

    SW1 [0-7] (right switch in the picture below) = 11000100

    SW2 [8-15] = 00110000

    3. Set up TFTP server and DHCP server on your host PC

    Setup the tftp server by following the steps in https://help.ubuntu.com/community/TFTP or https://www.addictivetips.com/ubuntu-linux-tips/set-up-a-tftp-server-on-ubuntu-server/ 

    Check the status of the of the tftp server by running "sudo service tftpd-hpa status" or "sudo systemctl status xinetd.service" and make sure it is active.

    Add the u-boot binaries that you built in step 1 to the /tftpboot directory you created by following the steps to set up tftp server.

    Set up the dhcp server by following the steps in https://help.ubuntu.com/community/isc-dhcp-server

    Use the ISC dhcp example host entry in https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/latest/exports/docs/linux/Foundational_Components/U-Boot/UG-Network-K3.html?highlight=am62x_evm_r5_ethboot_defconfig#booting-over-ethernet-ethernet-rgmii to add to your /etc/dhcp/dhcpd.conf file. Make sure to change the range of IP addresses to the IP addresses in your network.

    Troubleshooting tips:

    • Check using Wireshark on host PC ethernet interface connected to the board and expect to see the following for establishment of BOOTP request and reply and the TFTP read request, data packets and acknowledgements.
    • If the following is seen instead where it stalls at TFTP read request, it might be blocked by a firewall. If so, try running "sudo ufw allow <port number used in tftpserver setup>/udp" and rerun dhcp and tftp server
      • Ex: "sudo ufw allow 69/udp"

    4. Load the u-boot binaries via tftp and boot into U-boot environment

    Power cycle the board and you should see something like the following

  • How to flash to eMMC via Ethernet on SK-AM62B/ SK-AM62A

    1. Create an uEnv.txt for flashing to eMMC

    The commands for flashing in U-boot can be automated upon booting into U-boot environment.

    The main instructions for "flash via Ethernet" can be found in https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/latest/exports/docs/linux/Foundational_Components/Tools/Flash_via_Ethernet.html. However, as of SDK release v9.1, the uEnv.txt provided in  <TI_SDK_PATH>/bin/Ethernet_flash/am62xx-evm/ needs some modifications in order to work. Please refer to the solution in https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1324308/sk-am62b-p1-issue-with-ethernet-booting---need-assistance for the required modifications.

    Make sure to put your uEnv.txt into the /tftpboot directory of your host PC so that it can also be loaded via TFTP

    Key Note:

    • When changing to eMMC boot mode in step 5, you will not be able to boot into Linux using the U-boot binaries built from ethboot defconfig. In order to boot into Linux in step 5, after booting into U-boot environment using ethernet boot mode, you must change the u-boot binaries that get loaded via the commands in uEnv.txt to the pre-built u-boot binaries. The pre-built u-boot binaries can be found in <TISDK>/board-support/prebuilt-images/am62xx-evm/.
    • This is a bit of a hassle, so overall we do not recommend booting via Ethernet boot mode. It is much easier and more reliable to boot from SD card and load the binaries from there.

    2. Convert the target .tar.xz image to an .ext4 image format and place this image into the /tftpboot directory of your host PC

    The general steps are as follows

    $ cd <path-ti-psdk>/filesystem
    $ dd if=/dev/null of=tisdk-base.ext4 bs=1M seek=300
    $ mkfs.ext4 -F rootfs.ext4
    $ mkdir mnt_fs
    $ sudo mount -t ext4 rootfs.ext4 mnt_fs
    $ cd mnt_fs
    $ sudo tar xvf ../<target image name>.tar.xz
    $ cd ..
    $ sudo umount mnt_fs

    Key Notes:

    • Flashing via ethernet first loads the .ext4 image into DDR which limits the size of the file to the DDR size (~2GB). If the .ext4 image is larger than DDR size, flashing via ethernet will not work. Keep in mind that the default TISDK image is around 5GB so flashing the default image provided on the product page is not possible.
    • You may also find the following error message if the default loadaddr of 0x82000000 is at a location that does not provide large enough continuous memory to contain the size of the .ext4 image. 
    • You can use "bdinfo" in the U-boot command line to see reserved memory locations and look for an address that will provide enough continuous memory
    • You can change the loadaddr by "setenv loadaddr <new address>" or adding "loadaddr=<new address>" to your uEnv.txt
    • TFTP error: trying to overwrite reserved memory...
      am65_cpsw_nuss_port ethernet@8000000port@1: RX dma free_pkt failed -22
      => 
    • In the picture above, if the default loadaddr of 0x82000000 is used, there is only continuous memory form 0x82000000 to 0x9ca00000 available. This is about 446 Mb of free space. 

    3. Once all u-boot binaries and your .ext4 file gets flashed to eMMC, you should check if the filesystem got written to the correct partition.

    Run "ls mmc 0:1" and you should see something similar to below.

             ##############################################  0 Bytes
             1.6 MiB/s
    done
    Bytes transferred = 943718400 (38400000 hex)
    => mmc write ${loadaddr} 0x22 0x1c2000
    
    MMC write: dev # 0, block # 34, count 1843200 ... 1843200 blocks written: OK
    => ls mmc 0:1
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <DIR>       4096 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <DIR>       4096 lib
    <SYM>         19 linuxrc
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <DIR>       4096 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var

    Key notes:

    4. To boot into Linux, run the following commands in the U-boot command line

    => setenv mmcdev 0
    => setenv bootpart 0:1
    => run distro_bootcmd

    "run distro_bootcmd" is required instead of "boot" because the u-boot binaries were built with ethboot defconfig rather than the default pre-built u-boot binaries.

    The default u-boot build does not contain "saveenv" to save these environment variables, so every time you boot the board, you must stop in U-boot environment and run these commands. If you want to enable "saveenv", you can find details on the solution to this thread: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1324442/am625-change-saveenv-mmc-location/5040438#5040438 

    5. Verify that you can boot into Linux via eMMC boot mode.

    Make sure to run the following commands to give ROM access to the eMMC boot partition (this only needs to be done once) before changing the boot switches to eMMC boot mode

    => mmc partconf 0 1 1 1
    => mmc bootbus 0 2 0 0

    Change the boot switches to eMMC boot mode using the configuration found on our Linux Academy

    Power cycle the board and you will automatically boot into Linux.