Changes between Version 1 and Version 2 of ventana/serial_downloader


Ignore:
Timestamp:
04/24/2018 07:06:50 PM (6 years ago)
Author:
Tim Harvey
Comment:

restore page from backup

Legend:

Unmodified
Added
Removed
Modified
  • ventana/serial_downloader

    v1 v2  
    1 {{{#!html
    2           <div id="wikipage" class="trac-content"><p>
    3 </p><div class="wiki-toc">
    4 <ol>
    5   <li>
    6     <a href="#Ventanai.MX6SerialDownloader">Ventana i.MX6 Serial Downloader</a>
    7     <ol>
    8       <li>
    9         <a href="#i.MX6SerialDownloader">i.MX6 Serial Downloader</a>
    10         <ol>
    11           <li>
    12             <a href="#imx_usb_loaderInstructions">imx_usb_loader Instructions</a>
    13           </li>
    14         </ol>
    15       </li>
    16     </ol>
    17   </li>
    18 </ol>
    19 </div><p>
    20 </p>
    21 <h1 id="Ventanai.MX6SerialDownloader">Ventana i.MX6 Serial Downloader</h1>
    22 <h2 id="i.MX6SerialDownloader">i.MX6 Serial Downloader</h2>
    23 <p>
    24 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
    25 </p>
    26 <p>
    27 <strong>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.</strong> If you are looking for a method to 'unbrick' a board that has been misprogrammed, use <a class="wiki" href="/wiki/jtag_instructions">JTAG programming</a> instead.
    28 </p>
    29 <p>
     1[[PageOutline]]
     2
     3= Ventana i.MX6 Serial Downloader
     4The 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.
     5
     6Note 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.
     7
    308There are a couple of applications that can be used with the i.MX6 Serial Downloader:
    31 </p>
    32 <ul><li>Freescale Manufacturing Mode Application - very full featured
    33 </li><li>Boundary Devices stand-alone imx_usb_loader - minimal features, allows booting an image over serial USB
    34 </li></ul><p>
    35 To force booting via Serial Downloader you can power the Ventana board on <strong>while holding the pushbutton</strong>.
    36 </p>
    37 <p>
     9 * Freescale Manufacturing Mode Application - very full featured
     10 * Boundary Devices stand-alone imx_usb_loader - minimal features, allows booting an image over serial USB
     11
     12To force booting via Serial Downloader you can erase the flash so that the boot watchdog switches to serial downloader mode.
     13
    3814If 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.
    39 </p>
    40 <p>
    41 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.
    42 </p>
    43 <h3 id="imx_usb_loaderInstructions">imx_usb_loader Instructions</h3>
    44 <p>
    45 Below are instructions for fetching/building a loader application that will run on a<strong> Linux PC</strong> to load and execute the bootloader via the serial download protocol:
    46 </p>
    47 <p>
     15
     16== imx_usb_loader Instructions
     17Below 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:
     18
    4819First, download the bootloader code and build it:
    49 </p>
    50 <pre class="wiki">git clone https://github.com/boundarydevices/imx_usb_loader
     20{{{#!bash
     21git clone https://github.com/boundarydevices/imx_usb_loader
    5122cd imx_usb_loader/
    5223make
    53 </pre><ul><li>Note: requires libusb (sudo aptitude install libusb-1.0-0-dev)
    54 </li></ul><p>
     24}}}
     25 * Note: requires libusb (sudo aptitude install libusb-1.0-0-dev)
     26
    5527Now to use it on an IMX6 board connected to your Linux PC over USB
    56 </p>
    57 <ol><li>Connect <strong>LINUX PC</strong> Host USB to microB OTG connector on Ventana Board
    58 </li><li>Hold down small pushbutton on Ventana Board
    59 </li><li>Apply board power then release pushbutton
    60 </li><li>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)
    61 <pre class="wiki">$ lsusb
     28 1. Connect LINUX PC Host USB to microB OTG connector on Ventana Board
     29 1. 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)
     30{{{#!bash
     31$ lsusb
    6232Bus 003 Device 062: ID 15a2:0054 Freescale Semiconductor, Inc.
    63 </pre></li><li>execute the imx_usb_loader with the argument of the IMX6 bootable image: {{{
    64 </li></ol><p>
    65 cd imx_usb_loader  ;# must be in the directory with its config files
    66 imx_usb image.imx ;# boot image
    6733}}}
    68 </p>
    69 <ul><li>Note you may need to run as root if you don't have permissions for the USB device
    70 </li></ul><p>
    71 Example of proper output:
    72 </p>
    73 <pre class="wiki">$ imx_usb image.imx
    74 No "_" environment variable
    75 argc == 2, argv == 0x7fffecc4f048
    76 base == 0x608220:./imx_usb
    77 trailing slash == 0x608221:/imx_usb
    78 conf_path == ./
    79 config file &lt;./imx_usb.conf&gt;
    80 No "_" environment variable
    81 argc == 2, argv == 0x7fffecc4f048
    82 base == 0x608220:./imx_usb
    83 trailing slash == 0x608221:/imx_usb
    84 conf_path == ./
    85 config file &lt;./mx6_usb_work.conf&gt;
    86 parse mx6_usb_work.conf
    87 15a2:0061(mx6_qsb) bConfigurationValue =1
    88 Interface 0 claimed
    89 report 1, wrote 16 bytes, err=0
    90 report 3, read 4 bytes, err=0
    91 read=56 78 78 56
    92 ../u-boot_gw53xx.imx 0 0 1 0 1 2
    93 main dcd length 310
    94 sub dcd length 30c
    95 dcd_ptr=0x177ff42c
    96 
    97 loading binary file(image.imx) to 177ff400, skip=0, fsize=80c00 type=aa
    98 
    99 &lt;&lt;&lt;527360, 527360 bytes&gt;&gt;&gt;
    100 jumping to 0x177ff400
    101 </pre
     34  * if you fail to see this you are not in serial downloader mode
     35 1. execute the imx_usb_loader with the argument of the IMX6 bootable image:
     36{{{#!bash
     37cd imx_usb_loader ;# must be in the directory with its config files imx_usb image.imx ;# boot image
    10238}}}
     39 * Note you may need to run as root if you don't have permissions for the USB device