Perform a rescue boot
If the bootloader has been erased from the storage media (or written with an invalid image) and the target does not boot, you can:
Boot in USB debug mode
Requirements
-
Root/administrator permissions on your development computer.
-
Serial console cable.
-
A micro USB cable.
Instructions
-
Download the U-Boot bootloader binary image file from https://ftp1.digi.com/support/digiembeddedyocto/4.0/r7/images/ccimx8mn-dvk/xwayland/
See U-Boot files by variant to verify which U-Boot binary you need. -
Download the latest Universal Update Utility (UUU), a software tool from NXP.
UUU version should be v1.5.11 or higher. -
Place the
uuu
executable in a directory in your PATH, such as/usr/bin
. -
Install
udev
rules to allow any user to runuuu
to access the USB port:$ sudo sh -c "uuu -udev >> /etc/udev/rules.d/70-uuu.rules" $ sudo udevadm control --reload
-
Connect the micro USB cable to the USB recovery connector of the board (top side, next to the USB host connectors) and the other end to the development computer.
-
Change the boot mode configuration to boot from USB.
To do so, set the boot mode micro-switches as follows:
-
S1.1
: ON -
S1.2
: ON -
S1.3
: n/a -
S1:4
: n/a
-
-
Open a serial terminal at 115200/8/n/1.
-
Power up the board.
-
On the host computer, run the uuu tool with the U-Boot file to boot as parameter. For example:
$ uuu </path/to/u-boot-file>
The serial terminal shows the device starting U-Boot.
When TrustFence support is enabled, Digi Embedded Yocto builds a signed U-Boot file imx-boot-signed-ccimx8mn-dvk.bin
. Use this file to recover a closed device from USB. -
Once you have booted U-Boot, you can proceed to re-program U-Boot into the eMMC. See Re-program U-Boot in the eMMC.
Boot from microSD card
Requirements
-
Root/administrator permissions in your development computer
-
A microSD card with a minimum capacity of 2 GB
Instructions
The following procedure will destroy existing data in the microSD card. |
-
Create a bootable microSD card.
-
Download the U-Boot bootloader binary image file from https://ftp1.digi.com/support/digiembeddedyocto/4.0/r7/images/ccimx8mn-dvk/xwayland/
See U-Boot files by variant to verify which U-Boot binary you need. -
Copy the U-Boot file into a folder of your choice.
-
Insert the microSD card into your computer and check the node Linux assigns to it (/dev/<sdcard>) using dmesg:
$ dmesg [1413652.901270] sd 41:0:0:0: [sdc] 7744512 512-byte logical blocks: (3.96 GB/3.69 GiB) [1413652.903140] sd 41:0:0:0: [sdc] No Caching mode page present [1413652.903144] sd 41:0:0:0: [sdc] Assuming drive cache: write through [1413652.905638] sd 41:0:0:0: [sdc] No Caching mode page present [1413652.905642] sd 41:0:0:0: [sdc] Assuming drive cache: write through [1413652.915154] sdc: sdc1
Do not mount any partitions the card might contain (or unmount any partition if automatically mounted), as you will be writing to the entire block device.
Using an incorrect device node in the next step might destroy all data on your computer hard drive. -
Raw write the image file to the microSD card with this command:
$ sudo dd if=<path/filename.bin> of=/dev/<sdcard> bs=1k seek=32 oflag=sync
-
<path/filename.bin> must be substituted with the path and filename to the U-Boot image.
-
<sdcard> must be substituted with the device node that Linux assigns to your microSD card.
The microSD card is now ready.
-
-
-
Power off the device.
-
Insert the microSD card into the microSD card holder.
-
Change the boot source configuration to boot from the microSD card. To do so, set the boot mode micro-switches as follows:
-
S1.1
: OFF -
S1.2
: ON -
S1.3
: ON -
S1:4
: n/a
-
-
Power on the device.
-
Once you have booted U-Boot, you can proceed to re-program U-Boot into the eMMC. See Re-program U-Boot in the eMMC.
Re-program U-Boot in the eMMC
Once U-Boot is running, you can use it to update the bootloader in the eMMC:
-
Reset the environment to default values:
=> env default -a
-
Reset to the default partition table into the eMMC:
=> run partition_emmc_linux
-
Save the environment with
saveenv
. -
Use one of the following methods to update the files to the eMMC:
Re-program bootloader from USB using Fastboot
To update U-Boot via USB OTG using uuu and the Fastboot protocol:
-
Connect a micro USB cable between target and host.
-
Then, on the target, run the
fastboot
command from the U-Boot console, selecting the USB interface you want it to listen to:=> fastboot 0
-
On the host, run the following fastboot command through the uuu tool (as root):
$ uuu FB: flash bootloader <file>
-
Change the boot source configuration to boot from the internal eMMC.
To do so, set the boot mode micro-switches as follows:
-
S1.1
: OFF -
S1.2
: OFF -
S1.3
: OFF -
S1:4
: n/a
-
-
Power-cycle the board. The target now boots from the eMMC.
For additional commands and information, see the NXP UUU manual.
Re-program bootloader from Ethernet (TFTP)
-
Place the U-Boot binary inside your host computer TFTP exported folder.
-
On the target, configure your network settings (IP of the device, IP of the host/server):
=> setenv ipaddr <your-ip> => setenv serverip <server-ip>
-
Connect an Ethernet cable to the Ethernet port.
-
Run the following command to update U-Boot into the eMMC:
=> update uboot tftp <u-boot-filename>.bin
-
Change the boot source configuration to boot from the internal eMMC.
To do so, set the boot mode micro-switches as follows:
-
S1.1
: OFF -
S1.2
: OFF -
S1.3
: OFF -
S1:4
: n/a
-
-
Power-cycle the board. The target now boots from the eMMC.
Re-program bootloader from microSD card
-
Place the U-Boot binary inside a FAT-formatted microSD card.
-
Insert the microSD card in the board.
-
Run the following command to update U-Boot into the eMMC:
=> update uboot mmc 1 fat <u-boot-filename>.bin
-
Change the boot source configuration to boot from the internal eMMC.
To do so, set the boot mode micro-switches as follows:
-
S1.1
: OFF -
S1.2
: OFF -
S1.3
: OFF -
S1:4
: n/a
-
-
Power-cycle the board. The target now boots from the eMMC.