none
Stopping eBoot from usb RRS feed

  • Question

  • Hi all,

    is there an eBoot version to allow to stop the boot from USB connection?

    Or do i need to write it from myself?

    Should I initialize the USB serial and check if i receive something into the initial loop (BLMenu())??


    SteMMo
    • Edited by SteMMo Monday, September 26, 2011 9:08 AM
    Monday, September 26, 2011 9:07 AM

All replies

  • not for every platform since it's something HW dependent: you have basically two options on USB:

    if your HW includes an USB device controller you can implement the USB serial device class so your device is 'recognized' as a serial port when you connect it to an USB host (a PC, for example). you can find an implementation in the EBOOT for MAINSTONEIII BSP

    if your HW includes an USB host controller you can implement the USB code which is necessaty to handle a USB/UART adapter

    The 2nd solution is harder


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Monday, September 26, 2011 10:04 AM
  • I'm working with Freescale iMX51.
    SteMMo
    Monday, September 26, 2011 10:11 AM
  • iMX51 bootloader has some usb routines ...

    I guess I can try calling the USBSerialInit() and then recall OEMSerialSendRaw() to send data and polling  OEMSerialRecvRaw() to receive data, is it?

     


    SteMMo
    Thursday, September 29, 2011 10:03 AM
  • Hi all,

    i cloned the routines i found in the common_fsl_v2/ms/usbkitl/SerialDl/serial_dl.c file.

    In this file i customized some parameters such as VID and PID and i called the USBInit() before the wait of the space key (to stop the boot).

    On the PC side i'm using the WinUSB libraries, i modified the default INF file to match the VID and PID.

    When i boot the device i see my debug output i added on the USBInit() function and i have the following log:

    INFO: Successfully loaded boot configuration from SDHC
    System ready!
    Preparing for download...
    ** Display Init.
    ** USBInit.
    *** USBInit()
    * DevState=0 - Notif: 0x01 - UFN_MSG_BUS_EVENTS (1) Attach
    * DevState=1 - Notif: 0x03 - UFN_MSG_BUS_SPEED
    * DevState=1 - Notif: 0x01 - UFN_MSG_BUS_EVENTS (2) Reset
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE
    * DevState=3 - Notif: 0x01 - UFN_MSG_BUS_EVENTS (2) Reset
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_SET_ADDRESS
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE
    * DevState=3 - Notif: 0x01 - UFN_MSG_BUS_EVENTS (0) Detach
    
    * DevState=0 - Notif: 0x01 - UFN_MSG_BUS_EVENTS (1) Attach
    * DevState=1 - Notif: 0x03 - UFN_MSG_BUS_SPEED
    * DevState=1 - Notif: 0x01 - UFN_MSG_BUS_EVENTS (2) Reset
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE
    * DevState=3 - Notif: 0x01 - UFN_MSG_BUS_EVENTS (2) Reset
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_SET_ADDRESS
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE
    * DevState=3 - Notif: 0x04 - UFN_MSG_SETUP_PACKET - - USB_REQUEST_GET_DESCRIPTOR
    * DevState=3 - Notif: 0x64 - UFN_MSG_TRANSFER_COMPLETE

    There are some USB detections but the flow loops forever in a while loop that waits for the DevState became DS_CONFIGURED (5). In the meantime the flow calls the PDD function UsbFnInterruptThread(xx);

    On the PC side the installation starts but at the end i receive the error 'Parameter not correct' and the icon of the 'Monitors' and a yellow bang (!) on it. The message tells that the driver was not installed (Code 28).


    Any idea?


    SteMMo
    Thursday, October 13, 2011 4:13 PM
  • This is an updated log:

    *** USBInit()
    HandleUSBDeviceRegistration()
    *DevState=00 - Ntf MSG_BUS_EVENTS (1) Attach
    *DevState=01 - Ntf MSG_BUS_SPEED 2 -> HandleUSBDeviceRegistration()
    *DevState=01 - Ntf MSG_BUS_EVENTS (2) Reset
    
    *DevState=03 - Ntf MSG_SETUP_PACKET - USB_REQUEST_GET_DESCRIPTOR DEVICE_DESCRIPTOR_TYPE EP0In 
    *DevState=03 - Ntf MSG_TRANSFER_COMPLETE EP0
    
    *DevState=03 - Ntf MSG_BUS_EVENTS (2) Reset
    *DevState=03 - Ntf MSG_SETUP_PACKET - USB_REQUEST_SET_ADDRESS EP0Setup 
    
    *DevState=03 - Ntf MSG_SETUP_PACKET - USB_REQUEST_GET_DESCRIPTOR DEVICE_DESCRIPTOR_TYPE EP0In 
    *DevState=03 - Ntf MSG_TRANSFER_COMPLETE EP0
    
    *DevState=03 - Ntf MSG_SETUP_PACKET - USB_REQUEST_GET_DESCRIPTOR CONFIGURATION_DESCRIPTOR_TYPE EP0In 
    *DevState=03 - Ntf MSG_TRANSFER_COMPLETE EP0
    
    *DevState=03 - Ntf MSG_SETUP_PACKET - USB_REQUEST_GET_DESCRIPTOR CONFIGURATION_DESCRIPTOR_TYPE EP0In 
    *DevState=03 - Ntf MSG_TRANSFER_COMPLETE EP0
    

     

    It seems that only the EP0 is requested ...
    SteMMo
    Monday, October 17, 2011 8:30 AM
  • Hi SteMMo,

    Just before downlaoding make sure usb device enumeration is success. If it is success you should be able to see it in Host PC Device Manager as USB Serial Device I guess. After that from Target connectivity options select USB as Download and Tranport drop-down list.

    Regards,

    GSR

    Monday, October 17, 2011 9:43 AM
  • GSRId,

    i'm sorry but maybe i missed a note: on the PC I see a device called 'USB Device' under a category called 'MyDeviceClass' as stated on the inf file.

    My feeling is that the process is not complete.

    I'm trying to sniff the USB communication but none of the tools detect anything (??). Is it possible? I guess that, at least, USB VID and PID (and then the device descriptor, should be transmitted ...

     


    SteMMo
    Monday, October 17, 2011 12:59 PM
  • Hi SteMMo,

    You can use usb-monitor.exe from HHD Software Ltd. Its not a freeware.

    May be you can try out a trail version. Configure it to capture data in Hot Plug Mode.

    After your device boots up connect USB cable to Host PC.

    You can also refer MainstoneIII BSP, to udnerstand how USB Serial Download to be used.

    Regards,

    GSR 

     


    • Edited by GSRid Tuesday, October 18, 2011 2:41 AM
    Tuesday, October 18, 2011 2:31 AM
  • I really don't understand. Device monitoring studio by HHD Software did not capture nothing!

    I guess that, at least, VID and PID should be trasmitted ...

    *DevState=00 - MSG_BUS_EVENTS (1) Attach
    *DevState=01 - MSG_BUS_SPEED 2
    HandleUSBDeviceRegistration()
    - Mapping 1 to 1
    - Mapping 2 to 2
    *DevState=01 - MSG_BUS_EVENTS (2) Reset
    *DevState=03 - MSG_SETUP_PACKET  [DEVICE_TO_HOST] - USB_REQUEST_GET_DESCRIPTOR DEVICE_DESCRIPTOR_TYPE 12 01 00 02 FF FF FF 40 05 0E 01 00 00 00 00 00 00 01
     EP0In
    *DevState=03 - MSG_TRANSFER_COMPLETE EP0 (xfer=18)
    *DevState=03 - MSG_BUS_EVENTS (2) Reset
    *DevState=03 - MSG_SETUP_PACKET  [HOST_TO_DEVICE] - USB_REQUEST_SET_ADDRESS 0x01  EP0Setup
    *DevState=03 - MSG_SETUP_PACKET  [DEVICE_TO_HOST] - USB_REQUEST_GET_DESCRIPTOR DEVICE_DESCRIPTOR_TYPE 12 01 00 02 FF FF FF 40 05 0E 01 00 00 00 00 00 00 01
     EP0In
    *DevState=03 - MSG_TRANSFER_COMPLETE EP0 (xfer=18)
    *DevState=03 - MSG_SETUP_PACKET  [DEVICE_TO_HOST] - USB_REQUEST_GET_DESCRIPTOR CONFIGURATION_DESCRIPTOR_TYPE 09 02 20 00 01 01 00 40 01 09 04 00 00 02 FF FF FF 00 07 05 01 02 00 02 00 07 05 82 02 00 02 00
     EP0In
    *DevState=03 - MSG_TRANSFER_COMPLETE EP0 (xfer=9)
    *DevState=03 - MSG_SETUP_PACKET  [DEVICE_TO_HOST] - USB_REQUEST_GET_DESCRIPTOR CONFIGURATION_DESCRIPTOR_TYPE 09 02 20 00 01 01 00 40 01 09 04 00 00 02 FF FF FF 00 07 05 01 02 00 02 00 07 05 82 02 00 02 00
     EP0In
    *DevState=03 - MSG_TRANSFER_COMPLETE EP0 (xfer=32)


    This is the inf file:

    [Version] Signature = "$Windows NT$" Class = MyYDeviceClass ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171} Provider = %ProviderName% CatalogFile=MyCatFile.cat Date=10/13/2011,1.0.0.1 ; ================== Class section ================== [ClassInstall32] Addreg=MyDeviceClassReg [MyDeviceClassReg] HKR,,,0,%ClassName% HKR,,Icon,,-1 ; ========== Manufacturer/Models sections =========== [Manufacturer] %ProviderName% = MyDevice_WinUSB,NTx86,NTamd64,NTia64 [MyDevice_WinUSB.NTx86] %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0E05&PID_0001 [MyDevice_WinUSB.NTamd64] %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0E05&PID_0001 [MyDevice_WinUSB.NTia64] %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0E05&PID_0001 ; =================== Installation =================== ;[1] [USB_Install] Include=winusb.inf Needs=WINUSB.NT ;[2] [USB_Install.Services] Include=winusb.inf Needs=WINUSB.NT.Services ;[3] [USB_Install.Wdf] KmdfService=WINUSB, WinUSB_Install [WinUSB_Install] KmdfLibraryVersion=1.9 ;[4] [USB_Install.HW] AddReg=Dev_AddReg [Dev_AddReg] HKR,,DeviceInterfaceGUIDs,0x10000,"{D696BFEB-1734-417d-8A04-86D01071C512}" ;[5] [USB_Install.CoInstallers] AddReg=CoInstallers_AddReg CopyFiles=CoInstallers_CopyFiles [CoInstallers_AddReg] HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll" [CoInstallers_CopyFiles] WinUSBCoInstaller2.dll WdfCoInstaller01009.dll [DestinationDirs] CoInstallers_CopyFiles=11 ; ================= Source Media Section ===================== ;[7] [SourceDisksNames] 1 = %DISK_NAME%,,,\i386 2 = %DISK_NAME%,,,\amd64 3 = %DISK_NAME%,,,\ia64 [SourceDisksFiles.x86] WinUSBCoInstaller2.dll=1 WdfCoInstaller01009.dll=1 [SourceDisksFiles.NTamd64] WinUSBCoInstaller2.dll=2 WdfCoInstaller01009.dll=2 [SourceDisksFiles.ia64] WinUSBCoInstaller2.dll=3 WdfCoInstaller01009.dll=3 ; =================== Strings =================== [Strings] ProviderName="XYZ S.r.l." USB\MyDevice.DeviceDesc="MozartPlus device" WinUSB_SvcDesc="WinUSB Test" DISK_NAME="Mozart Installation Disk" ClassName="Device XYZ"

    My focus is also on the installation: it return me an error 'Parameter not correct'.

    Which parameter should be?

    I modified the INF file but my feeling is that it is not re-read. How can i force it? My try was to uninstall the driver from DeviceManager ..


     


    SteMMo
    Tuesday, October 18, 2011 10:23 AM
  • Hi SteMMo,

    My suggestion let's try with the default VID and PID provided in serial_dl.cpp, which is available at the following path C:\WINCE600\PLATFORM\MAINSTONEIII\SRC\COMMON\USBFN\SERIALDL.

    If you are able to download the images via USB and if you also able to use USB as KITL transport, then you can play with changing VID and PID to your requirements.

    Are you planing to use your own application to download images via usb onto the device instead of using Platform Builder?

    Regards,

    GSR

    Wednesday, October 19, 2011 3:09 AM
  • "Are you planing to use your own application to download images via usb onto the device instead of using Platform Builder?"            

     Dear GSRId...

    Yes I want to try to this is that possible? I keep on confusing the USB is become the serial layer and just able to download the image from the PC (platform builder).

    My question can we use USB to download the image from the USB itself? if yes would you mind to show to me how to do it?

    Really appreciated your help. 

                                                                       

    Monday, March 26, 2012 9:20 AM