Ventana i.MX6 Serial Downloader
The i.MX6 has an internal boot ROM that handles the first boot stage in order to be able to boot from a variety of devices (uSD, NAND, NOR, SPI, SATA, etc). One of the boot devices, referred to as the 'serial downloader' provides an API over USB OTG. Therefore an application can reside on a host PC that will can control the boot of the i.MX6 as long as you can get the i.MX6 to boot in this mode referred to as 'BOOT_MODE0'. During the internal ROM's boot, a watchdog is used such that a corrupt or non-existent boot media will result in using this serial downloader. This may be useful if you are working with a board that has an unprogrammed or misprogrammed FLASH device.
Note that this is not useful when using the 2-stage SPL bootloader. While you can use the serial downloader to boot the SPL, you will not end up with a fully functional bootloader as the SPL will be trying to load u-boot.img from NAND which if not programmed leaves you hanging. If you are looking for a method to 'unbrick' a board that has been mis-programmed, use JTAG programming instead.
There are a couple of applications that can be used with the i.MX6 Serial Downloader:
- Freescale Manufacturing Mode Application - very full featured
- Boundary Devices stand-alone imx_usb_loader - minimal features, allows booting an image over serial USB
To force booting via Serial Downloader you can erase the flash so that the boot watchdog switches to serial downloader mode.
If the boot ROM is in serial downloader mode you will see a USB device with the vendor ID of 0x15a2 (The device id varies per IMX6 SoC) show up on a host PC connected to the Ventana USB OTG port.
imx_usb_loader Instructions
Below are instructions for fetching/building a loader application that will run on a Linux PC to load and execute the bootloader via the serial download protocol:
First, download the bootloader code and build it:
git clone https://github.com/boundarydevices/imx_usb_loader
cd imx_usb_loader/
make
- Note: requires libusb (sudo aptitude install libusb-1.0-0-dev)
Now to use it on an IMX6 board connected to your Linux PC over USB
- Connect LINUX PC Host USB to microB OTG connector on Ventana Board
- Check your Linux PC Command Line and type
lsusb
- You will see a Freescale device show up in lsusb on desktop PC showing that the Ventana Board is connected to the PC (example shown)$ lsusb Bus 003 Device 062: ID 15a2:0054 Freescale Semiconductor, Inc.
- if you fail to see this you are not in serial downloader mode
- execute the imx_usb_loader with the argument of the IMX6 bootable image:
cd imx_usb_loader ;# must be in the directory with its config files imx_usb image.imx ;# boot image
- Note you may need to run as root if you don't have permissions for the USB device