Hello,
Mainly I am trying the mfgtool (not uuu) under Windows in a VirtualBox, that one hangs because the device that is created under Windows is malfunctioning, practically its creating the storage device (Linux 3.0.35+ with fsl-usb2-udc) when I attach the USB device, but nothing is mounted and the device is marked as invalid, therefore the mfgtool can't see it.
Config of mfg tool on Windows:
<UCL>
<CFG>
<STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>
<STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/>
</CFG>
<!-- GHAC -->
<LIST name="GHAC-NAND" desc="Choose NAND as media">
<CMD state="BootStrap" type="find" body="Recovery" timeout="180"/>
<CMD state="BootStrap" type="boot" body="Recovery" file ="u-boot-ghac-mfg.bin" >Loading uboot.</CMD>
<CMD state="BootStrap" type="load" file="uImage-mfg" address="0x10800000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Doing Kernel.</CMD>
<CMD state="BootStrap" type="load" file="initramfs.cpio.gz.uboot" address="0x10C00000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Doing Initramfs.</CMD>
<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>
<CMD state="BootStrap" type="find" body="Updater" timeout="180"/>
<CMD state="Updater" type="push" body="$ flash_erase /dev/mtd0 0 0">Erasing U-boot partition</CMD>
...
Log of mfgtool on Windows:
Wednesday, December 01, 2021 23:18:07 Start new logging
ModuleID[2] LevelID[10]: CMyExceptionHandler thread is running
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[10]: new MxHidDevice[02DB2918]
ModuleID[2] LevelID[10]: Device Manager thread is running
ModuleID[2] LevelID[10]: CmdOperation[0] device chagned and reset to state 0
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is Z:\mfgtool_4_1_0-ghac-20141113\Profiles\MX6Q Linux Update\OS Firmware\u-boot-mfg-good.bin
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is Z:\mfgtool_4_1_0-ghac-20141113\Profiles\MX6Q Linux Update\OS Firmware\uImage-mfg, address is 0x10800000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is Z:\mfgtool_4_1_0-ghac-20141113\Profiles\MX6Q Linux Update\OS Firmware\initramfs.cpio.gz.uboot, address is 0x10C00000
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[02DB2918] Jump to Ramkernel successfully!**********
ModuleID[2] LevelID[10]: CmdOperation[0], current state command has been finished and the last command is successful, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: DeviceManager::DevChangeWnd::OnDeviceChange() - DEVICE_REMOVAL_EVT(\\?\USB#VID_15A2&PID_0054#5&18f54cb7&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed})
ModuleID[2] LevelID[10]: DeviceManager::DevChangeWnd::OnDeviceChange() - end
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent() - DEVICE_REMOVAL_EVT(\\?\USB#VID_15A2&PID_0054#5&18f54cb7&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed})
ModuleID[2] LevelID[10]: DeviceClass::FindDeviceByUsbPath--DeviceListType_Current, _devices.size: 1
ModuleID[2] LevelID[10]: DeviceClass::FindDeviceByUsbPath--DeviceListType_Current, devInstPathToFind: USB\VID_15A2&PID_0054\5&18F54CB7&0&2, _deviceInstanceID: USB\VID_15A2&PID_0054\5&18F54CB7&0&2
ModuleID[2] LevelID[10]: DeviceClass::FindDeviceByUsbPath--DeviceListType_Current, Find the device
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent() - DEVICE_REMOVAL_EVT,[MxHidDeviceClass] vid_15a2&pid_0054, Hub:1-Port:2
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent() - DEVICE_REMOVAL_EVT, Notify
ModuleID[2] LevelID[10]: CmdOpreation[0]--OnDeviceChangeNotify, Volume Arrive/Remove or Device Arrive/Remove
ModuleID[2] LevelID[10]: CmdOpreation[0]--OnDeviceChangeNotify, m_p_usb_port is not NULL, so only refresh
ModuleID[2] LevelID[10]: CmdOpreation[0]--OnDeviceChangeNotify, Volume/Device Remove
ModuleID[2] LevelID[1]: CmdOpreation[0]--set m_hDeviceRemoveEvent.
ModuleID[2] LevelID[10]: CmdOpreation[0]--WaitforEvents device remove1
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent()-DEVICE_REMOVAL_EVT, hDevCanDeleteEvent has been set
ModuleID[2] LevelID[10]: delete MxHidDevice[02DB2918]
ModuleID[2] LevelID[10]: CCmdOpreation[0] thread is Closed
ModuleID[2] LevelID[10]: CCmdOpreation[0] thread is Closed
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent() - EVENT_KILL
ModuleID[2] LevelID[10]: CMyExceptionHandler::OnMsgExceptionEvent() - KillExceptionHandlerThread
ModuleID[2] LevelID[10]: Exception Handler thread is closed
ModuleID[2] LevelID[1]: delete MxHidDeviceClass
ModuleID[2] LevelID[10]: Device Manager thread is closed
Windows error:
Device USB\VID_066F&PID_37FF\5&18f54cb7&0&2 had a problem starting.
Driver Name: usbstor.inf
Class Guid: {36fc9e60-c465-11cf-8056-444553540000}
Service: USBSTOR
Lower Filters:
Upper Filters:
Problem: 0xA
Problem Status: 0xC000000D
Then I did also further debugging directly on Linux with uuu and I saw the errors posted in the previous post. I did this on two boards and I get the same issue, so its most likely unrelated to the hardware, what happens is:
1. u-boot, uImage and initramfs are written into memory, it jumps into the u-boot and loads the initramfs (works fine on Linux and Windows VirtualBox)
Wait for Known USB Device Appear...
New USB Device Attached at 3:5
3:5>Start Cmd:SDP: boot -f u-boot-ghac-mfg.bin -nojump
100%3:5>Okay (2.132s)
3:5>Start Cmd:SDP: write -f uImage-mfg -addr 0x10800000
99%3:5>Okay (1.012s)
3:5>Start Cmd:SDP: write -f initramfs.cpio.gz.uboot -addr 0x10C00000
99%3:5>Okay (1.821s)
3:5>Start Cmd:SDP: jump -f u-boot-ghac-mfg.bin -ivt
6400%3:5>Okay (1.001s)
2. after the uImage boots and loads the initramfs, an USB device (g_file_storage, idVendor=066f, idProduct=37ff) is created but it can't mount anything from the NAND as it most likely can't find the partitions;
note that the NAND is fine as the boards are booting normally with the old images written on them, I just can't flash anything new on /dev/mtd0 /dev/mtd1 etc
In theory this SHOULD happen:
... usb 1-1.4: configuration #1 chosen from 1 choice
... scsi1 : SCSI emulation for USB Mass Storage devices
... Vendor: Linux Model: File-Stor Gadget Rev: 0314
... Type: Direct-Access ANSI SCSI revision: 02
... SCSI device sde: 8192 512-byte hdwr sectors (4 MB)
In practice this happens:
Nov 26 15:04:13 bigone kernel: [108687.181735] scsi 6:0:0:0: Direct-Access Linux File-Stor Gadget 0399 PQ: 0 ANSI: 2
Nov 26 15:04:13 bigone kernel: [108687.182473] sd 6:0:0:0: Attached scsi generic sg4 type 0
Nov 26 15:04:13 bigone kernel: [108687.184606] sd 6:0:0:0: [sde] Sector size 0 reported, assuming 512.
Nov 26 15:04:13 bigone kernel: [108687.184620] sd 6:0:0:0: [sde] 1 512-byte logical blocks: (512 B/512 B)
Nov 26 15:04:13 bigone kernel: [108687.184625] sd 6:0:0:0: [sde] 0-byte physical blocks
Nov 26 15:04:13 bigone kernel: [108687.186576] sd 6:0:0:0: [sde] Write Protect is off
Nov 26 15:04:13 bigone kernel: [108687.186580] sd 6:0:0:0: [sde] Mode Sense: 0f 00 00 00
Nov 26 15:04:13 bigone kernel: [108687.188600] sd 6:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Nov 26 15:04:13 bigone kernel: [108687.215556] sd 6:0:0:0: [sde] Sector size 0 reported, assuming 512.
Nov 26 15:04:13 bigone kernel: [108687.252498] scsi_io_completion_action: 4 callbacks suppressed
Nov 26 15:04:13 bigone kernel: [108687.252501] sd 6:0:0:0: [sde] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Nov 26 15:04:13 bigone kernel: [108687.252504] sd 6:0:0:0: [sde] tag#0 Sense Key : Medium Error [current]
Nov 26 15:04:13 bigone kernel: [108687.252506] sd 6:0:0:0: [sde] tag#0 Add. Sense: Recorded entity not found