This shows you the differences between two versions of the page.
ass:laboratoare:01:tasks:03 [2023/07/17 23:33] florin.stancu |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== 03. Finally booting the board! ==== | ||
- | |||
- | The i.MX8M family of processors can boot from multiple sources: eMMC, SD card, etc. Our board lacks an SD card slot so this method can be discarded right off the bat. Although booting from eMMC is possible, it would require us to overwrite its persistent storage with a disk image every single time. We will do this at some point in the following sessions but for now the most convenient solution is using SDP to download **flash.bin** via a serial connection, over USB. | ||
- | |||
- | === Preparation === | ||
- | |||
- | In order to select Serial Download as the preferred method of boot, you will need to set two jumpers on the board. Find J1 and J2 and configure them according to the figure below. | ||
- | |||
- | {{ :ass:laboratoare:01:tasks:boot_jumpers.png?400 |}} | ||
- | |||
- | == Step 6. Download & compile the IMX Universal Update Utility == | ||
- | |||
- | The Universal Update Utility (UUU) is an image deployment tool created by NXP for it's i.MX architecture. For more information about its usage, scripting interface and supported protocols, check out the [[https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors/140261/1/UUU.pdf|documentation]]. | ||
- | |||
- | Grab the source code from [[https://github.com/nxp-imx/mfgtools.git|here]] and compile ***uuu***. The project uses the **cmake** build system for the sake of portability. If you haven't encountered it yet, follow these setup steps: | ||
- | |||
- | <code bash> | ||
- | # currently in the mfgtools repo root | ||
- | |||
- | $ mkdir build && cd build | ||
- | $ cmake .. | ||
- | $ make -j $(nproc) | ||
- | </code> | ||
- | |||
- | === Connecting to the board === | ||
- | |||
- | First things first, connect the Micro USB and USB-C cables. While the latter will be used to power on the board, the former will expose two Serial Devices to your computer. The one used for console I/O by the bootloaders should appear to you as ''/dev/ttyUSB0''. | ||
- | |||
- | <note warning> | ||
- | If you're using a Virtual Machine, you first need to identify the USB device on the host (it should be something like ''NXP Semiconductors i.MX 8M ... Serial Downloader'') and forward it to the VM. | ||
- | |||
- | Otherwise (if you're using a Windows host), you will need to download and install both the NXP IMX ''uuu'' utility and a serial console program for your native platform; but not recommended. | ||
- | </note> | ||
- | |||
- | Connect to this device using a serial terminal emulation tool of your choice. We recommend **picocom**. The default baud rate of i.MX devices is 115200 by convention. | ||
- | |||
- | Note that nothing will be printed on the console yet, but you need to stay connected to receive the messages that will follow! | ||
- | |||
- | == Step 7: Upload the firmware image package (FIP)! == | ||
- | |||
- | Ever since the USB-C cable was plugged in, **BL1** has been waiting for the FIP data over serial, thanks to our jumper configuration. Now we can finally provide this data using **uuu** and it's SDP implementation: | ||
- | |||
- | <code bash> | ||
- | # paths for uuu and flash.bin truncated | ||
- | $ uuu -b spl flash.bin | ||
- | </code> | ||
- | |||
- | About now you should see lots of debug messages via **picocom** (or whatever serial console tool you prefer). If the last log line is ''Run fastboot ...'', send it a //Ctrl + C// and you should get the ''u-boot%%=>%%'' prompt. | ||
- | |||
- | <note> | ||
- | If you wish to reload the FIP image, use the Reset button located next to the USB-C connector, on the edge of the board. | ||
- | </note> | ||
- | |||
- | === Interacting with U-Boot === | ||
- | |||
- | Now that we finally have access to the interactive shell (we've stopped at **BL33**), try to run ''bdinfo'' for some generic board information. Run ''help'' to see what other commands are available to you, and ''help <command>'' for detailed information of said command. Note that this may not be an exhaustive list of commands; some may not have been compiled into the final binary, depending on your ''.config''. | ||
- | |||
- | == Step 8. Try performing the following: == | ||
- | |||
- | * Get the vendor and System on Chip (SOC) name from the environment variables. | ||
- | * Print the available eMMC devices, as well as their partition tables (if any are available). | ||
- | * Perform a memory test on the first GB of DRAM. Note that U-Boot relocates itself toward the end of the DRAM bank during its initialization phase (check ''bdinfo'' for the exact address). Stay away from that region unless you want to overwrite **BL33** itself with your test pattern. | ||