【米尔 NXP i.MX93 开发板评测】USB下载工具-UUU
# USB下载工具-UUU由前面的调试可知,通过SD更新镜像比较麻烦,需要SD卡并且操作的步骤也比较多。这篇来试一下NXP的(https://github.com/nxp-imx/mfgtools.git)下载工具。
`uuu`通过USB接口可以下载`uboot`,`Image`,`dtb`,`rootfs`等等,还可以执行自定义的指令。通过自定义的脚本,非常灵活。有了这个工具,后续生产及更新都非常方便。由于使用了USB高速模式,下载速度也非常快。
在GitHub的发布页面有一个uuu.pdf文档,想了解`uuu`工作原理的可以去看看。
这个工具支持`linux`,`windows`,`macos`
## uuu配置
先来看下文件构成:
1. boot目录放了imx-uboot文件`flash.bin`(myir编译出来的文件名为`imx-boot-myd-lmx9x-sd.bin-flash_singleboot`),linux内核 `Image`,设备树`myir-imx93-11x11.dtb`
2. filesystem放打包后的文件系统,这里放的是buildroot生产的`rootfs.tar`
3. modules 放打包好的内核模块 `modules.tar.gz`
4. `fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.zst.u-boot` 是NXP提供的RAMDISK,通过uboot启动后和uuu进行交互操作
5. `imx93-emmc.uuu` 下载控制脚本文件,根据需要修改。
6. `uuu` `uuu.exe` linux和windows的可执行文件,两个系统都可以下载,方便!
`imx93-emmc.uuu` 脚本
```bash
uuu_version 1.5.163
# Please Replace below items with actually file names
# @_flash.bin | boot loader, flash.bin
# @_Image | kernel image, arm64 is Image, arm32 it is zImage, here is Image
# @_board.dtb | board dtb file, here is imx93-11x11-evk.dtb
# @_initramfs.cpio.gz.uboot | mfgtool init ramfs, here is fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.zst.u-boot
# @_rootfs.tar.zst | rootfs, here is imx-image-multimedia-imx93evk.tar.zst
# @_uTee.tar | optee image, put dummy _uTee.tar file here if platform is not MX6/MX7*
# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f boot/flash.bin
# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f boot/flash.bin
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f boot/flash.bin -offset 0x57c00
SDPU: jump
# }
# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f boot/flash.bin -skipspl
SDPV: jump
# }
# use uboot burn bootloader to eMMC
# becaue difference chip, offset is difference
# you can use kernel to do that for specific boards
FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: flash bootloader boot/flash.bin
FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
FB: ucmd setenv emmc_cmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
FB: ucmd if test "${emmc_skip_fb}" != "yes"; then run emmc_cmd; fi
FB: ucmd setenv emmc_cmd mmc bootbus ${emmc_dev} 2 0 1;
FB: ucmd if test "${emmc_skip_fb}" != "yes"; then run emmc_cmd; fi
FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f boot/Image
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f boot/myir-imx93-11x11.dtb
FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: download -f fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.zst.u-boot
#FB: ucmd setenv bootargs console=${console},${baudrate} earlycon=${earlycon},${baudrate}
FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}
# get mmc dev number from kernel command line
# Wait for emmc
FBK: ucmd while [ ! -e /dev/mmcblk*boot0 ]; do sleep 1; echo "wait for /dev/mmcblk*boot* appear"; done;
# serach emmc device number, if your platform have more than two emmc chip, please echo dev number >/tmp/mmcdev
FBK: ucmd dev=`ls /dev/mmcblk*boot*`; dev=($dev); dev=${dev}; dev=${dev#/dev/mmcblk}; dev=${dev%boot*}; echo $dev > /tmp/mmcdev;
# dd to clear the possible MBR
FBK: ucmd mmc=`cat /tmp/mmcdev`; dd if=/dev/zero of=/dev/mmcblk${mmc} bs=512 count=1
# create partition
FBK: ucmd mmc=`cat /tmp/mmcdev`; PARTSTR=$'8M,120M,0c\n,5120M,83\n,128M,83\n5416M,,83\n'; echo "$PARTSTR" | sfdisk --force /dev/mmcblk${mmc}
FBK: ucmd sync
# FAT
FBK: ucmd mmc=`cat /tmp/mmcdev`; while [ ! -e /dev/mmcblk${mmc}p1 ]; do sleep 1; done
FBK: ucmd mmc=`cat /tmp/mmcdev`; mkfs.vfat /dev/mmcblk${mmc}p1
FBK: ucmd mmc=`cat /tmp/mmcdev`; mkdir -p /mnt/fat
FBK: ucmd mmc=`cat /tmp/mmcdev`; mount -t vfat /dev/mmcblk${mmc}p1 /mnt/fat
FBK: ucpboot/Image t:/mnt/fat
FBK: ucpboot/myir-imx93-11x11.dtb t:/mnt/fat
FBK: ucpboot/myir-imx93-11x11-root.dtb t:/mnt/fat
FBK: ucmd sync
FBK: ucmd umount /mnt/fat
# ROOTFS
FBK: ucmd mmc=`cat /tmp/mmcdev`; mkfs.ext4 -F /dev/mmcblk${mmc}p2
FBK: ucmd mkdir -p /mnt/ext4
FBK: ucmd mmc=`cat /tmp/mmcdev`; mount /dev/mmcblk${mmc}p2 /mnt/ext4
FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar --warning=no-timestamp -xz -C /mnt/ext4
FBK: ucp filesystem/rootfs.tar.gz t:-
FBK: ucmd sync
# PARAMETER
FBK: ucmd mmc=`cat /tmp/mmcdev`; mkfs.ext4 -F /dev/mmcblk${mmc}p3
FBK: ucmd sync
# APPFS
FBK: ucmd mmc=`cat /tmp/mmcdev`; mkfs.ext4 -F /dev/mmcblk${mmc}p4
FBK: ucmd sync
# modules
FBK: ucmd mkdir -p /mnt/ext4/lib/modules
FBK: acmd tar--warning=no-timestamp -x -C /mnt/ext4/lib/modules
FBK: ucp modules/modules.tar.gz t:-
FBK: ucmd sync
FBK: ucmd umount /mnt/ext4
FBK: DONE
```
## 下载
设置拨码开关为USB下载,执行指令,重新上电启动,即开始下载。
```bash
# Windows环境
.\uuu.exe .\imx93-emmc.uuu
# Linux环境
./uuu ./imx93-emmc.uuu
```
下载完成,设置eMMC启动,重新上电检查。
## WLAN驱动问题
上电启动后,自带的WLAN驱动好像有点问题。但是不影响使用,有时间再回头看这个问题。输入root登录系统。
<div></div>
页:
[1]