wiki:ventana/serial_downloader

Ventana i.MX6 Serial Downloader

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

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 misprogrammed, 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 power the Ventana board on while holding the pushbutton.

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.

Note that in order to use this, you will need a proper IMX6 boot image that contains a DCD table. Refer to the IMX6 Technical Reference Manuals for more details.

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

  1. Connect LINUX PC Host USB to microB OTG connector on Ventana Board
  2. Hold down small pushbutton on Ventana Board
  3. Apply board power then release pushbutton
  4. 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.
    
  5. 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

</p> <ul><li>Note you may need to run as root if you don't have permissions for the USB device </li></ul><p> Example of proper output: </p> <pre class="wiki">$ imx_usb image.imx No "_" environment variable argc == 2, argv == 0x7fffecc4f048 base == 0x608220:./imx_usb trailing slash == 0x608221:/imx_usb conf_path == ./ config file &lt;./imx_usb.conf&gt; No "_" environment variable argc == 2, argv == 0x7fffecc4f048 base == 0x608220:./imx_usb trailing slash == 0x608221:/imx_usb conf_path == ./ config file &lt;./mx6_usb_work.conf&gt; parse mx6_usb_work.conf 15a2:0061(mx6_qsb) bConfigurationValue =1 Interface 0 claimed report 1, wrote 16 bytes, err=0 report 3, read 4 bytes, err=0 read=56 78 78 56 ../u-boot_gw53xx.imx 0 0 1 0 1 2 main dcd length 310 sub dcd length 30c dcd_ptr=0x177ff42c

loading binary file(image.imx) to 177ff400, skip=0, fsize=80c00 type=aa

&lt;&lt;&lt;527360, 527360 bytes&gt;&gt;&gt; jumping to 0x177ff400 </pre }}}

Last modified 4 weeks ago Last modified on 10/22/2017 05:28:45 AM