memory fault core dumped using usbd_attach

Hi, I am using usbd_attach in the insertion function in the usb driver. The program after usbd_connect, calls insertion call. As soon as the insertion callback occurs, the error Memory fault[Core Dumped] appears on the window. What is the reason? I have specified the vendor id, product id, class,subclass n protocol also.I am trying it to attach the keyboard to my driver. Although it has inbuilt HID driver for it, atleast the usbd_attach should return error=EBUSY, but it returns Memory fault[Core Dumped].Waht can be done in this case?

Charuta,

You should not try to attach to the USB keyboard if the HID driver is also running and attaching to it. The USB driver won’t prevent your program and the HID driver from both using the keyboard but what will happen in practise is that you’ll get funny results (ie you won’t get mouse events or the HID driver won’t get mouse events).

When you get the memroy fault is it because of the keyboard OR is it because of your USB device or does it occur with either one? It’s not clear from your post which one or if both cause the crash.

Have you taken a look in the core file (you’ll need to run dumper and compile your code in debug mode) to see exactly why it’s failing? That would be my first suggestion then you’ll see the exact line and be able to examine the variables to see what went wrong.

Tim

ok Thankyou. Yes it got attached when i slayed the earlier running hid driver.
When we connect a usb storage device the entry is created in /fs/usb0. Similarly,Can you please tell, when we insert a communication device like modem where is the entry created in qnx? Or how do we specify the path for creating the entry using usbd_connect?

Charuta,

Can I assume what you are trying to do is write a USB driver for a USB modem and that you were expermenting with the USB mouse before?

If that’s the case you should download the free USB DDK which has code samples for doing usbd_connect() calls for a mouse, keyboard and printer. From these simply examples you can easily construct the driver to connect to any USB device.

Tim