Changes between Initial Version and Version 1 of ventana/serial_downloader


Ignore:
Timestamp:
10/22/2017 05:28:45 AM (5 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ventana/serial_downloader

    v1 v1  
     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>
     24The 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>
     30There 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>
     35To force booting via Serial Downloader you can power the Ventana board on <strong>while holding the pushbutton</strong>.
     36</p>
     37<p>
     38If 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>
     41Note 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>
     45Below 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>
     48First, download the bootloader code and build it:
     49</p>
     50<pre class="wiki">git clone https://github.com/boundarydevices/imx_usb_loader
     51cd imx_usb_loader/
     52make
     53</pre><ul><li>Note: requires libusb (sudo aptitude install libusb-1.0-0-dev)
     54</li></ul><p>
     55Now 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
     62Bus 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>
     65cd imx_usb_loader  ;# must be in the directory with its config files
     66imx_usb image.imx ;# boot image
     67}}}
     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>
     71Example of proper output:
     72</p>
     73<pre class="wiki">$ imx_usb image.imx
     74No "_" environment variable
     75argc == 2, argv == 0x7fffecc4f048
     76base == 0x608220:./imx_usb
     77trailing slash == 0x608221:/imx_usb
     78conf_path == ./
     79config file &lt;./imx_usb.conf&gt;
     80No "_" environment variable
     81argc == 2, argv == 0x7fffecc4f048
     82base == 0x608220:./imx_usb
     83trailing slash == 0x608221:/imx_usb
     84conf_path == ./
     85config file &lt;./mx6_usb_work.conf&gt;
     86parse mx6_usb_work.conf
     8715a2:0061(mx6_qsb) bConfigurationValue =1
     88Interface 0 claimed
     89report 1, wrote 16 bytes, err=0
     90report 3, read 4 bytes, err=0
     91read=56 78 78 56
     92../u-boot_gw53xx.imx 0 0 1 0 1 2
     93main dcd length 310
     94sub dcd length 30c
     95dcd_ptr=0x177ff42c
     96
     97loading binary file(image.imx) to 177ff400, skip=0, fsize=80c00 type=aa
     98
     99&lt;&lt;&lt;527360, 527360 bytes&gt;&gt;&gt;
     100jumping to 0x177ff400
     101</pre
     102}}}