481
edits
(Created page with "<noinclude>{{IMX8/Head}}</noinclude> 400px|center|Boot switch on Nitrogen8M <noinclude>{{IMX8/Foot|<Replace with "previous" page>|<Replac...") |
No edit summary |
||
Line 1: | Line 1: | ||
<!-- Please add custom keywords relevant to the page as arguments to the head macro. For example: | |||
{{IMX8/Head|Keyword1,Keyword2}} | |||
You may leave them unspecified if custom keywords don't apply. | |||
--> | |||
<noinclude>{{IMX8/Head}}</noinclude> | <noinclude>{{IMX8/Head}}</noinclude> | ||
<!-- If you want a custom title for the page, un-comment and edit this line: | |||
{{DISPLAYTITLE:i.MX8 - <descriptive page name>|noerror}} | |||
--> | |||
__TOC__ | |||
=Overview= | |||
This page presents a guide about how to recover your board when it is not booting. | |||
In order to recover your board, some components are required to be built in specific folders. | |||
Required components: | |||
# U-Boot | |||
# Flash Image | |||
# USB Loader | |||
Define a building directory: | |||
<syntaxhighlight lang=bash> | |||
RECOVERY_DIR=~/Nitrogen8M-recovery | |||
mkdir $RECOVERY_DIR | |||
</syntaxhighlight> | |||
=Dependencies= | |||
Install required dependencies for Nitrogen8M recovery: | |||
<syntaxhighlight lang=bash> | |||
sudo apt-get install crossbuild-essential-arm64 libusb-1.0-0-dev pkg-config | |||
<syntaxhighlight> | |||
=U-Boot= | |||
Clone Boundary Devices repository using your desired U-Boot version. | |||
<syntaxhighlight lang=bash> | |||
BRANCH=boundary-v2018.07 | |||
cd $RECOVERY_DIR | |||
git clone https://github.com/boundarydevices/u-boot-imx6 -b $BRANCH | |||
</syntaxhighlight> | |||
Define toolchain for building the source code. | |||
<syntaxhighlight lang=bash> | |||
export ARCH=arm64 | |||
export CROSS_COMPILE=aarch64-linux-gnu- | |||
</syntaxhighlight> | |||
Build kernel and device tree. | |||
<syntaxhighlight lang=bash> | |||
DEFCONFIG=nitrogen8m_defconfig | |||
cd $RECOVERY_DIR/u-boot-imx6 | |||
make $DEFCONFIG | |||
make -j4 | |||
</syntaxhighlight> | |||
=Building Image= | |||
In order to generate the final flash file, '''imx-mkimage''' tool is required. | |||
Download imx-mkimage tool as follows. | |||
<syntaxhighlight lang=bash> | |||
cd $RECOVERY_DIR | |||
git clone https://github.com/boundarydevices/imx-mkimage.git | |||
</syntaxhighlight> | |||
Define required variables. | |||
<syntaxhighlight lang=bash> | |||
UBOOT_PATH=$RECOVERY_DIR/u-boot-imx6 | |||
</syntaxhighlight> | |||
Create the flash image. | |||
<syntaxhighlight lang=bash> | |||
cd imx-mkimage | |||
./make_boundary.sh | |||
</syntaxhighlight> | |||
At this point, a '''flash.bin''' file should be created under '''$RECOVERY_DIR/imx-mkimage/iMX8M'''. | |||
=USB loader= | |||
Before flashing the board, build the flashing tool '''imx_usb''' as follows. | |||
<syntaxhighlight lang=bash> | |||
cd $RECOVERY_DIR | |||
git clone git://github.com/boundarydevices/imx_usb_loader | |||
cd imx_usb_loader | |||
make | |||
</syntaxhighlight> | |||
=Flashing Board= | |||
Finally, under RECOVERY_DIR you must have 3 directories: | |||
# imx-mkimage: Image to flash. | |||
# imx_usb_loader: Flashing tool. | |||
# u-boot-imx6: U-Boot used by image to flash. | |||
Set your board to '''Serial Download''' mode, set the boot switch position as follows. | |||
[[File:Nitrogen8m_recovery_sw.png|400px|center|Boot switch on Nitrogen8M]] | [[File:Nitrogen8m_recovery_sw.png|400px|center|Boot switch on Nitrogen8M]] | ||
Now, connect the board to a host machine using the OTG port. | |||
Check with '''lsusb''' if your board is detected. | |||
Output example: | |||
<syntaxhighlight lang=bash> | |||
user@laptop:~$ lsusb | grep NXP | |||
Bus 001 Device 047: ID 1fc9:012b NXP Semiconductors | |||
</syntaxhighlight> | |||
Before flashing, check '''mx8mq_usb_work.conf''' in RECOVERY_DIR/imx_usb_loader which contains the required files. | |||
As example, the Nitrogen8M with 2 GB RAM requires the file '''bl31_2g.bin''' in '''mx8mq_usb_work.conf'''. | |||
In order to flash the board, run the following command: | |||
<syntaxhighlight lang=bash> | |||
sudo ./imx_usb | |||
</syntaxhighlight> | |||
Output example: | |||
<syntaxhighlight lang=bash> | |||
config file <.//imx_usb.conf> | |||
vid=0x066f pid=0x3780 file_name=mx23_usb_work.conf | |||
vid=0x15a2 pid=0x004f file_name=mx28_usb_work.conf | |||
vid=0x15a2 pid=0x0052 file_name=mx50_usb_work.conf | |||
vid=0x15a2 pid=0x0054 file_name=mx6_usb_work.conf | |||
vid=0x15a2 pid=0x0061 file_name=mx6_usb_work.conf | |||
vid=0x15a2 pid=0x0063 file_name=mx6_usb_work.conf | |||
vid=0x15a2 pid=0x0071 file_name=mx6_usb_work.conf | |||
vid=0x15a2 pid=0x007d file_name=mx6_usb_work.conf | |||
vid=0x15a2 pid=0x0080 file_name=mx6ull_usb_work.conf | |||
vid=0x1fc9 pid=0x0128 file_name=mx6_usb_work.conf | |||
vid=0x15a2 pid=0x0076 file_name=mx7_usb_work.conf | |||
vid=0x1fc9 pid=0x0126 file_name=mx7ulp_usb_work.conf | |||
vid=0x15a2 pid=0x0041 file_name=mx51_usb_work.conf | |||
vid=0x15a2 pid=0x004e file_name=mx53_usb_work.conf | |||
vid=0x15a2 pid=0x006a file_name=vybrid_usb_work.conf | |||
vid=0x066f pid=0x37ff file_name=linux_gadget.conf | |||
vid=0x1b67 pid=0x4fff file_name=mx6_usb_sdp_spl.conf | |||
vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf | |||
vid=0x1fc9 pid=0x012b file_name=mx8mq_usb_work.conf | |||
config file <.//mx8mq_usb_work.conf> | |||
parse .//mx8mq_usb_work.conf | |||
Trying to open device vid=0x1fc9 pid=0x012b | |||
Interface 0 claimed | |||
HAB security state: development mode (0x56787856) | |||
== work item | |||
filename ../imx-mkimage/iMX8M/flash.bin | |||
load_size 0 bytes | |||
load_addr 0x00000000 | |||
dcd 1 | |||
clear_dcd 1 | |||
plug 1 | |||
jump_mode 3 | |||
jump_addr 0x00000000 | |||
== end work item | |||
No DCD table | |||
loading binary file(../imx-mkimage/iMX8M/flash.bin) to 32c10000, skip=1c00, fsize=18000 type=aa | |||
<<<98304, 98304 bytes>>> | |||
succeeded (security 0x56787856, status 0x88888888) | |||
loading binary file(../imx-mkimage/iMX8M/flash.bin) to 007e0bd0, skip=19c00, fsize=29800 type=aa | |||
<<<169984, 169984 bytes>>> | |||
succeeded (security 0x56787856, status 0x88888888) | |||
jumping to 0x007e0fd0 | |||
failed (security 0x56787856, status 0x3311cf00) | |||
HAB security state: development mode (0x56787856) | |||
== work item | |||
filename ../imx-mkimage/iMX8M/u-boot.bin | |||
load_size 0 bytes | |||
load_addr 0x40200000 | |||
dcd 0 | |||
clear_dcd 0 | |||
plug 0 | |||
jump_mode 0 | |||
jump_addr 0x00000000 | |||
== end work item | |||
loading binary file(../imx-mkimage/iMX8M/u-boot.bin) to 40200000, skip=0, fsize=a82f0 type=0 | |||
<<<688880, 688880 bytes>>> | |||
succeeded (security 0x56787856, status 0x88888888) | |||
HAB security state: development mode (0x56787856) | |||
== work item | |||
filename ../imx-mkimage/iMX8M/bl31_2g.bin | |||
load_size 0 bytes | |||
load_addr 0x00910000 | |||
dcd 0 | |||
clear_dcd 0 | |||
plug 0 | |||
jump_mode 2 | |||
jump_addr 0x00910000 | |||
== end work item | |||
loading binary file(../imx-mkimage/iMX8M/bl31_2g.bin) to 00910000, skip=0, fsize=b858 type=aa | |||
<<<47192, 47192 bytes>>> | |||
succeeded (security 0x56787856, status 0x88888888) | |||
jumping to 0x0091b818 | |||
</syntaxhighlight> | |||
<noinclude>{{IMX8/Foot|<Replace with "previous" page>|<Replace with "next" page>}}</noinclude> | <noinclude>{{IMX8/Foot|<Replace with "previous" page>|<Replace with "next" page>}}</noinclude> |
edits