USB class driver, Insertion callback not called.

Hi, I’m working on a USB. Iam able to connect to the USB stack using usbd_connect() function. But when I try to attach to the USB device using usbd_attach() function, Iam not able to attach to the device. Insertion callback function is not called even the USB device is inserted. I have attached the USB sstick to a USB hub and when i type the “usb” command i get the below info:

usb

USB 0 (OHCI) v1.10, v1.01 DDK, v1.01 HCD

Device Address : 1
Vendor : 0x03f3 (NEC Corporation)
Product : 0x4000 (USB2.0 Hub Controller)
Class : 0x09 (Hub)
Subclass : 0x00
Protocol : 0x00
Hub Number Ports : 4
Hub Characteristics : 0x00a9 (Individual power, Individual over-current)
Hub Power On->Good : 100 ms
Hub Power Requirements : 250 mA

Device Address : 2
Vendor : 0x054c (Sony)
Product : 0x0105 (USB Embedded Hub)
Class : 0x09 (Hub)
Subclass : 0x00
Protocol : 0x00
Hub Number Ports : 1
Hub Characteristics : 0x000d (Individual power, Compound, Individual over-current)
Hub Power On->Good : 100 ms
Hub Power Requirements : 100 mA

Device Address : 3
Vendor : 0x054c (Sony)
Product : 0x008b (USB Mass Storage Device)
Class : 0x00 (Independant per interface)

I have also given the device vendor and product data to the parameters
for connect.

Code is as follows:

void cbfuncinsert(struct usbd_connection *, usbd_device_instance_t *ins);
void cbfuncremove(struct usbd_connection *, usbd_device_instance_t *ins);

fu()
{
struct usbd_connection *connection;
usbd_funcs_t funcs ;

usbd_device_ident_t interest = {
0x054c,
0x008b,
USBD_CONNECT_WILDCARD,
USBD_CONNECT_WILDCARD,
USBD_CONNECT_WILDCARD,
};

funcs.nentries = _USBDI_NFUNCS;
funcs.insertion = cbfuncinsert;
funcs.removal = cbfuncremove;
funcs.event=NULL ;

usbd_connect_parm_t cparms = {
NULL,
USB_VERSION,
USBD_VERSION,
0,
argc,
argv,
0,
&interest,
&funcs,
5
};

error = usbd_connect(&cparms, &connection);

}

void cbfuncinsert(struct usbd_connection *, usbd_device_instance_t *ins)
{
printf(“In Sub- cbfuncinsert”);
}
void cbfuncremove(struct usbd_connection *, usbd_device_instance_t *ins)
{
printf(“In Sub- cbfuncremove”);
}


When i connect a USB stick to the hub with vendor id as 0x054c and product id as 0x008b, insertion callback function is not called even the USB device is inserted.

Please help me in this matter.

Qnxdevelop,

I believe what’s happening is that another process is being called instead of yours when the usb stick is inserted.

Probably something like devb-umass which normally maps those USB memory sticks as drives.

So check to see what’s running on your machine figure out which process is being called and then stop it so yours gets called.

Tim