烧录镜像到EMMC

2020-05-04  本文已影响0人  Lazy_Caaat

在i.MX_Linux_User's_Guide.PDF中有如下描述

4.2.1 Downloading UUU 下载UUU工具的链接
  Download UUU version 1.2.91 or later from       https://github.com/NXPmicro/mfgtools/releases.

4.2.2 Using UUU 如何使用UUU
Follow these instructions to use the UUU for i.MX 6, i.MX 7, i.MX 8M Quad, i.MX 8M Mini, i.MX 8QuadMax, and i.MX
8QuadXPlus:
1. Connect a USB cable from a computer to the USB OTG/TYPE C port on the board.
  连接usb线从PC端到板子的usb-OTG端
2. Connect a USB cable from the OTG-to-UART port to the computer for console output.
  在PC上打开串口工具并连接板子的端口
3. Open a Terminal emulator program. See Section "Basic Terminal Setup" in this document.
  具体打开方法有解释
4. Set the boot pin to serial download mode mode. See Section "Serial download mode for the Manufacturing Tool" in
this document.
  板子上的拨码开关设置成serial down模式
For detailed usage of UUU, see github.com/NXPmicro/mfgtools/wiki. 
更详细的使用方法,打开这个链接 github.com/NXPmicro/mfgtools/wiki


For example, the following command writes rootfs.sdcard into eMMC.
举例烧写根文件系统到emmc中的命令如下
uuu -b emmc_all <bootloader> <rootfs.sdcard>

The following command decompresses bz2 file and writes into eMMC:
举例烧写bz2格式的根文件系统到emmc中的命令如下(如果需要sdcard文件,使用bzip2 -d -f filename命令解压即可)
uuu -b emmc_all <bootloader> <rootfs.sdcard.bz2/*>

The following command executes downloading and bootloader (SPL and U-Boot) by USB:
通过USB烧写BootLoader到emmc
uuu -b spl <bootloader>

The follow command burns into eMMC (If only one board is supported in such a release package and the board supports
eMMC chip):
如果手头有官方释放的针对特定板子的打包文件(包括BootLoader kernel dts rootfs 等所有需要的文件),可以直接执行下面命令烧录
uuu <release package>.zip


关于烧录的时候无限循环重启的问题

其本质是usb typec的两个PD芯片被去掉的原因,它是一个IIC设备,上电后会寻找这个设备,如果找不到则会出现这个重启烧录不进去的问题

tpcp_init: Can't find device id=0x52

tpcp_init: Can't find device id=0x50

我们需要去uboot源码里找到设备树,并把它改为otg模式


marvin@ubuntu:~/imx-yocto-bsp/build-imx8mmevk/tmp/work/imx8mmevk-poky-linux/u-boot-imx/1_2019.04-r0/git/arch/arm/dts$ vim fsl-imx8mm-evk.dts

&i2c2 {
        clock-frequency = <400000>;
        pinctrl-names = "default", "gpio";
        pinctrl-0 = <&pinctrl_i2c2>;
        pinctrl-1 = <&pinctrl_i2c2_gpio>;
        scl-gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>;
        sda-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
        /*status = "okay";  这里的IIC设备需要关闭掉*/ 
        status = "disabled";

        typec_ptn5110_1: ptn5110@50 {
                compatible = "usb,tcpci";
                reg = <0x50>;
                src-pdos = <0x380190c8>;
                snk-pdos = <0x380190c8 0x3802d0c8>;
                max-snk-mv = <9000>;
                max-snk-ma = <2000>;
                op-snk-mw = <9000>;
                max-snk-mw = <18000>;
                port-type = "drp";
                default-role = "sink";
        };

        typec_ptn5110_2: ptn5110@52 {
                compatible = "usb,tcpci";
                reg = <0x52>;
                src-pdos = <0x380190c8>;
                snk-pdos = <0x380190c8 0x3802d0c8>;
                max-snk-mv = <9000>;
                max-snk-ma = <2000>;
                op-snk-mw = <9000>;
                max-snk-mw = <18000>;
                port-type = "drp";
                default-role = "sink";
        };
};
............
&usbotg1 {
        status = "okay";
        /*extcon = <&typec_ptn5110_1>;这里的PD选为OTG*/
        dr_mode = "otg";
};

&usbotg2 {
        status = "okay";
        /*extcon = <&typec_ptn5110_2>;这里的PD选为OTG*/
        dr_mode = "otg";
};


/imx-yocto-bsp/build-imx8mmevk/tmp/work/imx8mmevk-poky-linux/u-boot-imx/1_2019.04-r0/git/configs$ vim imx8mm_ddr4_evk_android_uuu_defconfig

CONFIG_ARM=y
CONFIG_ARCH_IMX8M=y
CONFIG_SYS_TEXT_BASE=0x40200000
CONFIG_SYS_MALLOC_F_LEN=0x2000
#CONFIG_USB_TCPC=y  这里的typeC开关关掉
CONFIG_TARGET_IMX8MM_DDR4_EVK=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage.cfg,SPL_TEXT_BASE=0x7E1000,ANDROID_SUPPORT"
CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_EFI_PARTITION=y
CONFIG_ARCH_MISC_INIT=y
CONFIG_SPL=y
CONFIG_SPL_BOARD_INIT=y
CONFIG_SPL_MMC_SUPPORT=y

重新编译Zimage

bitbake -c cleansstate imx-boot   //注意  此命令会让修改过的uboot源码恢复git默认代码
bitbake -c compile -f imx-boot 
bitbake imx-boot

用新生成的imx-boot-imx8mmevk-sd.bin-flash_evk替换UUU所调用的同名文件
typeC芯片的问题参考如下链接:
https://app-community.nxp.com/thread/508045

上一篇 下一篇

猜你喜欢

热点阅读