Imx uuu: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
 
(23 intermediate revisions by the same user not shown)
Line 29: Line 29:
$ cmake .
$ cmake .
$ make
$ make
</pre>
'''Note''':<br>
emmc_burn_all.lst configures the eMMC to use the boot partition instead of the user partition. So the following patch is needed to avoid that:
<pre>
diff --git a/uuu/emmc_burn_all.lst b/uuu/emmc_burn_all.lst
index d868d05..521b3c0 100644
--- a/uuu/emmc_burn_all.lst
+++ b/uuu/emmc_burn_all.lst
@@ -32,7 +32,4 @@ FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash -raw2sparse all _image
-FB: flash -scanterm -scanlimited 0x800000 bootloader _flash.bin
-FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
-FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
FB: done
</pre>
</pre>


== Bootloader ==
== Bootloader ==


'''Build U-Boot''':<br>
'''Building U-boot''':<br>
 
U-boot can be built in two ways. The first, from source, cloning the repository and compiling U-Boot. And the second, from yocto, using bitbake.<br>
 
{| class="wikitable"
|-
! Build U-Boot from source
! Build U-Boot from Yocto
|-
|
* Build U-Boot using the defconfig for SD card/eMMC. You can follow the "Build U-Boot from source code" instructions {{Varlink|Yocto_Build_U-Boot|{{#var:RELEASE_LINK}}|here}}.<br>
* Build U-Boot using the defconfig for SD card/eMMC. You can follow the "Build U-Boot from source code" instructions {{Varlink|Yocto_Build_U-Boot|{{#var:RELEASE_LINK}}|here}}.<br>
* Copy the U-Boot image to the uuu directory:
* Copy the U-Boot image to the uuu directory:<br>
  $ cp -v {{#var:U-BOOT_SD_IMAGE_NAME}} ~/mfgtools/uuu/_flash.bin
  $ cp -v {{#var:U-BOOT_SD_IMAGE_NAME}} ~/mfgtools/uuu/_flash.bin
|
* Build imx-boot recipe:<br>
$ bitbake -c deploy imx-boot
* Copy the U-Boot image to the uuu directory:<br>
$ cp -v ./tmp/deploy/images/{{#var:MACHINE_NAME}}/imx-boot ~/mfgtools/uuu/_flash.bin
|}


'''Boot the board into serial download mode''':<br>
'''Boot the board into serial download mode''':<br>
Line 63: Line 96:


'''Build image''':<br>
'''Build image''':<br>
* Build an image using the defconfig for SD card/eMMC. You can follow the "Setup and build Yocto" instructions {{Varlink|Yocto_Build_Release|{{#var:RELEASE_LINK}}|here}}.<br>
* To build an image using the defconfig for SD card/eMMC, follow the "Setup and Build Yocto" instructions {{Varlink|Yocto_Build_Release|{{#var:RELEASE_LINK}}|here}}.<br>
* Copy the .wic image file to the uuu directory:<br>
* Copy the image file to the uuu directory:<br>


<pre>
$ unzstd {{#var:DEFAULT_IMAGE_BB_NAME|fsl-image-gui}}-{{#var:MACHINE_NAME}}.wic.zst                    # Example with .wic.zst image extension
  $ unzstd {{#var:DEFAULT_IMAGE_BB_NAME|fsl-image-gui}}-{{#var:MACHINE_NAME}}.wic.gz
  $ gzip -dk {{#var:DEFAULT_IMAGE_BB_NAME|fsl-image-gui}}-{{#var:MACHINE_NAME}}.wic.gz                   # Example with wic.gz image extension
  $ cp -v {{#var:DEFAULT_IMAGE_BB_NAME|fsl-image-gui}}-{{#var:MACHINE_NAME}}.wic ~/mfgtools/uuu/_image             # Example with fsl-image-gui image
  $ cp -v {{#var:DEFAULT_IMAGE_BB_NAME|fsl-image-gui}}-{{#var:MACHINE_NAME}}.wic ~/mfgtools/uuu/_image   # Example with fsl-image-gui image
</pre>


'''Run uuu to load the image on the board''':
'''Run uuu to load the image on the board''':
Line 77: Line 109:
</pre>
</pre>


* Change the boot selection switch to the eMMC position.<br>
* Set the boot selection switch to the eMMC position.<br>
The board should now boot the system from eMMC. <br>
 
You can see its output on the console via the debug port, as always.<br>
The system should now boot from eMMC, and you can view the output on the console via the debug port as usual.<br>

Latest revision as of 20:43, 2 December 2024

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

This page is using the default release RELEASE_SUMO_V2.1_DART-MX8M.
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 UUU (Universal Update Utility)

Introduction

UUU (Universal Update Utility) is an open source utility by NXP that allows downloading and executing code on i.MX SoCs through the Serial Download Protocol (SDP).
It is the next generation of NXP's MFGTOOL used to load SPL and U-Boot via the USB OTG port and optionally program the internal storage of the SOM.
For more details please visit https://github.com/NXPmicro/mfgtools

Note:
All Variscite SOMs are shipped with U-Boot pre-programmed on the internal storage.
In addition, all Variscite carrier boards have an SD card slot, and even in the unlikely event of the U-Boot being erased from the 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 (and optionally program) the Variscite SOMs, for anyone who is interested.

Step by step usage instructions

Prepare the host machine

Download and build uuu:

$ sudo apt-get install libusb-1.0-0-dev libbz2-dev libzstd-dev pkg-config cmake libssl-dev g++
$ cd ~
$ git clone https://github.com/NXPmicro/mfgtools.git
$ cd mfgtools
$ git checkout uuu_1.4.240 
$ cmake .
$ make

Note:
emmc_burn_all.lst configures the eMMC to use the boot partition instead of the user partition. So the following patch is needed to avoid that:

diff --git a/uuu/emmc_burn_all.lst b/uuu/emmc_burn_all.lst
index d868d05..521b3c0 100644
--- a/uuu/emmc_burn_all.lst
+++ b/uuu/emmc_burn_all.lst
@@ -32,7 +32,4 @@ FB: ucmd setenv fastboot_dev mmc
 FB: ucmd setenv mmcdev ${emmc_dev}
 FB: ucmd mmc dev ${emmc_dev}
 FB: flash -raw2sparse all _image
-FB: flash -scanterm -scanlimited 0x800000 bootloader _flash.bin
-FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
-FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
 FB: done

Bootloader

Building U-boot:

U-boot can be built in two ways. The first, from source, cloning the repository and compiling U-Boot. And the second, from yocto, using bitbake.

Build U-Boot from source Build U-Boot from Yocto
  • Build U-Boot using the defconfig for SD card/eMMC. You can follow the "Build U-Boot from source code" instructions here.
  • Copy the U-Boot image to the uuu directory:
$ cp -v imx-boot-sd.bin ~/mfgtools/uuu/_flash.bin
  • Build imx-boot recipe:
$ bitbake -c deploy imx-boot
  • Copy the U-Boot image to the uuu directory:
$ cp -v ./tmp/deploy/images/imx8mq-var-dart/imx-boot ~/mfgtools/uuu/_flash.bin

Boot the board into serial download mode:

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 "NXP Semiconductors SE Blank M850" (or something similar).

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

Run uuu to load U-Boot on the board:

 $ cd ~/mfgtools/uuu
 $ sudo ./uuu ./spl_boot.lst

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

Note:
The default boot command when booting from USB is bootcmd_mfg - it is defined by default in include/configs/imx_env.h in the U-Boot source code, as part of the the board's default environment.
It can be redefined or made empty.

Rootfs

Build image:

  • To build an image using the defconfig for SD card/eMMC, follow the "Setup and Build Yocto" instructions here.
  • Copy the image file to the uuu directory:
$ unzstd fsl-image-gui-imx8mq-var-dart.wic.zst                    # Example with .wic.zst image extension
$ gzip -dk fsl-image-gui-imx8mq-var-dart.wic.gz                   # Example with wic.gz image extension
$ cp -v fsl-image-gui-imx8mq-var-dart.wic ~/mfgtools/uuu/_image   # Example with fsl-image-gui image

Run uuu to load the image on the board:

 $ cd ~/mfgtools/uuu
 $ sudo ./uuu ./emmc_burn_all.lst
  • Set the boot selection switch to the eMMC position.

The system should now boot from eMMC, and you can view the output on the console via the debug port as usual.