Giter VIP home page Giter VIP logo

mfgtools's Introduction

uuu (Universal Update Utility), mfgtools 3.0

macOS Build Build with VS Studio Build for x64 ubuntu-lastest

GitHub

universal-update-utility

Freescale/NXP I.MX Chip image deploy tools. original linux version uses "linux" branch, windows version uses "windows" branch

uuu (universal update utility) for nxp imx chips -- libuuu-1.0.1-gffd9837

Succeded:0       Failed:3               Wait for Known USB Devices to Appear...

1:11     5/5 [                                        ] SDP: jump -f u-boot-dtb.imx -ivtinitramf....
2:1      1/5 [===>                                    ] SDP: boot -f u-boot-imx7dsabresd_sd.imx ....

Key features

  • The real cross platform. Linux, Windows, MacOS(not test yet)
  • Multi devices program support
  • Daemon mode support
  • Few dependencies (only libusb, zlibc, libbz2)
  • Firmware (uboot/kernel) uses WCID to auto load the winusb driver on the Windows side. Windows7 users need to install the winusb driver from https://zadig.akeo.ie/ Windows10 will install the driver automatically.

Examples:

  uuu u-boot.imx            Download u-boot.imx via HID device

  uuu list.uu               Run all the commands in list.uu

  uuu -s                    Enter shell mode. Input command.

  uuu -v u-boot.imx         verbose mode

  uuu -d u-boot.imx         Once it detects the attachment of a known device, download boot.imx.

                            u-boot.imx can be replaced, new file will be download once board reset.

                            Do not unplug the SD card, write to the SD card, nor plug in a SD card when debugging uboot.

  uuu -b emmc u-boot.imx    write u-boot.imx to emmc boot partition. u-boot.imx need enable fastboot

  uuu -b emmc_all wic.zst   decompress wic.zst file and download the whole image into emmc

Prebuilt Image and pdf document

The prebuilt image and document are here:

How to Build:

Windows

  • git clone --recurse-submodules https://github.com/nxp-imx/mfgtools.git
  • cd mfgtools
  • open msvs/uuu.sln with Visual Studio 2017

Visual Studio

Note that, since uuu is an OSI compliant Open Source project, you are entitled to download and use the freely available Visual Studio Community Edition to build, run or develop for uuu. As per the Visual Studio Community Edition license this applies regardless of whether you are an individual or a corporate user.

Linux

  • git clone https://github.com/nxp-imx/mfgtools.git
  • cd mfgtools
  • sudo apt-get install libusb-1.0-0-dev libbz2-dev libzstd-dev pkg-config cmake libssl-dev g++ zlib1g-dev libtinyxml2-dev
  • cmake . && make

The above commands build mfgtools in source. To build it out of source (requires cmake 3.13 or newer):

  • cmake -S . -B build
  • cmake --build build --target all

For cmake prior 3.13:

  • mkdir build && cd build
  • cmake .. && make

macOS

  • git clone https://github.com/nxp-imx/mfgtools.git
  • cd mfgtools
  • brew install cmake libusb openssl pkg-config tinyxml2
  • cmake -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl . && make

Note that we assume homebrew is installed and can be used to resolve dependencies as shown above. The remaining dependency libbz2 can be resolved via the XCode supplied libraries.

Note if you meet "can't detach kernel driver" try to check libusb version.

brew info libusb
==> libusb: stable 1.0.26 (bottled), HEAD

Run environment

  • Windows 10 64 bit
  • Linux (Ubuntu) 64 bit
  • macOS (Catalina)
  • 32 bit systems will have problems with big files.

License

uuu is licensed under the BSD license. See LICENSE. The BSD licensed prebuilt Windows binary version of uuu is statically linked with the LGPL libusb library, which remains LGPL.

mfgtools's People

Contributors

a3f avatar agners avatar agx avatar alexmitter avatar benjaminjrood avatar brlin-tw avatar capiman avatar cengiz-io avatar deinok avatar dnbazhenov avatar gibsson avatar hanxu-nxp avatar henry-nicolas2021 avatar jmlemetayer avatar ldts avatar lenormandfranck avatar markuspg avatar mrvan avatar mstaack avatar nxpfrankli avatar nxpweilincao avatar okeanos avatar osterlad avatar panicking avatar philm06 avatar raphexion avatar schiffermtq avatar sshen-okta avatar yestyle avatar zyga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mfgtools's Issues

Log output to stdout/stderr (not to file)

if one are used to working with command line tools on linux/unix mfgtoolcli behaviour seems a bit "alien" (at least to me). For example, mfgtoolcli writes log messages to a file in same directory instead of stdout/stderr and the path for this log file is hard-coded to same directory.
Suggestion: by default, only log errors and warnings to stderr. Add verbose option -v, --verbose that will log more detailed debug info to stdout or stderr. User can pipe the output to file if desirable.

Build error undefined reference to symbol 'inflateEnd'

Build error when building on a Arch Linux machine:

[ 93%] Building CXX object uuu/CMakeFiles/uuu.dir/uuu.cpp.o
[ 96%] Linking CXX executable uuu
/usr/bin/ld: ../libuuu/libuuc_s.a(zip.cpp.o): undefined reference to symbol 'inflateEnd'
/usr/lib/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Archlinux

➜ flash sudo uuu -V uuu-dualos-mx8qm-mek-emmc.lst 18:46:11
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.89-0-gd7d8504

Build in config:
Pctl Chip Vid Pid BcdVersion
==================================================
SDPS: MX8QXP 0x1fc9 0x012f [0x0002..0xffff]
SDPS: MX8QM 0x1fc9 0x0129 [0x0002..0xffff]
SDP: MX7D 0x15a2 0x0076
SDP: MX6Q 0x15a2 0x0054
SDP: MX6D 0x15a2 0x0061
SDP: MX6SL 0x15a2 0x0063
SDP: MX6SX 0x15a2 0x0071
SDP: MX6UL 0x15a2 0x007d
SDP: MX6ULL 0x15a2 0x0080
SDP: MX6SLL 0x1fc9 0x0128
SDP: MX7ULP 0x1fc9 0x0126
SDP: MXRT106X 0x1fc9 0x0135
SDP: MX8MM 0x1fc9 0x0134
SDP: MX8MQ 0x1fc9 0x012b
SDPU: SPL 0x0525 0xb4a4 [0x0000..0x04ff]
SDPV: SPL1 0x0525 0xb4a4 [0x0500..0x9998]
SDPU: SPL 0x0525 0xb4a4 [0x9999..0x9999]
FBK: 0x066f 0x9afe
FBK: 0x066f 0x9bff
FB: 0x0525 0xa4a5
FB: 0x18d1 0x0d02
Wait for Known USB Device Appear...

Start Cmd:CFG: FB: -vid 0x1fc9 -pid 0x0129
Okay
New USB Device Attached at 1:2
1:2>Start Cmd:FB: ucmd setenv fastboot_dev mmc
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=2
1:2>Fail Bulk(W):LIBUSB_ERROR_IO

Support of NAND devices ?

Hi,
I'm starting a new work with an iMX6 module and was looking at uuu for loading u-boot + u-boot-env + kernel + dtb + rootfs on the target.
My system has a NAND and I would like to know if uuu is able to load every thing on the target ? There is no example to flash NAND devices, only eMMC.
Else, is it something scheduled ? Else, do you advice an other tool to achieve that ?
Thanks for the help,
Joel

PS : I generate the binaries with yocto.

mfgtools can't to work on i.MX6ULL + evk board

I get "fsl-yocto-L4.9.11_1.0.0.tar.gz" to my host PC.
And I compile the last mfgtools.
When I replace the "libMfgToolLib.so" and "mfgtoolcli" to fsl-yocto-L4.9.11_1.0.0 and run it.

The mfgtools fail run on linux version.
fail log:

ModuleID[2] LevelID[10]: new MxHidDevice[0x7f3d7c004dc0]
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/u-boot-imx6ull14x14evk_sd.imx
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/zImage, address is 0x80800000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot, address is 0x83800000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/zImage-imx6ull-14x14-evk.dtb, address is 0x83000000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Jump[WndIndex:0]
ModuleID[2] LevelID[10]: MxHidDevice[0x7f3d7c004dc0] Jump to Ramkernel successfully!*
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/u-boot-imx6ull14x14evk_sd.imx
ModuleID[2] LevelID[1]: RunPlugIn(): TransData(0x877FF400, 0x7EC00,0x74002380) failed.
ModuleID[2] LevelID[1]: PortMgrDlg(0)--MxHidDevice--Command Boot excute failed

I trace code, it will fail on "Jump".

mfgtoolcli never exit

mfgtoolcli never exit. It seems to flash the device successfully, then it hangs forever.
The --noexit flag is not set in this case.
gdb backtrace after mfgtoolcli is killed by keyboard interrupt signal:

#0  0x00007ffff6e5ef2d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff6e5edc4 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:137
#2  0x000000000040959a in main (argc=16, argv=0x7fffffffe598) at mfgtoolCLI.cpp:422

Relevant lines last in main() function in mfgtoolCLI.cpp:

420     while(true) 
421     { 
422         sleep(3); 
423     } 
424  
425 } 

I am guessing the main thread should wait on working thread(s) to finish and then exit, but I do not find where, so perhaps I am mistaken?

uuu Linux script question for determining emmc device

@nxpfrankli
I am opening a new issue since this is different from the one we were previously discussing. Wanted to repeat that I am using i.MX8M Mini. My uuu script on Linux is able to RAM load u-boot, the kernel and rootfs. I am trying to understand how to determine what my emmc device number is. I saw that the sample script example_kernel_emmc.uuu has the following lines:

#get mmc dev number from kernel command line
#Wait for emmc
FBK: ucmd while [ ! -e /dev/mmcblkboot0 ]; do sleep 1; echo "wait for /dev/mmcblkboot* 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[0]}; dev=${dev#/dev/mmcblk}; dev=${dev%boot*}; echo $dev > /tmp/mmcdev;

Could you please explain how this works? It looks like /tmp/mmcdev in my case is 2. However when I write the various binaries to the correct partitions on /sys/block/mmcblk2, it is unable to load the kernel and stops at u-boot. Here are my u-boot env parameters and their values:
baudrate=115200
boot_fdt=try
bootargs=console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 root=/dev/nfs ip=dhcp nfsroot=:,v3,tcp
bootcmd=mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi
bootcmd_mfg=run mfgtool_args;booti ${loadaddr} ${initrd_addr} ${fdt_addr};
bootdelay=2
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200
ethact=ethernet@30be0000
ethaddr=00:04:9f:05:9b:b5
ethprime=FEC
fdt_addr=0x43000000
fdt_file=fsl-imx8mm-evk.dtb
fdt_high=0xffffffffffffffff
fdtcontroladdr=bc92e3e8
get_cmd=dhcp
image=Image
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
loadaddr=0x40480000
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" clk_ignore_unused
mmcargs=setenv bootargs console=${console} root=${mmcroot}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then booti ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; else echo wait for boot; fi;
mmcdev=0
mmcpart=1
mmcroot=/dev/mmcblk1p2 rootwait rw
netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${loadaddr} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then booti ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; else booti; fi;
script=boot.scr
stderr=serial
stdin=serial
stdout=serial

[QUESTION] Is it supported to combine running scripts with single commands?

Hi,

I have an use-case where I want to run a script fastboot.lst that will make sure I get my device into FB. After entering FB I need to run some FB: flash commands flashing some files. After flashing all my files I would like to run a script again finalize.lst which will run some FB: ucmd. All of this I can successfully do with a single script but when trying to separate into the described setup I always get stuck when going from running the FB: flash to run the finalize.lst script. Is this a scenario that should be supported?

BR
Måns Zigher

uuu tool issue - doesnt detect USB device

Hi,
I have a eval kit from NXP MX8QXPMEK. I can boot it with the pre-configured SD-Card without problems. When I doesnt insert the SD-Card board switches to SDP. In my device manager the board is detected. The old MFGTools shows "HID device detected".

Now I am trying to download the pre-compiled u-boot. When I start the uuu (Version 1.2.91) it shows me the message Wait for Known USB Device Appear... and wait. It look like the USB device (board) is not detected.

How can I solve this?

I am using Windows10 as host system.

regards Haturi

device-manager

uuu output

issue flashing with raspberry host

I builded a uuu on a raspberry pi3
I use the same script on a windows host with no issue
on the raspberry, the script perform about 28 steps without any issue, but fails systematically on

1:15>Start Cmd:FBK: acmd dd of=/dev/mmcblk2p2 bs=1M conv=fsync
1:15>Okay
1:15>Start Cmd:FBK: ucp ../sercomm-image.rootfs.ext4 t:-
1%1:15>Fail Bulk(W):LIBUSB_ERROR_TIMEOUT

I see the progress indicator goes till 10%, then restart a 1% till 7% about, then restart.... and so on util the previous error
I suspect the timeout to be too short... but didn't found in the documentation how I can change the timeout of an FBK command

thanks for your help!

issue with flashing Universal update utility for iMX8MQ

When I tried to flashing the Yocto build Image on the board using UUU tool of the-14-78.

But bootloader is fine, But when I tried to write rootfs.sdcard it giving error log message,
Please clarify the same, I saw some threads, still don't have support for L4.14.78 release?
Is sorted out ??? or still in beta version.

sudo ./uuu/uuu -b emmc_all imx-boot-imx8mq-sd.bin-flash_evk core-image-minimal-imx8mq-20190325111905.rootfs.sdcard

uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.91-5-g8019217

Success 0 Failure 1

3:3 1/ 8 [Bulk(R):LIBUSB_ERROR_TIMEOUT ] FB: ucmd setenv fastboot_dev mmc

usbfs: process uuu did not claim interface 0 before use

I get the following messages in dmesg:

hid-generic 0003:15A2:0080.002A: hiddev2,hidraw4: USB HID v1.10 Device [Freescale SemiConductor Inc SE Blank 6ULL] on usb-0000:00:14.0-3/input0
usb 1-3: usbfs: process 17860 (uuu) did not claim interface 0 before use

[Feature Request] Warning if not started via sudo

On Linux, starting the executable without sudo usually results in the error failure open usb device.
This message could be expanded to include a hint for the proper usage, i.e. failure open usb device. Try running the executable as root..

New jump syntax in uuu [linux]

Hi,
I have the same boot structure as @Koltak, and I want to port his script:

<CMD state="BootStrap" type="boot" body="BootStrap"
	file="firmware/u-boot.imx">Loading U-boot</CMD>
<CMD state="BootStrap" type="load" file="firmware/zImage"
	address="0x12000000" loadSection="OTH" setSection="OTH"
	HasFlashHeader="FALSE">Loading Kernel.</CMD>
<CMD state="BootStrap" type="load"
	file="firmware/zImage.dtb" address="0x18000000"
	loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading device
	tree.</CMD>
<CMD state="BootStrap" type="load"
	file="firmware/image.cpio.gz.u-boot"
	address="0x12C00000" loadSection="OTH" setSection="OTH"
	HasFlashHeader="FALSE">Loading Initramfs.</CMD>
<CMD state="BootStrap" type="jump" >Jumping to OS image.</CMD>

Using the provided examples I came up with (shell mode):

SDP: boot -f u-boot-signed.imx -nojump
SDP: write -f zImage -addr 0x12000000
SDP: write -f zImage.dtb -addr 0x18000000
SDP: write -f image.cpio.gz.u-boot -addr 0x12C00000

This seems to work, but I have no clue how to use the jump afterwards properly. I tried it with the -addr and -f options and all feasible arguments, but I didnt get any result other than segfaults.

Letting out the -nojump flag will result in the startup of the device after line 1, but there is no kernel etc.

Thanks for your help!

Bad Linux ARM zImage magic!

I have a problem about migrate xml file to uuu script.
according to the wiki "migration from ucl2.xml to uuu script"
I converted my xml file to uuu script, but when I run " ./uuu my_uuu_script "
the minicom display "Bad Linux ARM zImage magic!".

when I use mfgtool on windows, it runs ok, I don't know if there are some env parameters related to mfgtool that not be set. or just the problem about kernel.

the uuu scriipt is

uuu_version 1.0.1
SDP: boot -f firmware/uboot-myimx6ek200-6q.imx
FB: ucmd echo boot from uboot


FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: ucmd download -f firmware/mfg-zImage-myimx6

FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: ucmd download -f firmware/initramfs-imx_mfgtools.cpio.gz.u-boot

FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: ucmd download -f firmware/myimx6ek200-6q.dtb



FB: acmd booti ${loadaddr} ${initrd_addr} ${fdt_addr}

FBK: ucmd flash_erase /dev/mtd0 0 0

FBK: ucp files/uboot-myimx6ek200-6q.imx t:/tmp
FBK: ucmd dd if=/tmp/uboot-myimx6ek200-6q.imx of=/dev/mtd0 bs=512 seek=2

FBK: ucp firmware/mksdcard-31452.sh.tar t:/tmp
FBK: ucmd tar xf /tmp/uboot-myimx6ek200-6q.imx 
FBK: ucmd sh mksdcard.sh /dev/mmcblk3

FBK: ucmd mkfs.vfat /dev/mmcblk3p1
FBK: ucmd mkdir -p /mnt/mmcblkxp1
FBK: ucmd mount -t vfat /dev/mmcblk3p1 /mnt/mmcblkxp1

FBK: ucp files/zImage-myimx6 t:/tmp
FBK: ucmd cp /tmp/zImage-myimx6 /mnt/mmcblkxp1/zImage-myimx6
FBK: ucp myimx6ek200-6q.dtb t:/tmp
FBK: ucmd cp /tmp/myimx6ek200-6q.dtb /mnt/mmcblkxp1/myimx6ek200-6q.dtb
FBK: ucmd umount /mnt/mmcblkxp1


FBK: ucmd mkfs.ext3 -j /dev/mmcblk3p2
FBK: ucmd mkdir -p /mnt/mmcblkxp2
FBK: ucmd mount -t ext3 /dev/mmcblk3p2 /mnt/mmcblkxp2

FBK: acmd pipe tar -jxv -C /mnt/mmcblkxp2
FBK: ucp files/armhf-rootfs-ubuntu-xenial.tar.bz2 t:-
FBK: sync
FBK: acmd pipe tar -jxv -C /mnt/mmcblkxp2
FBK: ucp files/kernel-modules-myimx6.tar.bz2 t:-
FBK: sync
FBK: acmd pipe tar -jxv -C /mnt
FBK: ucp files/myzr_rtfs_cfg.tar.bz2 t:-
FBK: sync
FBK: ucmd sh /mnt/myzr_rtfs_cfg.sh /mnt/mmcblkxp2 myimx6ek200 armhf-rootfs-ubuntu-xenial.tar.bz2 normal
FBK: sync
FBK: acmd pipe tar -jxv -C /mnt/mmcblkxp2
FBK: ucp files/l31452_rtfs_update.tar.bz2 t:-
FBK: sync
FBK: acmd pipe tar -jxv -C /mnt/mmcblkxp2/home/root
FBK: ucp files/my-demo.tar.bz2 t:-
FBK: sync
FBK: ucmd umount /mnt/mmcblkxp2
FBK: ucmd echo Update Complete!

and the boot output

U-Boot 2015.04-svn86 (Aug 09 2017 - 10:21:01)                                   
                                                                                
CPU:   Freescale i.MX6Q rev1.5 at 792 MHz                                       
CPU:   Temperature 44 C                                                         
Reset cause: POR                                                                
Board: MYZR i.MX6 Evaluation Kit                                                
Model: MY-IMX6-EK200-6Q-1G                                                      
I2C:   ready                                                                    
DRAM:  1 GiB                                                                    
MMC:   FSL_SDHC: 0, FSL_SDHC: 1                                                 
SF: Detected SST25VF016B with page size 256 Bytes, erase size 4 KiB, total 2 MiB
*** Warning - bad CRC, using default environment                                
                                                                                
No panel detected: default to Hannstar-XGA                                      
Display: Hannstar-XGA (1024x600)                                                
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   FEC [PRIME]                                                              
Boot from USB for mfgtools                                                      
Use default environment for                              mfgtools               
Run bootcmd_mfg: run mfgtool_args; bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot:  0                                                
Bad Linux ARM zImage magic! 

convert an old mfgtools flash script : miss usage documentation

Hi,
I have an old mfgtools script to move to latest 3.0 format, but the documentation is really ligth.... so I don't know what are the commands, I can use

the script is as follow :


* Copyright (C) 2012, Freescale Semiconductor, Inc. All Rights Reserved.
* The CFG element contains a list of recognized usb devices.
*  DEV elements provide a name, class, vid and pid for each device.
*
* Each LIST element contains a list of update instructions.
*  "Install" - Erase media and install firmware.
*  "Update" - Update firmware only.
*
* Each CMD element contains one update instruction of attribute type.
*  "pull" - Does UtpRead(body, file) transaction.
*  "push" - Does UtpWrite(body, file) transaction.
*  "drop" - Does UtpCommand(body) then waits for device to disconnect.
*  "boot" - Finds configured device, forces it to "body" device and downloads "file".
*  "find" - Waits for "timeout" seconds for the "body" device to connect.
*  "show" - Parse and show device info in "file".
--><UCL><CFG><STATE name="BootStrap" dev="MX7D" vid="15A2" pid="0076"/><STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/></CFG><LIST name="eMMC" desc="Choose eMMC as media"><CMD state="BootStrap" type="boot" body="BootStrap" file="firmware/u-boot-imx7d%7duboot%_sd.imx" ifdev="MX7D">Loading U-boot</CMD><CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD><CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD><CMD state="BootStrap" type="load" file="firmware/zImage-imx7d-%7ddtb%.dtb" address="0x83000000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX7D">Loading device tree.</CMD><CMD state="BootStrap" type="jump"> Jumping to OS image. </CMD><!--
 FIXME: mfgtoolcli does NOT check the return code of any
             of the commands issued below (SHE-1054). 
--><!-- create partitions --><CMD state="Updater" type="push" body="send" file="mksdcard.sh">Sending partition shell</CMD><CMD state="Updater" type="push" body="$ sh $FILE /dev/mmcblk%mmc%"> Partitioning...</CMD><!--
 NOTE: all flashed files are not in the directory 'files', but fetched from the BSP deploy directory that is a topfolder of this ucl script 
--><!-- burn uboot --><!--
 The U-Boot environment is located at 0x80000 to 0x80c00 (size ~3 KiB). The following dd command clears region 0x60000 to 0x90000. 
--><!--
 FIXME: Use 'blkdiscard ‐‐secure /dev/mmcblk2 <pos+size>' for wearleveling friendly erasing 
--><CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=192">Clear u-boot environment</CMD><!--
 Clear the whole 1 MiB bootflags reserved space at eMMC offset 10485760 (10 MiB). See README.md. 
--><CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1048576 seek=10 count=1 conv=fsync">Clear bootloader bootflags</CMD><CMD state="Updater" type="push" body="$ printf A       | dd of=/dev/mmcblk%mmc% seek=10485760 bs=1 count=1 conv=fsync">Set active slot to A</CMD><CMD state="Updater" type="push" body="$ printf '\\x03' | dd of=/dev/mmcblk%mmc% seek=10486272 bs=1 count=1 conv=fsync">Set slot A boot count to 3</CMD><CMD state="Updater" type="push" body="$ printf '\\x00' | dd of=/dev/mmcblk%mmc% seek=10486784 bs=1 count=1 conv=fsync">Set slot B boot count to 0</CMD><CMD state="Updater" type="push" body="$ printf Y       | dd of=/dev/mmcblk%mmc% seek=10487296 bs=1 count=1 conv=fsync">Set bootable flag of A to Y</CMD><CMD state="Updater" type="push" body="$ printf N       | dd of=/dev/mmcblk%mmc% seek=10487808 bs=1 count=1 conv=fsync">Set bootable flag of B to N</CMD><CMD state="Updater" type="push" body="$ printf Y       | dd of=/dev/mmcblk%mmc% seek=10488320 bs=1 count=1 conv=fsync">Set successful flag of A to Y</CMD><CMD state="Updater" type="push" body="$ printf N       | dd of=/dev/mmcblk%mmc% seek=10488832 bs=1 count=1 conv=fsync">Set successful flag of B to N</CMD><!-- access boot partition --><CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD><CMD state="Updater" type="push" body="send" file="../../../../u-boot-imx7dsabresd.imx" ifdev="MX7D">Sending u-boot.bin</CMD><CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD><CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD><CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD><!--
 Trash whatever is on the volatile partitions and let the system recreate whatever is needed
--><CMD state="Updater" type="push" body="$ dd conv=fsync if=/dev/zero of=/dev/mmcblk%mmc%p11 bs=1048576 count=10">Cleaning /config partition</CMD><CMD state="Updater" type="push" body="$ dd conv=fsync if=/dev/zero of=/dev/mmcblk%mmc%p12 bs=1048576 count=10">Cleaning /var/log partition</CMD><!--
 clear the key blob used to encrypt/decrypt the config/var-log partitions 
--><CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk2p14 bs=1 count=64 seek=4112">Clear config partition key blob</CMD><!--
 Trash partitions in slot B that were maybe flashed by the OTA update client. 
--><!--
 After flashing the system should be in a consistent state and not booting an outdated system in the Slot B. 
--><!--
 Trashing the first 2 KiB of an ext4 image would be enough to let the mounting fail. To be safe, just trash the first 10 MiB. 
--><CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc%p7 conv=fsync bs=1048576 count=10">Trashing partition / in slot B</CMD><CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc%p8 conv=fsync bs=1048576 count=10">Trashing partition /opt in slot B</CMD><CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc%p9 conv=fsync bs=1048576 count=10">Trashing partition /usr/local in slot B</CMD><CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc%p10 conv=fsync bs=1048576 count=10">Trashing partition /boot in slot B</CMD><!--
 Flash ext4 partitions /, /opt/, /usr/local and /boot. See README.md for partition layout. 
--><CMD state="Updater" type="push" body="pipe dd of=/dev/mmcblk%mmc%p2 bs=1M conv=fsync" file="../../../../sercomm-image.rootfs.ext4" ifdev="MX6UL MX7D">
		Sending and writing rootfs image</CMD><CMD state="Updater" type="push" body="pipe dd of=/dev/mmcblk%mmc%p3 bs=1M conv=fsync" file="../../../../sercomm-image.opt.ext4" ifdev="MX6UL MX7D">
		Sending and writing image for partition /opt</CMD><CMD state="Updater" type="push" body="pipe dd of=/dev/mmcblk%mmc%p5 bs=1M conv=fsync" file="../../../../sercomm-image.usr-local.ext4" ifdev="MX6UL MX7D">
		Sending and writing image for partition /usr/local</CMD><CMD state="Updater" type="push" body="pipe dd of=/dev/mmcblk%mmc%p6 bs=1M conv=fsync" file="../../../../sercomm-image.boot.ext2" ifdev="MX6UL MX7D">
		Sending and writing image for partition /boot</CMD><CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD><!-- The finish token is for mfgtool-flash-all --><CMD state="Updater" type="push" body="$ echo Update Complete!">Finished (token XowTBQSc8J21tILGKL2pKptzRuoKnyqo)</CMD></LIST></UCL>

uuu 1.2.135 missing FBK: 0x066F:0x37FF

Hi,
I'm trying to upload custom Linux image (buildroot) to i.MX6ULL SOM and it appears that uuu is missing VID:PID 0x066F:0x37FF for usb gadget device.

Aborts with `munmap_chunk(): invalid pointer` when built with -O2

uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.31-5-g33fa776                                                                                                                                       

Enjoy auto [tab] command complete by put below script into /etc/bash_completion.d/uuu
  _uuu_autocomplete()
  {
       COMPREPLY=($(/usr/bin/uuu $1 $2 $3))
  }
  complete -o nospace -F _uuu_autocomplete  uuu

Success 1    Failure 0                                                                                                                                                                                            
                                                                                                                                                                                                                   
1:1    4/ 4   [Done                        ] FB: Done                                                                                                                                                              
munmap_chunk(): invalid pointer

The backtrace is

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
        set = {__val = {0, 139716289058560, 140732962586768, 139716289143978, 94210239630512, 94210239630720, 94210239630720, 0, 139712668940032, 4095, 4096, 139716289143978, 7, 0, 1, 281470681751424}}
        pid = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
#1  0x00007f123b27f535 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {139716279555529, 4222451713, 140732962586944, 140732962586944, 140732962586944, 140732962586944, 
              140732962586945, 140732962586945, 140732962586944, 140732962586945, 0, 0, 0, 0, 140732962586416, 140732962586672}}, sa_flags = -230801616, sa_restorer = 0x1000}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007f123b2d6718 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f123b3e129a "%s\n") at ../sysdeps/posix/libc_fatal.c:181
        ap = {{gp_offset = 24, fp_offset = 0, overflow_arg_area = 0x7ffef23e4040, reg_save_area = 0x7ffef23e3fd0}}
        fd = 2
        list = <optimized out>
        nlist = <optimized out>
        cp = <optimized out>
        written = <optimized out>
#3  0x00007f123b2dce3a in malloc_printerr (str=str@entry=0x7f123b3e2c00 "munmap_chunk(): invalid pointer") at malloc.c:5382
No locals.
#4  0x00007f123b2dd3a4 in munmap_chunk (p=<optimized out>) at malloc.c:2830
        size = <optimized out>
        __PRETTY_FUNCTION__ = "munmap_chunk"
        block = <optimized out>
        total_size = <optimized out>
#5  0x000055af05fedf4b in __gnu_cxx::new_allocator<char>::deallocate (this=0x7ffef23e4090, __p=<optimized out>) at /usr/include/c++/8/ext/new_allocator.h:116
No locals.
#6  std::allocator_traits<std::allocator<char> >::deallocate (__a=..., __n=<optimized out>, __p=<optimized out>) at /usr/include/c++/8/bits/alloc_traits.h:462
No locals.
#7  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_destroy (__size=<optimized out>, this=0x7ffef23e4090) at /usr/include/c++/8/bits/basic_string.h:226
No locals.
#8  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose (this=0x7ffef23e4090) at /usr/include/c++/8/bits/basic_string.h:221
No locals.
#9  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string (this=0x7ffef23e4090, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/basic_string.h:657
No locals.
#10 runshell (shell=0) at ./uuu/uuu.cpp:622
        uboot_cmd = 0
        prompt = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7ffef23e40a0 "U>"}, 
          _M_string_length = 2, {_M_local_buf = "U>\000\362\376\177\000\000\377\207B;\022\177\000", _M_allocated_capacity = 140732958522965}}
#11 0x000055af05feb4a8 in main (argc=<optimized out>, argv=<optimized out>) at ./uuu/uuu.cpp:906
        a = <optimized out>
        deamon = <optimized out>
        shell = <optimized out>
        filename = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x55af07db6360 "download/flash_devkit.lst"}, _M_string_length = 25, {_M_local_buf = "\036\000\000\000\000\000\000\000p\004\000\000\000\000\000", _M_allocated_capacity = 30}}
        cmd = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7ffef23e4400 ""}, 
          _M_string_length = 0, {_M_local_buf = "\000\000\000\000\000\000\000\000\351\000\000\000y\000\000", _M_allocated_capacity = 0}}
        ret = 0
        cmd_script = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7ffef23e4420 ""}, 
          _M_string_length = 0, {_M_local_buf = "\000D>\362\376\177\000\000\377\033\001\000\000\000\000", _M_allocated_capacity = 140732962587648}}
        nt_session = {_M_t = {
--Type <RET> for more, q to quit, c to continue without paging--
            _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<unsigned long const, ShowNotify> > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned long const, ShowNotify> > >> = {<No data fields>}, <No data fields>}, <std::_Rb_tree_key_compare<std::less<unsigned long> >> = {
                _M_key_compare = {<std::binary_function<unsigned long, unsigned long, bool>> = {<No data fields>}, <No data fields>}}, <std::_Rb_tree_header> = {_M_header = {_M_color = std::_S_red, 
                  _M_parent = 0x0, _M_left = 0x7ffef23e43a8, _M_right = 0x7ffef23e43a8}, _M_node_count = 0}, <No data fields>}}}

GCC 7.1 build error in CString.h

GCC 7.1 errors with the following when building. Works fine on GCC 5.x.

[  2%] Building CXX object CMakeFiles/MfgToolLib.dir/CmdOperation.cpp.o
/usr/bin/c++  -DMfgToolLib_EXPORTS -I/home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib -I/usr/include/libusb-1.0  -std=c++11 -O0 -fpic -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux -fpermissive -g -Wno-write-strings -fPIC   -o CMakeFiles/MfgToolLib.dir/CmdOperation.cpp.o -c /home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/CmdOperation.cpp
In file included from /home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/lnx_def.h:46:0,
                 from /home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/stdafx.h:83,
                 from /home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/CmdOperation.cpp:32:
/home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/CString.h: In member function ‘void CTString<T>::TrimLeft(T)’:
/home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/CString.h:179:33: error: no matching function for call to ‘CTString<T>::at(std::__cxx11::basic_string<char>::iterator)’
    while (this->at(this->begin()) == chr){

[...]
/home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/CString.h:204:32: error: no matching function for call to ‘CTString<T>::at(std::__cxx11::basic_string<char>::iterator)’
      if (this->at(this->begin()) == chr[i]){

[...]
/home/thrackerzod/src/3rdparty/NXPmicro/mfgtools/MfgToolLib/CString.h:223:30: error: no matching function for call to ‘CTString<T>::at(std::__cxx11::basic_string<char>::iterator)’
      if (this->at(this->end()) == chr[i]){

The errors all seem to be caused by trying to use an iterator as an index.

Missing USB/UTP support in uuu?

Hello,

Mfgtools (mfgtoolcli) has the support to run commands on the target using the USB/UTP protocol. I didn't find this feature in uuu.

Is it possible to run commands on the target with uuu? If so, how?

issue to flashing the i.MX 8M Quad EVK Board

here is the log:
E:\IMX8\android_p9.0.0_1.0.0-beta_image_8qmek>uuu.exe uuu-android-mx8qm-mek-emmc.lst
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.39-4-g219e333

Success 0 Failure 1

   1/ 0   [                            ]

1:6 1/21 [Bulk(W):LIBUSB_ERROR_NOT_FOU] FB: ucmd setenv fastboot_dev mmc

file transfer from target to windows PC

I run the following command to transfer a file from Target to Host PC running windows
FBK: ucp /tmp/file.txt file.txt
file.txt is successfully transfered to the Host PC. But the content seems to be all zeros.

Jump command not working in Linux client

Hello,

I am currently trying to get the mfgtoolcli to work, but there are some issues, that I can't resolve on my own:

When trying to flash my board using the mfgtool, using the jump command doesn't seem to have any effect.
The command chain in question is:

<CMD state="BootStrap" type="boot" body="BootStrap"
	file="firmware/u-boot.imx">Loading U-boot</CMD>
<CMD state="BootStrap" type="load" file="firmware/zImage"
	address="0x12000000" loadSection="OTH" setSection="OTH"
	HasFlashHeader="FALSE">Loading Kernel.</CMD>
<CMD state="BootStrap" type="load"
	file="firmware/zImage.dtb" address="0x18000000"
	loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading device
	tree.</CMD>
<CMD state="BootStrap" type="load"
	file="firmware/image.cpio.gz.u-boot"
	address="0x12C00000" loadSection="OTH" setSection="OTH"
	HasFlashHeader="FALSE">Loading Initramfs.</CMD>
<CMD state="BootStrap" type="jump" >Jumping to OS image.</CMD>

For my setup, I tried both: Native Linux with Windows guest, as well as native Windows with Linux guest.
For both setups, the WIndows version seems to work, while the Linux doesnt.

Analyzing the USB traffic with wireshark leads me to believe, that we simply do not get answers from the board, i.e. the Windows version shows an interrupt coming from the board after sending the jump command, while the Linux version shows nothing.

The curious thing about this behaviour is, that the packages sent look exactly the same for each setup (Win-host packets == Lin-guest packets and Lin-host packets == Win-guest packets).
This leads me to believe, that some earlier stage of the setup differs between the Windows and Linux edition.

ucl2.xml's Setting setSection="APP" not working

Hello,

When using setSection="APP" after loading all files during the bootstrap phase, the tool seems to hang endlessly, without apparent user feedback. Fail messages can only be found within the log.

Debugging reveals, that this happens inside MxHidDevice.cpp's function BOOL MxHidDevice::AddIvtHdr(UINT32 ImageStartAddr). Here, the line if(memcmp(FlashHdr, Tempbuf, ROM_TRANSFER_SIZE)!= 0 ) returns false.

This may happen due to the unsigned int FlashHdrAddr being first set to equal 0, then we substract some value from it, resulting in a very high memory address value.

Debug build broken?

$ cmake -DCMAKE_BUILD_TYPE=Debug .
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
CMake Error at CMakeLists.txt:181 (add_library):
  add_library cannot create target "MfgToolLib" because another target with
  the same name already exists.  The existing target is a static library
  created in source directory "/home/sfrank/ws/mfgtools/MfgToolLib".  See
  documentation for policy CMP0002 for more details.

I believe this is due to multiple entries of the following

  set(SOURCES ${SOURCES_})
  add_library( MfgToolLib ${SOURCES} )

in CMakeLists.txt, but I'm not sure.

Also, shouldn’t the Debug build set the -ggdb flag?

unable to flash from low memory host

When trying to flash 3.4 GB image file, the uuu utility aborts with:
Wait for Known USB Device Appear...
Error: fail open file: >devkit.img

And the strace displays:
open("devkit.img", O_RDONLY|O_LARGEFILE) = 3
mmap2(NULL, 3600000000, PROT_READ, MAP_SHARED, 3, 0) = -1 ENOMEM (Cannot allocate memory)

The host is 32bit linux machine, and it will never see that much of memory. It is bigger then available address space.

Poor file transfer performance on windows mfgtools v2.8?

Hi,

I found when I using mfgtools 2.6.2, the transfer data(system.img, userdata.img etc.) speed can reach 18MB/s

But I compile latest windows mfgtools(v2.8). The speed drop to only around 2.8MB/s

Is any change make this result?

Thanks

IMX8M Mini UUU tool issue

Hi ,
I have downloaded pre-built uuu tool binary version 1.2.0 & 1.2.91 from NXPmicro/mfgtools repo.

  • I have installed Ubuntu 18.04 in my windows as a virtual machine and forwarded the USB OTG (imx8mm mini eval board ) as a USB device to the virtual machine.
  • The core-minimal-image has been built.
  • The core-minim-image-xx-sdcard.bz2 and imx8xxx-sd.bin-flash_evk files have been copied into the virtual machine.
  • The uuu.auto file is present in the same folder where the images are available.
  • Make sure that NXP semiconductor device is available in the virtual machine using lsusb command.
  • The following command executed in linux machine
    - sudo ./uuu Images/
    - The "images" is a directory where the core-minimal-image and imx8xx-sd.bin-flashe_evk files are available.
  • After executing the above command, the first command alone executed and the uuu tool is not proceeding further.
  • When I have verified the lsusb, the NXP semiconductor USB device is not visisble.
  • Not sure why this is happening only in Linux and the same version of UUU tool works well in Windows machine.

Logs for reference

myVirtualBox:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 010: ID 1fc9:0134 NXP Semiconductors
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

UUU logs :

uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.91-0-g3799f4d

SDP: boot -f images/imx-boot-imx8xx-sd.bin-flash_evk

This command will be run when use SPL

SDPU: delay 1000
SDPU: write -f images/imx-boot-imx8xx-sd.bin-flash_evk -offset 0x57c00
SDPU: jump

This command will be run when ROM support stream mode

SDPS: boot -f images/imx-boot-imx8xxx-sd.bin-flash_evk

Wait for Known USB Device Appear
New USB Device Attached at 1:2
1:2>Start Cmd:SDP: boot -f images/imx-boot-imx8xx-sd.bin-flash_evk
6400%1:2>Okay

[Question] IMX8QM load bootloader and exit

Hello,
I didn't figure out how just to load bootloader over SDP and exit when it has started ?
I don't want uuu to still waiting.

zaki@xps:~/Desktop/B2-B0$ sudo uuu -v uuu.auto
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.56-3-g0ffa8ea

Build in config:
Pctl Chip Vid Pid BcdVersion
==================================================
SDPS: MX8QXP 0x1fc9 0x012f [0x0002..0xffff]
SDPS: MX8QM 0x1fc9 0x0129 [0x0002..0xffff]
SDP: MX7D 0x15a2 0x0076
SDP: MX6Q 0x15a2 0x0054
SDP: MX6D 0x15a2 0x0061
SDP: MX6SL 0x15a2 0x0063
SDP: MX6SX 0x15a2 0x0071
SDP: MX6UL 0x15a2 0x007d
SDP: MX6ULL 0x15a2 0x0080
SDP: MX6SLL 0x1fc9 0x0128
SDP: MX7ULP 0x1fc9 0x0126
SDP: MXRT106X 0x1fc9 0x0135
SDP: MX8MM 0x1fc9 0x0134
SDP: MX8MQ 0x1fc9 0x012b
SDPU: SPL 0x0525 0xb4a4 [0x0000..0x04ff]
SDPV: SPL1 0x0525 0xb4a4 [0x0500..0xffff]
FBK: 0x066f 0x9afe
FBK: 0x066f 0x9bff
FB: 0x0525 0xa4a5
FB: 0x18d1 0x0d02
Wait for Known USB Device Appear...
New USB Device Attached at 3:26
New USB Device Attached at 3:26
3:26>Start Cmd:SDPS: boot -f flash.bin
100%3:26>Okay
New USB Device Attached at 3:26

"Failed to initialize memory!"

I tried to flash my iMX.6D custom board with mfgtoolscli and this error came up. The command was

sudo ./mfgtoolcli -c Linux -l eMMC -s board=sabresd -s sxdtb=sdb -s mmc=3

Here is the log.

DLL version: 2.3.4
Thu Jul 13 14:30:07 2017
   Start new logging
ModuleID[2] LevelID[10]: address from XML 0x12000000 

ModuleID[2] LevelID[10]: address from XML 0x80800000 

ModuleID[2] LevelID[10]: address from XML 0x12C00000 

ModuleID[2] LevelID[10]: address from XML 0x83800000 

ModuleID[2] LevelID[10]: address from XML 0x18000000 

ModuleID[2] LevelID[10]: address from XML 0x18000000 

ModuleID[2] LevelID[10]: address from XML 0x83000000 

ModuleID[2] LevelID[10]: address from XML 0x83000000 

ModuleID[2] LevelID[10]: address from XML 0x83000000 

ModuleID[2] LevelID[10]: CMyExceptionHandler thread is running
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[10]: Add USB device

ModuleID[2] LevelID[10]: Create Device 0x7f5d10003fc0

ModuleID[2] LevelID[10]: new MxHidDevice[0x7f5d10003fc0]
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/u-boot-imx6qsabresd_sd.imx
ModuleID[2] LevelID[10]:  Trans Data address is 177ff400 

ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/zImage, address is 0x12000000
ModuleID[2] LevelID[10]:  Trans Data address is 12000000 

ModuleID[2] LevelID[10]:  Trans Data address is 12200000 

ModuleID[2] LevelID[10]:  Trans Data address is 12400000 

ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot, address is 0x12C00000
ModuleID[2] LevelID[10]:  Trans Data address is 12c00000 

ModuleID[2] LevelID[10]:  Trans Data address is 12e00000 

ModuleID[2] LevelID[10]:  Trans Data address is 13000000 

ModuleID[2] LevelID[10]:  Trans Data address is 13200000 

ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/zImage-imx6q-sabresd.dtb, address is 0x18000000
ModuleID[2] LevelID[10]:  Trans Data address is 18000000 

ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Jump[WndIndex:0]
ModuleID[2] LevelID[10]: *********MxHidDevice[0x7f5d10003fc0] Jump to Ramkernel successfully!**********
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is ./Profiles/Linux/OS Firmware/firmware/u-boot-imx6qsabresd_sd.imx
ModuleID[2] LevelID[1]: Failed to initialize memory!
ModuleID[2] LevelID[1]: PortMgrDlg(0)--MxHidDevice--Command Boot excute failed

And this is the commands in ucl2.xml.

	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6q%plus%%board%_sd.imx" ifdev="MX6Q">Loading U-boot</CMD>
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6dl%board%_sd.imx" ifdev="MX6D">Loading U-boot</CMD>
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6sx%board%_emmc.imx" ifdev="MX6SX">Loading U-boot</CMD>
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx7d%7duboot%_sd.imx" ifdev="MX7D">Loading U-boot</CMD>
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ul%6uluboot%_emmc.imx" ifdev="MX6UL">Loading U-boot</CMD>
		
	<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x12000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">Loading Kernel.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x12C00000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">Loading Initramfs.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6q%plus%-%board%%ldo%.dtb" address="0x18000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q">Loading device tree.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6dl-%board%%ldo%.dtb" address="0x18000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6D">Loading device tree.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6sx-%sxdtb%-emmc.dtb" address="0x83000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SX">Loading device tree.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/zImage-imx7d-%7ddtb%.dtb" address="0x83000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX7D">Loading device tree.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6ul-%6uldtb%-emmc.dtb" address="0x83000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL">Loading device tree.</CMD>

	<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>


	<!-- create partition -->
	<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
	<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
	<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

	<!-- burn uboot -->
	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
	<!-- access boot partition -->
	<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot.imx" ifdev="MX6Q">Sending u-boot.bin</CMD>
	
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to EMMC</CMD>
	<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
	<CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>

	<!-- create fat partition -->
	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p1"/>
	<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk%mmc%p1 /mnt/mmcblk%mmc%p1"/>

	<!-- burn zImage -->
	<CMD state="Updater" type="push" body="send" file="files/zImage">Sending kernel zImage</CMD>
	<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk%mmc%p1/zImage">write kernel image to sd card</CMD>

	<!-- burn dtb -->
	<CMD state="Updater" type="push" body="send" file="files/imx6q%plus%-%board%%ldo%.dtb" ifdev="MX6Q">Sending Device Tree file</CMD>
	<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk%mmc%p1/imx6q%plus%-%board%.dtb" ifdev="MX6Q">write device tree to sd card</CMD>

	<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p1">Unmounting vfat partition</CMD>

	<!-- burn rootfs -->
	<CMD state="Updater" type="push" body="$ mkfs.ext3 -E nodiscard /dev/mmcblk%mmc%p2">Formatting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p2"/>
	<CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk%mmc%p2 /mnt/mmcblk%mmc%p2"/>
	<CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk%mmc%p2" file="files/rootfs.tar.bz2" ifdev="MX6SL MX6D MX6Q MX6SX">Sending and writting rootfs</CMD>

	<CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
	<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p2">Unmounting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

I took a quick glance in the source code and this is the part that failed.

if ( !DCDWrite((PUCHAR)(pDCDRegion),TotalDCDDataCnt) )
{
    LogMsg(LOG_MODULE_MFGTOOL_LIB, LOG_LEVEL_FATAL_ERROR, _T("Failed to initialize memory!"));
    goto ERR_HANDLE;
}

Can anyone give me a hint about what could possibly go wrong and how to fix this? I'm running this on Gentoo 64-bit and lsusb reports Bus 003 Device 057: ID 15a2:0054 Freescale Semiconductor, Inc. i.MX 6Dual/6Quad SystemOnChip in RecoveryMode, for what it's worth. Thank you.

[ufb] endpoint configuration mismatch

Hello again,
after I started the ufb client, the USB entry point declined the built-in configuration.
It is an errno 22 so I expect the Value to be declined. Probably an endianess (LSB) or padding issue (32bit).
Debugged by printing out the data in the g_descriptors yields:

Linux version 4.1.15 (Grinimod@pc) (gcc version 5.3.0 (GCC) ) #1 SMP PREEMPT Thu Jul 26 14:43:58 CEST 2018
uuu fastboot client 1.0.0 [built Jul 27 2018 15:41:56]
Start init usb
write descriptor failure
errno: 22
0x03 0x00 0x00 0x00 0xE4 0x00 0x00 0x00 0x0F 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x09 0x04 0x00 0x00 0x02 0xFF 0x00 0x00 0x01 0x07 0x05 0x81 0x02 0x00 0x00 0x00 0x07 0x05 0x02 0x02 0x00 0x00 0x00 0x09 0x04 0x00 0x00 0x02 0xFF 0x00 0x00 0x01 0x07 0x05 0x81 0x02 0x00 0x02 0x00 0x07 0x05 0x02 0x02 0x00 0x02 0x01 0x09 0x04 0x00 0x00 0x02 0xFF 0x00 0x00 0x01 0x07 0x05 0x81 0x02 0x00 0x04 0x00 0x06 0x30 0x00 0x00 0x00 0x00 0x07 0x05 0x02 0x02 0x00 0x04 0x01 0x06 0x30 0x00 0x00 0x00 0x00 0x01 0x23 0x00 0x00 0x00 0x01 0x00 0x04 0x00 0x01 0x00 0x00 0x01 0x57 0x49 0x4E 0x55 0x53 0x42 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x54 0x00 0x00 0x00 0x01 0x00 0x05 0x00 0x01 0x00 0x49 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x14 0x00 0x44 0x65 0x76 0x69 0x63 0x65 0x49 0x6E 0x74 0x65 0x72 0x66 0x61 0x63 0x65 0x47 0x55 0x49 0x44 0x00 0x27 0x00 0x00 0x00 0x7B 0x34 0x38 0x36 0x36 0x33 0x31 0x39 0x41 0x2D 0x46 0x34 0x44 0x36 0x2D 0x34 0x33 0x37 0x34 0x2D 0x39 0x33 0x42 0x39 0x2D 0x44 0x43 0x32 0x44 0x45 0x42 0x33 0x36 0x31 0x42 0x41 0x39 0x7D 0x00 
(Split data)
Header: 0x03 0x00 0x00 0x00 0xE4 0x00 0x00 0x00 0x0F 0x00 0x00 0x00 
Fullspeed
Entrypoint: 0x09 0x04 0x00 0x00 0x02 0xFF 0x00 0x00 0x01 
Sink: 0x07 0x05 0x81 0x02 0x00 0x00 0x00 
Source: 0x07 0x05 0x02 0x02 0x00 0x00 0x00 
Highspeed
Entrypoint: 0x09 0x04 0x00 0x00 0x02 0xFF 0x00 0x00 0x01 
Sink: 0x07 0x05 0x81 0x02 0x00 0x02 0x00 
Source: 0x07 0x05 0x02 0x02 0x00 0x02 0x01

I could not find an error yet (comparing to https://elixir.bootlin.com/linux/v4.1.15/source/include/uapi/linux/usb/functionfs.h) but E4 (228) bytes are a long way to go...

U-boot flashing on iMX8MQ not working

Hello,
we have just started to use UUU for Linux (previously we used mfgtools on windows).
For now we are only trying to flash u-boot on the eMMC.

Here is the command used:

./uuu -V -b emmc flash.bin
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.91-6-ge742d94

Build in config:
	Pctl	 Chip		 Vid	 Pid	 BcdVersion
	==================================================
	SDPS:	 MX8QXP		 0x1fc9	 0x012f	 [0x0002..0xffff]
	SDPS:	 MX8QM		 0x1fc9	 0x0129	 [0x0002..0xffff]
	SDPS:	 MX28		 0x15a2	 0x004f
	SDP:	 MX7D		 0x15a2	 0x0076
	SDP:	 MX6Q		 0x15a2	 0x0054
	SDP:	 MX6D		 0x15a2	 0x0061
	SDP:	 MX6SL		 0x15a2	 0x0063
	SDP:	 MX6SX		 0x15a2	 0x0071
	SDP:	 MX6UL		 0x15a2	 0x007d
	SDP:	 MX6ULL		 0x15a2	 0x0080
	SDP:	 MX6SLL		 0x1fc9	 0x0128
	SDP:	 MX7ULP		 0x1fc9	 0x0126
	SDP:	 MXRT106X	 0x1fc9	 0x0135
	SDP:	 MX8MM		 0x1fc9	 0x0134
	SDP:	 MX8MQ		 0x1fc9	 0x012b
	SDPU:	 SPL		 0x0525	 0xb4a4	 [0x0000..0x04ff]
	SDPV:	 SPL1		 0x0525	 0xb4a4	 [0x0500..0x9998]
	SDPU:	 SPL		 0x0525	 0xb4a4	 [0x9999..0x9999]
	FBK:	 		 0x066f	 0x9afe
	FBK:	 		 0x066f	 0x9bff
	FB:	 		 0x0525	 0xa4a5
	FB:	 		 0x18d1	 0x0d02

Run built-in script:

uuu_version 1.2.39

# @flash.bin            | bootloader
# @flash.bin   [flash.bin] | image burn to emmc, default is the same as bootloader

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f flash.bin

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f flash.bin

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f 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 flash.bin -skipspl
SDPV: jump
# }

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash 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


Wait for Known USB Device Appear...
New USB Device Attached at 1:16
1:16>Start Cmd:SDP: boot -f flash.bin
6400%1:16>Okay

The serial log from the iMX8MQ processor is the following:

U-Boot SPL 2017.03-imx_v2017.03_4.9.88_2.0.0_ga+gb76bb1b (Feb 25 2019 - 13:19:14)
PMIC:  PFUZE100 ID=0x10
check ddr4_pmu_train_imem code
check ddr4_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr4_pmu_train_dmem code pass
Training PASS
check ddr4_pmu_train_imem code
check ddr4_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr4_pmu_train_dmem code pass
Training PASS
check ddr4_pmu_train_imem code
check ddr4_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr4_pmu_train_dmem code pass
Training PASS
Back to ROM, SDP

After this, the whole process freeze, nothing happens.

Do you have any suggestions on what is happening?

could not open USB Device

I am using the linux version of this tool. When using mfgtoolcli -l mmc -p 1, it cannot open the USB device.

dmesg and lusb shows:

# dmesg
[11733.680522] usb 3-11.4.4: new high-speed USB device number 18 using xhci_hcd
[11733.772035] hid-generic 0003:15A2:004F.0007: hiddev0,hidraw4: USB HID v1.10 Device [Freescale,Inc. ROM Recovery] on usb-0000:00:14.0-11.4.4/input0

# lsusb
Bus 003 Device 018: ID 15a2:004f Freescale Semiconductor, Inc. i.MX28 SystemOnChip in RecoveryMode

The log shows:

ModuleID[2] LevelID[1]: new HidDeviceClass
ModuleID[2] LevelID[10]: Add USB device
ModuleID[2] LevelID[10]: Create Device (nil)
ModuleID[2] LevelID[1]: failed to open no access
ModuleID[2] LevelID[1]: could not open USB Device

The CFG section in ucl2.xml is:

  <CFG>
    <STATE name="BootStrap" dev="MX28" vid="15A2" pid="004F"/>
    <STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/>
  </CFG>

imx8mmevk libusb error timeout

When trying to load code onto sd card on the imx8mmevk board, with the following command:

sudo ./uuu/uuu -b sd_all ~/imx-boot-imx8mmevk-sd.bin ~/core-image-minimal-imx8mmevk.sdcard
I get:

uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.1.87-3-g9d88a8c

Success 0    Failure 1

1:1    1/ 1   [HID(W):LIBUSB_ERROR_TIMEOUT ] SDP: boot -f /home/austinf/imx-boot-imx8mmevk-sd.bin

Not sure how to debug what's going wrong further.

mfgtool doesn't wait for command to finish before starting next command

For our build we format the eMMC and then push our build to it. If I run mfgtoocli normally it gets to the point where it is pushing over our files and hangs. If I run it in a debugger and break at COpCmd_Push::ExecuteCommand and wait for the eMMC reformat command to report success (UTP: sending Success to kernel for command) then it works. It looks like the library isn't waiting for the device to report back before moving on.

Please use annotated git tags (instead of lightweight ones) for releases

This will give the tag itself (and not only the referenced commit) an author and date (making it easier to figure out when and by whom the release was created).

The only thing that changes is passing in a commit message when creating the tag;

git tag -m"uuu 1.2.92" uuu_1.2.92

Additionally you can (optionally) gpg sign tags

git tag -s -m"uuu 1.2.92" uuu_1.2.92

which would be even nicer.

For more details see e.g.

https://stackoverflow.com/questions/11514075/what-is-the-difference-between-an-annotated-and-unannotated-tag

This also allows to drop the '--tags' from libuuu/gen_vers.sh

The difference looks like:

lightweight tag

commit 3799f4d7b0464cc9253b4597ba7ccc54deefca20 (tag: uuu_1.2.91)
Author: Frank Li <[email protected]>
Date:   Mon Feb 25 11:28:13 2019 -0600

    fix uuu -b qspi flash_qxp_spl.flexspi failure problem
    
    The size of spl image should not include offset
    
    Signed-off-by: Frank Li <[email protected]>

diff --git a/libuuu/rominfo.cpp b/libuuu/rominfo.cpp
index dc0fb0d..6e23f0d 100644
--- a/libuuu/rominfo.cpp
+++ b/libuuu/rominfo.cpp
@@ -133,7 +133,7 @@ size_t GetContainerActualSize(shared_ptr<FileBuffer> p, size_t offset)
                + sizeof(struct rom_container)
                + sizeof(struct rom_bootimg) * (hdr->num_images - 1));
 
-       uint32_t sz = image->size + image->offset + offset + CONTAINER_HDR_ALIGNMENT;
+       uint32_t sz = image->size + image->offset + CONTAINER_HDR_ALIGNMENT;
 
        sz = round_up(sz, CONTAINER_HDR_ALIGNMENT);

annotated tag

See the new tag object in upfront:

tag uuu_1.2.92
Tagger: Guido Günther <[email protected]>
Date:   Wed Apr 10 10:32:51 2019 +0200

uuu 1.2.92

commit 6b465581bed5a93188781189bc9c73b56e65a1bc (HEAD -> master, tag: uuu_1.2.92, tag: pureos/1.2.91+0git6b465, purism+rw/master, github/master)
Author: Frank Li <[email protected]>
Date:   Tue Apr 9 12:31:39 2019 -0500

    enable -O2 for build option
    
    Signed-off-by: Frank Li <[email protected]>

diff --git a/libuuu/CMakeLists.txt b/libuuu/CMakeLists.txt
index 740d7ed..5f5ce97 100644
--- a/libuuu/CMakeLists.txt
+++ b/libuuu/CMakeLists.txt
@@ -11,6 +11,7 @@ find_package(Threads)
 include_directories(${LIBUSB_INCLUDE_DIRS} include)
 
 set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wstrict-aliasing -Wextra")
+set(CMAKE_CXX_FLAGS "-O2")
 
 set(SOURCES
        error.cpp
diff --git a/uuu/CMakeLists.txt b/uuu/CMakeLists.txt
index a2d8c87..c299715 100644
--- a/uuu/CMakeLists.txt
+++ b/uuu/CMakeLists.txt
@@ -10,7 +10,7 @@ pkg_check_modules(LIBZ REQUIRED zlib)
 find_package(Threads)
 
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -O2")
 
 if (NOT APPLE)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc")

uuu 1.2.135 FBK usblib Bulk(R):LIBUSB_ERROR_PIPE

Hi,
When running FBK command:
FBK: ucmd mount -t debugfs debugfs /sys/kernel/debug
I'm getting this:
[Bulk(R):LIBUSB_ERROR_PIPE ]
uuu is ran on Debian in VirtualBox 6 on Win10 x64 host. SDP is working fine.
CPU: i.MX6ULL

Best regards, Lukasz

Communication via FBK in uuu/ufb

Hi,
currently I am not able to receive/process FBK (ucmd) messages on my device. The first sent data package is

0000   80 74 0b fb 1a 95 ff ff 53 03 01 0a 01 00 2d 00
0010   8f dc 51 5b 00 00 00 00 b9 c0 02 00 8d ff ff ff
0020   0f 00 00 00 0f 00 00 00 00 00 00 00 00 00 00 00
0030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0040   55 43 6d 64 3a 65 63 68 6f 20 48 65 6c 6c 6f

(USB URB_BULK captured by wireshark)
of which the last line translates to the command
UCmd:echo Hello
Running the ufb client on the imx will result in reading from /dev/utp*
forever in the main-loop.

I expect my custom linuxrc to be insufficient, so I would kindly ask for a minimal example utilizing only uuu (single UDC)

FYI: I am using yocto krogoth but an update to rocko is pending

linux 'Error: mmap failure'

Cloned latest and built, when run I get:

uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.1.87-3-g9d88a8c

Wait for Known USB Device Appear
Error: mmap failure

This is both with and without device attached

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.