Imx usb loader: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<!-- Set release according to "release" parameter in URL and use ROCKO_V1.0_VAR-SOM-MX6 as default
<!-- Set release according to "release" parameter in URL and use ROCKO_V1.0_VAR-SOM-MX6 as default
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{INIT_RELEASE_PARAM|RELEASE_ROCKO_V1.0_VAR-SOM-MX6}}<!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_ROCKO_V1.0_VAR-SOM-MX6}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{PageHeader|Booting from USB using the imx_usb_loader utility}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=}} __toc__
--> {{PageHeader|Booting from USB using the imx_usb_loader utility}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=}} __toc__
= Introduction =
= Introduction =


imx_loader is an open source utility by Boundary Devices that allows to download and execute code on Freescale i.MX5/i.MX6/i.MX7 and Vybrid SoCs through the Serial Download Protocol (SDP).<br>
imx_loader is an open source utility by Boundary Devices that allows to download and execute code on NXP i.MX5/i.MX6/i.MX7 and Vybrid SoCs through the Serial Download Protocol (SDP).<br>
Most commonly it is used to load SPL and U-Boot via the USB OTG port.<br> It is a replacement for Freescale's MFGTOOLS.<br>
Most commonly it is used as a replacement for NXP's MFGTOOL to load SPL and U-Boot via the USB OTG port.<br> <br>
<br>
<br>
Further readings:<br>
Further reading:<br>
https://github.com/boundarydevices/imx_usb_loader/blob/master/README.md<br>
https://github.com/boundarydevices/imx_usb_loader/blob/master/README.md<br>
{{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A || https://github.com/varigit/uboot-imx/blob/{{#var:U-BOOT_BRANCH}}/doc/README.sdp<br>}}
{{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A || https://github.com/varigit/uboot-imx/blob/{{#var:U-BOOT_BRANCH}}/doc/{{#ifeq: {{#var:U-BOOT_BRANCH}} | imx_v2017.03_4.9.11_1.0.0_ga_var01 | README.sdp | imx/misc/sdp.txt }}<br>}}
<br>
<br>
Note:<br>
Note:<br>
Line 19: Line 19:
= Step by step usage instructions =
= Step by step usage instructions =


'''Download the imx_usb_loader utility''':<br>
'''Download and install the imx_usb_loader utility''':<br>
<pre>
<pre>
$ sudo apt-get install libusb-1.0-0-dev
$ cd ~
$ cd ~
$ git clone https://github.com/boundarydevices/imx_usb_loader.git
$ git clone https://github.com/boundarydevices/imx_usb_loader.git
$ cd imx_usb_loader
$ git reset --hard c598fd14d67
$ make
</pre>
</pre>
<br>
<br>
Line 29: Line 33:
You can follow the "Build U-Boot from source code" instructions {{Varlink|Yocto_Build_U-Boot|{{#var:RELEASE_LINK}}|here}}.<br>
You can follow the "Build U-Boot from source code" instructions {{Varlink|Yocto_Build_U-Boot|{{#var:RELEASE_LINK}}|here}}.<br>
Copy the {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A | U-Boot image | SPL and U-Boot images}} to the imx_usb_loader directory:
Copy the {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A | U-Boot image | SPL and U-Boot images}} to the imx_usb_loader directory:
  $ cp -v {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A || SPL}} {{#var:U-BOOT_IMAGE_NAME}} ~/imx_usb_loader
  $ cp -v {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A |{{#var:U-BOOT_IMAGE_NAME}}|SPL u-boot.img}} ~/imx_usb_loader
<br>
<br>
{{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A ||
{{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A ||
'''Configure imx_usb to load SPL and {{#var:U-BOOT_IMAGE_NAME}} consecutively''':
{{#ifeq: {{#var:MACHINE_NAME}} | imx7-var-som |
'''Configure imx_usb to load SPL and u-boot.img consecutively''':
  $ cd ~/imx_usb_loader
  $ cd ~/imx_usb_loader
Edit the imx_usb.conf file, and prepend the following lines to it:
Edit the imx_usb.conf file, and <u>prepend</u> the following lines to it:
#imx7
0x15a2:0x0076, mx7_usb_rom.conf, 0x0525:0xb4a4, mx7_usb_sdp_spl.conf
 
Create a file called mx7_usb_rom.conf with the following content:<br>
(the content is the same as mx7_usb_work.conf, with an 'SPL:jump header2' line appended to it)
mx7
hid,1024,0x910000,0x80000000,1G,0x00900000,0x20000
SPL:jump header2
 
Create a file called mx7_usb_sdp_spl.conf file, with the following content:
mx7_spl_sdp
#hid/bulk,[old_header,]max packet size, {ram start, ram size}(repeat valid ram areas)
#In SPL, we typically load u-boot.img which has a U-boot header...
hid,uboot_header,1024,0x80000000,1G,0x00907000,0x11000
u-boot.img:jump header2
<br>
|
'''Configure imx_usb to load SPL and u-boot.img consecutively''':
$ cd ~/imx_usb_loader
Edit the imx_usb.conf file, and <u>prepend</u> the following lines to it:
  #imx6dq/dqp
  #imx6dq/dqp
  0x15a2:0x0054, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
  0x15a2:0x0054, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
Line 45: Line 70:


Create a file called mx6_usb_rom.conf with the following content:<br>
Create a file called mx6_usb_rom.conf with the following content:<br>
(the content is the same as mx6_usb_work.conf, with the last 'SPL' line appended to it)
(the content is the same as mx6_usb_work.conf, with an 'SPL:jump header2' line appended to it)
  mx6_qsb
  mx6_qsb
  hid,1024,0x910000,0x10000000,1G,0x00900000,0x40000
  hid,1024,0x910000,0x10000000,1G,0x00900000,0x40000
Line 53: Line 78:
  u-boot.img:jump header2
  u-boot.img:jump header2
<br>
<br>
}}
}}
}}
'''Boot the board into serial download mode''':<br>
'''Boot the board into serial download mode''':<br>
Line 58: Line 84:
Alternatively, set the board boot mode to eMMC/NAND flash, when the eMMC/NAND flash does not contain a bootloader.<br>
Alternatively, set the board boot mode to eMMC/NAND flash, when the eMMC/NAND flash does not contain a bootloader.<br>
Connect the board to your host PC via the USB OTG port, and power on the board.<br>
Connect the board to your host PC via the USB OTG port, and power on the board.<br>
The board should be recognized on the host as a "Freescale SemiConductor Inc  SE Blank ARIK".<br>
The board should be recognized on the host as a "Freescale SemiConductor Inc  SE Blank ARIK" (or something similar).<br>
<br>
{{Note| If your board only has a regular USB type-A connector and doesn't have a USB Micro-AB receptacle, you can use a "male USB type-A to male USB type-A" cable}}
<br>
<br>
'''Run imx_usb to load and {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A || SPL and}} U-Boot on the board''':
'''Run imx_usb to load {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A || SPL and}} U-Boot on the board''':
  {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A |
  {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A |
  $ sudo ./imx_usb {{#var:U-BOOT_IMAGE_NAME}}|
  $ sudo ./imx_usb {{#var:U-BOOT_IMAGE_NAME}}|
  $ sudo ./imx_usb}}
  $ sudo ./imx_usb}}
The board should now run {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A || SPL and}} U-Boot.<br>
The board should now run {{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A || SPL and}} U-Boot.<br>
You can see its output on the console via the debug port, as always.<br>
<br>
<br>
'''Notes''':
'''Notes''':
* The default boot command when booting from USB is bootcmd_mfg. It can be defined in the in the board's default env{{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A ||&#32;(we leave it empty by default)}}.
* The default boot command when booting from USB is bootcmd_mfg. It can be defined in the board's default env{{#ifeq: {{#var:SPL_SD_IMAGE_NAME}} | N/A ||&#32;(we leave it empty by default)}}.
* When booting via the Serial Download Protocol, the runtime environment variables are not set, so the device tree autodetection, mmc device autodetection, etc. do not work properly, and you need to explicitly set the correct values in the environment.

Latest revision as of 16:31, 24 January 2023

Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release RELEASE_ROCKO_V1.0_VAR-SOM-MX6.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
Booting from USB using the imx_usb_loader utility

Introduction

imx_loader is an open source utility by Boundary Devices that allows to download and execute code on NXP i.MX5/i.MX6/i.MX7 and Vybrid SoCs through the Serial Download Protocol (SDP).
Most commonly it is used as a replacement for NXP's MFGTOOL to load SPL and U-Boot via the USB OTG port.


Further reading:
https://github.com/boundarydevices/imx_usb_loader/blob/master/README.md
https://github.com/varigit/uboot-imx/blob/imx_v2017.03_4.9.11_1.0.0_ga_var01/doc/README.sdp

Note:
All Variscite SOMs are shipped with SPL and U-Boot pre-programmed on the SOM's internal storage.
In addition, all Variscite carrier boards have an SD card slot, and even in the unlikely event of the SPL/U-Boot being erased from the SOM's internal storage, the SOM can always be booted from an SD card (like our recovery SD card, for example).
So, generally, this utility is not needed, however, it is yet another option that can be used to boot the Variscite SOMs, for anyone who is interested.

Step by step usage instructions

Download and install the imx_usb_loader utility:

$ sudo apt-get install libusb-1.0-0-dev
$ cd ~
$ git clone https://github.com/boundarydevices/imx_usb_loader.git
$ cd imx_usb_loader
$ git reset --hard c598fd14d67
$ make


Build U-Boot:
Build U-Boot using the defconfig for SD card/eMMC.
You can follow the "Build U-Boot from source code" instructions here.
Copy the SPL and U-Boot images to the imx_usb_loader directory:

$ cp -v SPL u-boot.img ~/imx_usb_loader


Configure imx_usb to load SPL and u-boot.img consecutively:

$ cd ~/imx_usb_loader

Edit the imx_usb.conf file, and prepend the following lines to it:

#imx6dq/dqp
0x15a2:0x0054, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
#imx6s/dl
0x15a2:0x0061, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
#imx6ul
0x15a2:0x007d, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
#imx6ull
0x15a2:0x0080, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf

Create a file called mx6_usb_rom.conf with the following content:
(the content is the same as mx6_usb_work.conf, with an 'SPL:jump header2' line appended to it)

mx6_qsb
hid,1024,0x910000,0x10000000,1G,0x00900000,0x40000
SPL:jump header2

Edit the mx6_usb_sdp_spl.conf file, and append the following line to it:

u-boot.img:jump header2


Boot the board into serial download mode:
Set the board boot mode to SD card, while not having an actual card inserted in its slot.
Alternatively, set the board boot mode to eMMC/NAND flash, when the eMMC/NAND flash does not contain a bootloader.
Connect the board to your host PC via the USB OTG port, and power on the board.
The board should be recognized on the host as a "Freescale SemiConductor Inc SE Blank ARIK" (or something similar).

If your board only has a regular USB type-A connector and doesn't have a USB Micro-AB receptacle, you can use a "male USB type-A to male USB type-A" cable


Run imx_usb to load SPL and U-Boot on the board:

$ sudo ./imx_usb

The board should now run SPL and U-Boot.
You can see its output on the console via the debug port, as always.

Notes:

  • The default boot command when booting from USB is bootcmd_mfg. It can be defined in the board's default env (we leave it empty by default).