Loading...
 

Bootloader recovery via UART

Table of contents

This page shows how to recover your ESPRESSObin board using UART, both for Linux and for Windows. The UART recovery method is used to recover a bricked board without the need to remove the on-board SPI flash.

UART images (version U-Boot 2017.03-armada-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 DDR flash configuration (DDR3 or DDR4) and the DDR memory size (512MB, 1GB or 2GB) of your ESPRESSObin board.

UART boot mode


ESPRESSObin supports booting from various devices by manually relocating onboard wire jumpers J10, J3 and J11. Note that the placement of wire jumpers and how they are arranged to enable various boot options varies between ESPRESSObin hardware revisions. To see how to set ESPRESSObin boot mode to UART, visit Ports and Interfaces.

Linux


To transfer UART images to the ESPRESSObin board we will use the WtpDownload_linux tool . The tool is available in the Marvell's A3700-utils repository.

If you have built the bootloader images manually following Build from source - Bootloader page, you should already have cloned the repository.

If using pre-built images, clone the repository:

$ mkdir a3700-utils && cd a3700-utils
$ git clone -b A3700_utils-armada-17.10 https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git .

Connect via serial cable to your ESPRESSObin board and power on the board. Use dmesg to find out and make a note of the port number of the ESPRESSObin (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 on your build machine and navigate to where you have built or downloaded UART images. The command below will start the UART download process. Make sure to run the command as root with sudo and to adjust the path for the WtpDownload_linux tool and the UART images according to your setup. Also check that the port number (defined with the -C argument) is set to the correct port number as shown above (0 in our example):

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

After the SPI bootloader image has been written, make sure to switch the onboard jumpers back to SPI boot as shown in Ports and Interfaces

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.

Now set the onboard jumpers to boot from UART as shown in Ports and Interfaces.

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.

After the SPI bootloader image has been written, make sure to switch the onboard jumpers back to SPI boot as shown in Ports and Interfaces.