BootStrap

If you think you bricked your board by flashing a bad bootloader, don't worry: there is a solution to recover it, without a JTAG probe. Indeed i.MX processors have an internal "bootstrap" mode that allow them to communicate through RS-232 or USB just after a reset.

Introduction

The uboot_recover tool is a Python piece of code that allows you to automatically install a new U-Boot from scratch or to recover it in case of failure. uboot_recover requires the python and pyserial packages to be installed on your PC:

$ sudo apt-get install python-serial python-usb

This utility communicates with the i.MX(L/27/28/51/6/6UL) processor while in bootstrap mode (See i.MX(L/27/28/51/6/6UL) Reference Manual for more informations).

To enter the bootstrap mode, you have to put the bootstrap jumper and reset your Armadeus board:

APF27 Bootstrap Tool
/!\ Do not forget to put the bootstrap jumper and to reset your board /!\
(be sure to have a file named apf27-u-boot-nand.bin in current dir too)
/!\ U-Boot recover eat lot of CPU, be sure that no process trust your CPU
Enter serial port number or name to use (/dev/ttySx under Linux and COMx under Windows):

--- APF6 Bootstrap Tool ---
Procedure to follow:
1] Be sure to:
* have built the APF6 BSP (make apf6_defconfig; make),
* have "sb" tool installed (On Ubuntu: sudo apt-get install lrzsz),
* have launched this script as root (sudo).
2] Power off your board, close all serial terminal sessions, remove all USB cables
3] Take jumper off BOOT0 pin and put it on BOOT1 pin.
4] Power on your board
5] Connect a USB cable from your PC to the APF6Dev OTG miniUSB connector
6] Connect a USB cable from your PC to the APF6Dev console miniUSB connector
--- Enter serial port number or device name to use for console (/dev/ttyUSB0 under Linux (default) or COMx under Window$):

--- OPOS6UL Bootstrap Tool ---
Procedure to follow:
1] Be sure to:
* have built the OPOS6UL BSP (make opos6ul_defconfig; make),
* have "sb" tool installed on your PC (on Ubuntu: sudo apt-get install lrzsz),
* have launched this script as root (sudo).
2] Power off your board, close all serial terminal sessions, remove all USB cables
3] Take jumper off BOOT1 pins and put it on BOOT0 pins.
4] Power on your board
5] Connect a USB cable from your PC to the OPOS6ULDev OTG miniUSB connector
6] Connect a USB cable from your PC to the OPOS6ULDev console/debug miniUSB connector
--- Then, enter serial port number or device name to use for console (/dev/ttyUSB0 under Linux (default) or COMx under Window$):

After having entered the tools parameters and pressed ENTER, the following messages are displayed:

--- U-Boot successfully recovered !
--- Now you can remove the miniUSB OTG cable and put the jumper back on BOOT0 pin. Your board will boot... As the restored U-Boot version may differ from the one your were using, if you want to maximize the chances to keep your rootfs data safe, we strongly advise you to reflash the same U-Boot version your were using before the recovery. Otherwise (you don't care about your data), please upgrade to the latest available stable Armadeus U-Boot release.

At the end, you can specify whether the environment variables (IP, your special scripts...) have to be erased or not. If your board does not start anymore after a first uboot_recover, please respond 'y'.

Note: If all went fine, don't forget to remove the bootstrap jumper if you want to restart the board in its normal boot state