This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Loading USBFN class driver at boot-up without waiting for Device Attached



Hi,

Our system uses the Am335x which have 2 OTG ports and run with WEC 7 using the TI-Adeneo release BSP. In our set-up one  OTG port is permanently used as Host and the other is a permanent device port. We just moved to this new platform so we are still trying to fine tune everything to make sure we are keeping backward compatibility with our legacy applications.

One issue we observed is that one of our legacy application assumes that the USBFN Class driver is always loaded at boot-up. However, in this new platform, the USBFN class driver is only loaded after a "Device-Attach" event is received. And then once there the device is detached, it will also unload the Class Driver.

Questions:

1.) Since our system only implement a single type  of peripheral mode, is there a way that we can load the class driver for the USBFN right from boot-up like built-in drivers without waiting for a "Device-Attach" event?

2.) Is there a way that we can also prevent the class driver to be unloaded during a USB "Detach" event? This is because our legacy application, only gets the driver handle on it's initialization and from there on, it will only keep polling the same handle for any data received. Right now, when the driver gets unloaded after a detach, the handle will turn invalid and application will be left with an invalid handle.

As a background, in our old system the class driver was set to disguise as a COM port to the application, so the loading only happens at boot-up and it nevers gets unloaded. Now, we see this as a performance bottleneck as more data gets passed with newer use cases. So we moved to implementing it as a real USBFN class driver, actually a printer class driver.

  • Marlon,

    I believe this is possible by moving the registry entries for the driver to the BuiltIn key, e.g.

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MYUSB]
        "Dll"="myusb.dll"
        ...followed by other keys related to myusb.dll like Prefix, Order etc.

    I'm about to start my weekend so don't have time to test, but I think this is how we did it on a CE 5.0 platform I worked on a few years ago. If you can't get it to work I'd be happy to double check on Monday.

    Best regards,
    Carsten