Loading...
 

Update the Bootloader

 Warning

Following the steps in this page to update the bootloader image can potentially brick the ESPRESSObin board, especially if you have modified the bootloader source code by your own, or the ESPRESSObin board experiences power loss during the update procedure. Please proceed with extra caution.


Bootloader images for 1GB and 2GB DDR flavors of ESPRESSObin can be obtained either by:

  • Building them manually from source by following the steps in Build from source - Bootloader
  • Downloading prebuilt 17.06 or 17.10 release images from Tech Spec page, Software table under Bootloader.


Once you have a version of the bootloader image available, you will want to update your ESPRESSObin board with the new version of the bootloader image.

 Warning

Whether using manually built or prebuilt images, make sure to use the image according to the size of your ESPRESSObin's DDR memory (i.e. users with 1GB DDR ESPRESSObin must use the bootloader image supporting 1GB DDR memory).


We will cover two methods of updating the bootloader:

  • Using TFTP server
  • Using USB stick or SD card

 

TFTP server

 
This section will show you how to setup a TFTP server on your local Linux machine and use it to transfer the bootloader image. Trivial File Transfer Protocol (TFTP) is a simple File Transfer Protocol for transferring files onto a remote host. The protocol is primarily used in the early stages of nodes booting from a local network.

Requirements

  • Bootloader image.
  • Installed TFTP server - To setup TFTP on your Linux machine, install tftp-hpa package (the package name might differ depending on your distribution so check your distribution's official documentation).
  • Both the host (laptop) and the client (board) connected to the same IP switch or router (that is, they both must be on the same subnet).

Steps


On your local machine navigate to where you have manually built or downloaded the prebuilt bootloader image. From there start the TFTP server with:

espressobin@buildserver:~/path/to/image/$ sudo in.tftpd -L -s .


Connect an Ethernet cable to the WAN port on ESPRESSObin and the other end to your router or IP switch. Also connect to the ESPRESSObin board via serial (see section Serial Connection in Quick User Guide).

Now power on ESPRESSObin, interrupt the autoboot process and have the ESPRESSObin stay in the U-Boot command prompt. Once here, set the server (Linux machine where the TFTP server is running) and the client (ESPRESSObin board) IP addresses:

Marvell>> setenv serverip 192.168.x.x
Marvell>> setenv ipaddr 192.168.x.x


You can check if server is alive with ping:

Marvell>> ping $serverip


Once you have a working network under U-Boot, you can update the bootloader using the bubt command. Again, make sure to follow the warnings mentioned at the beginning of the tutorial.

Below is an example of flashing the U-Boot-armada-17.10 1GB DDR bootloader image using bubt (replace the image name accordingly):

Marvell>> bubt espressobin-bootloader-cpu-1000-ddr3-2cs-1g-atf-ga3306ab-uboot-gaee49fc-20180129-REL.bin
Burning U-BOOT image "espressobin-bootloader-cpu-1000-ddr3-2cs-1g-atf-ga3306ab-uboot-gaee49fc-20180129-REL.bin" from "tftp" to "spi"
Using neta@30000 device
TFTP from server 192.168.10.134; our IP address is 192.168.10.145
Filename 'espressobin-bootloader-cpu-1000-ddr3-2cs-1g-atf-ga3306ab-uboot-gaee49fc-20180129-REL.bin'.
Load address: 0x2000000
Loading: #################################################################
 #################################################################
 #################################################################
 #################################################################
 ##########################
 2.3 MiB/s
done
Bytes transferred = 4194304 (400000 hex)
Image checksum...OK!
SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
Erasing 4198400 bytes (1025 blocks) at offset 0 ...Done!
Writing 4194304 bytes from 0x2000000 to offset 0 ...Done!


After the bootloader update is done, reset or power cycle the ESPRESSObin, check the log info of the ATF and bootloader to confirm if the update is successful.
 
Steps for flashing the 2GB DDR bootloader are identical to the steps shown above, with the exception of using the bootloader image for 2GB DDR.

USB stick or SD card


Below instructions show how to prepare a bootable USB stick, however, the steps are identical to how you would go about preparing a micro SD card.

Requirements

  • Bootloader image.
  • Working USB stick or micro SD card

Steps 


On your local machine navigate to where you have manually built or downloaded the prebuilt bootloader image. Insert the USB stick and list block devices with lsblk:

user@laptop:/$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 238.5G  0 disk 
├─sda1   8:1    0  1023M  0 part /boot
├─sda2   8:2    0     5G  0 part [SWAP]
└─sda3   8:3    0 232.5G  0 part /
sdb      8:16   1   3.6G  0 disk 
└─sdb1   8:17   1   3.6G  0 part


The USB stick is listed here as /dev/sdb but it is not empty, so we will clean everything from it (replace sdb with the label of your USB stick/SD card):

user@laptop:/$ sudo dd if=/dev/zero of=/dev/sdb bs=1M count=100


Now format the USB stick as EXT4:

  • If using e2fsprogs version < 1.43, do:
user@laptop:/$ sudo mkfs.ext4 /dev/sdb
  • If using e2fsprogs version >=1.43, do:
user@laptop:/$ sudo mkfs.ext4 -O ^metadata_csum,^64bit /dev/sdb


Mount the USB stick (e.g. to /mnt/usb/) and copy the bootloader image to the newly formatted USB stick:

user@laptop:/$ sudo mount /dev/sdb /mnt/usb
user@laptop:/$ sudo cp /path/to/bootloader-image.bin /mnt/usb
user@laptop:/$ sudo umount /mnt/usb


Unmount the USB stick and plug it in the USB 3.0 port on your ESPRESSObin. In case you are using an SD card, plug it into the micro SD card slot on the ESPRESSObin.

Connect to the board via serial (see section Serial Connection in Quick User Guide). Power on ESPRESSObin, interrupt the autoboot process and have the ESPRESSObin stay in the U-Boot command prompt.

If using a USB stick, run usb start to check if the USB device is being recognized:

Marvell>> usb start
[...]
2 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found


Lastly, update the bootloader using the bubt command and passing the right parameters to it (replace flash-image.bin with your image name):

Marvell>> bubt flash-image.bin spi usb


If using micro SD card, simply replace the source in the command above from usb to mmc:

Marvell>> bubt flash-image.bin spi mmc


After the bootloader update is done, type reset or power cycle the ESPRESSObin. Check the log info of the ATF and bootloader to confirm if the update is successful.
 
Steps for flashing the 2GB DDR bootloader are identical to the steps shown above, with the exception of using the bootloader image for 2GB DDR.

bubt command


For a complete bubt command usage reference, type help bubt in U-Boot to check the parameter definitions.

Marvell>> help bubt
bubt - Burn a u-boot image to flash

Usage:
bubt [file-name] [destination [source]]
        -file-name     The image file name to burn. Default = flash-image.bin
        -destination   Flash to burn to [spi, nor, nand, mmc, spinand]. Default = active boot device
        -source        The source to load image from [tftp, usb, mmc]. Default = tftp
Examples:
        bubt - Burn u-boot.bin from tftp to active boot device
        bubt latest-spi.bin nand - Burn latest-spi.bin from tftp to NAND flash
        bubt backup-nor.bin nor usb - Burn backup-nor.bin from usb to NOR flash


Starting from the armada-17.06 release, the U-Boot version is upgraded from 2015.01 to 2017.03. In order to avoid any possible incompatibility issues, under the new U-Boot version, do env default -a to reset all the environment variables, then set up the desired variables again, and do env save to write them to the non-volatile storage.

Marvell>> env default -a
Marvell>> env save

 

Recovery


In case you have bricked your board, there are a few available recovery methods: