Loading...
 

Bootloader recovery via UART

Table of contents

This tutorial will show you how to recover your ESPRESSObin board using UART, both for Linux and for Windows. This method is highly useful in recovering a bricked board without the need to remove the on-board SPI flash.

UART images (U-Boot version 17.10) can be either:

  • Built manually using instructions in Build from source - Bootloader. UART images built this way will be located in /path-to-atf/build/a3700/debug/uart-images/ directory.
  • Downloaded from our Tech Spec page under Bootloader - UART images.

 

 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).

 

UART boot mode


ESPRESSObin supports booting from various devices by manually relocating on-board wire jumpers J10, J3 and J11. These jumpers are located next to the SATA data cable, as can be seen below:

ESPRESSObin Jumpers

whereas their representations can be seen in the picture below:

ESPRESSObin Jumpers Closeup

To set ESPRESSObin boot mode to UART, arrange the jumpers in the following manner:

J10J3J11
2-31-21-2


Other boot options and their respective jumper arrangement can be found in the official Globalscale's ESPRESSObin Quick Start Guide.

Linux


If using Linux, we will utilize the WtpDownload_linux tool to transfer the UART images to the board. The tool is available in the Marvell's A3700-utils repository which we cloned in Build from source - Bootloader.

If using prebuilt images, clone the repository:

ebin@buildserver:~$ mkdir a3700-utils
ebin@buildserver:~$ cd a3700-utils
ebin@buildserver:~/a3700-utils$ git clone -b A3700_utils-armada-17.06 https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git .


Connect via serial cable to your ESPRESSObin and power on the board. Use dmesg to find out and make a note under which port number the ESPRESSObin is listed (e.g. if it is listed as /dev/ttyUSB1 the port number is 1).

You should see the ">" prompt presented on the connected terminal. Pressing "Enter" in this mode shows "E" and then ">" again. In this terminal, type wtp to switch the BootROM to WTP download mode:

>wtp


Open another terminal window and there navigate to where you have built or downloaded necessary UART images. The command below will start the UART download process. Make sure to run it as sudo, to adjust the paths to the WtpDownload_linux tool and UART images according to your setup, and to set the correct port number (-C ):

ebin@buildserver:~$ sudo ./path-to-a3700-utils/wtptp/linux/WtpDownload_linux -P UART -C 0 -R 115200 -B /path/to/TIM_ATF.bin -I /path/to/wtmi_h.bin -I /path/to/boot-image_h.bin -E


Example output:

Start time: 06/06/18 16:28:36
WtpDownload for 32-bit Host (Target Images Downloading Tool)

Trusted version for TIM and NTIM
Version:      3.3.11.15
Release Date: 04.May.2017

Verbose mode disabled...

/dev/ttyUSB0
+++
Image ID: TIMH (0x54494d48)
Image ID: WTMI (0x57544d49)
Image ID: OBMI (0x4f424d49)

Number of files to download: 3
+++
Version: 3401
Date: 5152016
Processor: ARMA
+++++++++++++++++++++

Download time for image 1->0hr:0min:0s
Success: Download file complete for image 1
++
Version: 3401
Date: 5152016
Processor: ARMA
++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++

Download time for image 2->0hr:0min:1s
Success: Download file complete for image 2
++
Version: 3401
Date: 5152016
Processor: ARMA
++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++
[...]

Download time for image 3->0hr:1min:9s
Success: Download file complete for image 3
++
Finish time: 01/00/00 00:00:00


WtpDownload Complete! Device:

Success: WtpDownload Exiting with Success Code!


The serial connection to the ESPRESSObin console should have been terminated due to the download process. Now connect to the board again and you should see the new bootloader loaded. Now you can recover the SPI bootloader using a working SPI image, the bubt command and any of the methods covered in Update the Bootloader - new.

After the SPI bootloader image has been written, make sure to switch the onboard jumpers back to SPI boot:

J10J3J11
1-22-32-3

 

Windows


To access the ESPRESSObin UART recovery option for Windows you will need the following tools:

  • Marvell's WTPTP tools
  • HyperTerminal

Firstly, download the WTPTP tools from extranet and extract the directory to your local machine.

Secondly, as was shown above - set the onboard jumpers to boot from UART.

Next, we must identify the UART port number of the device. We do this by plugging the USB cable, going to Device Manager -> Ports (COM & LPT) and noting the number next to the COM port.

Now open a HyperTerminal window and select the previously identified COM port. You should see the ">" prompt presented on the HyperTerminal screen. Pressing "Enter" in this mode shows "E" and then ">" again. In this terminal, type wtp to switch the BootROM to WTP download mode.

Now we must open a command prompt window and run our download tool by inserting the following command (adjust the paths to the WtpDownload tool and UART images as well as set the correct COM number):

>> WtpDownload.exe -P UART -C 38 -R 115200 -B path\to\TIM_ATF.bin -I path\to\wtmi_h.bin -I path\to\boot-image_h.bin -E


Example output:

Wtp 11

After the download is complete, go back to the HyperTerminal window and you should see the new bootloader loaded:

Hyperterminal 14

Now you can recover the SPI bootloader using a working SPI image, the bubt command and any of the methods covered in Update the Bootloader - new.

After the SPI bootloader image has been written, make sure to switch the onboard jumpers back to SPI boot:

J10J3J11
1-22-32-3