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 the target from a microSD card, or from USB debug mode.
Boot U-Boot from the microSD card
Requirements
-
Root/administrator permissions in your development computer
-
A microSD card with a minimum capacity of 2 GB
The following procedure will destroy existing data in the microSD card. |
Create a bootable microSD
-
Download the U-Boot bootloader binary image file from:
-
For ConnectCore 6 SBC: https://ftp1.digi.com/support/digiembeddedyocto/3.0/r4/images/ccimx6sbc/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.imx> of=/dev/<sdcard> bs=1k seek=1 oflag=sync
-
<path/filename.imx> 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.
Instructions
-
Power off the device.
-
Insert the microSD card into the microSD card holder (bottom side of the board).
-
Change the boot source configuration to boot from the microSD card. To do so, set the boot mode micro-switches as follows:
-
BOOT.1 OFF
-
BOOT.2 ON
-
-
Power on the device.
Boot U-Boot in USB debug mode
Requirements
-
Linux host computer.
-
Root/administrator permissions on your development computer
-
One serial console cable.
-
One micro USB cable.
Instructions
-
Download the U-Boot bootloader binary image file from https://ftp1.digi.com/support/digiembeddedyocto/3.0/r4/images/ccimx6sbc/xwayland/
See U-Boot files by variant to verify which U-Boot binary you need. -
Download the latest Universal Update Utility (UUU) tool, a software tool from NXP.
-
Place the uuu executable in a directory in your PATH, such as
/usr/bin
. -
Install
udev
rules to allow any user to run uuu to access the USB port:~$ sudo sh -c "uuu -udev >> /etc/udev/rules.d/99-uuu.rules" ~$ sudo udevadm control --reload-rules
-
Connect the micro USB cable to the USB device port of the SBC (bottom side, under 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:
-
BOOT.1 ON
-
BOOT.2 ON
-
-
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.
Instructions for closed devices
With TrustFence enabled, signed U-Boot images are created. To boot signed U-Boot images on a closed device, you must configure the imx_usb application provided with Digi Embedded Yocto as follows:
-
Modify the mx6_usb_work.conf configuration under /opt/dey/3.0-r4/ccimx6sbc/sysroots/x86_64-deysdk-linux/etc/imx-loader.d/, adding the following lines:
/path/to/u-boot.imx:dcd /path/to/u-boot-usb-signed.imx:no_clear_boot_data,jump header
Replace /path/to/u-boot.imx with the path to the unsigned u-boot image and /path/to/u-boot-usb-signed.imx with the path to the signed USB bootable image.
-
Execute the imx_usb tool without a U-Boot image argument:
~$ sudo /opt/dey/3.0-r4/ccimx6sbc/sysroots/x86_64-deysdk-linux/usr/bin/imx_usb
If you installed the Digi Embedded Yocto SDK in a location other than the default location, you must use the -c parameter to specify the directory containing the configuration files. Use the following syntax, replacing ${SDK_FOLDER} with the name of the non-standard folder where the SDK was installed: ${SDK_FOLDER}/sysroots/x86_64-deysdk-linux/usr/bin/imx_usb -c ${SDK_FOLDER}/sysroots/x86_64-deysdk-linux/etc/imx-loader.d/ |
Update U-Boot in the eMMC
Once U-Boot is running, you can use it to update the bootloader in the eMMC:
Update 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>.imx
-
Change the boot source configuration to boot from the internal eMMC.
To do so, set the boot mode micro-switches as follows:
-
BOOT.1 OFF
-
BOOT.2 OFF
-
-
Power-cycle the board. The target now boots from the eMMC.
Update 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>.imx
-
Change the boot source configuration to boot from the internal eMMC.
To do so, set the boot mode micro-switches as follows:
-
BOOT.1 OFF
-
BOOT.2 OFF
-
-
Power-cycle the board. The target now boots from the eMMC.