This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Ulink2 debug session blocks Jvcl HID device

Hello anyone,

After reading and searching over the net, I cannot find a solution and I think I need some help.

Scenario: I am developing a HID device using an Atmel AT91SAM7X256 (ARM7TDMI). This device exchanges some data with a windows application that I am writing using Embarcadero RAD X3 and Jvcl HID device component on Windows7.

Problem: The problem arrives when I start a debug session on uVision ( I am using ULink2 ). When the debugger is running (programming or debugging), my application issues an error that say: "device cannot be opened". This problem is not related to my hid device because it happens even if my device is disconnected from the usb cable. From Embarcadero I can see that this error happens after the loading of hid.dll and no exception is raised from my code. No problem happens if i use my hid device whith my windows application whitout debugging the hid device. I seems to me that uVision open hid.dll driver in exclusive mode or something similar so no other application can open or use it. I am start thinking that because it is like the device named in the error is the usb controller, not the hid device that is disconnected at the time.

I hope someone can help me.

Parents
  • Thank you Tsuneo for your reply. The jVcl hid component calls a function passing the vid and pid. My code verify if they are the correct vid and pid and if they are, calls the open file:

    .
    . TJvHidDevice *HidDevice;
    . .
    bool __fastcall TForm1::JvHidDeviceController1Enumerate(TJvHidDevice *HidDev, const int Idx)
    {

    if( ( HidDev->Attributes.VendorID == NBW_VID ) && ( HidDev->Attributes.ProductID == NBW_PID ) ){

    JvHidDeviceController1->CheckOutByIndex(HidDev,Idx);

    HidDevice = HidDev;

    HidDevice->OpenFile();

    }

    return true;

    }

    I not know if the JVcl hid component opens it before me or takes this informations from the windows registry, I will investigate on this. The strange fact is that this problem will arrise only with the ulink2 and only if it is debugging: no other hid device gives me the problem.

Reply
  • Thank you Tsuneo for your reply. The jVcl hid component calls a function passing the vid and pid. My code verify if they are the correct vid and pid and if they are, calls the open file:

    .
    . TJvHidDevice *HidDevice;
    . .
    bool __fastcall TForm1::JvHidDeviceController1Enumerate(TJvHidDevice *HidDev, const int Idx)
    {

    if( ( HidDev->Attributes.VendorID == NBW_VID ) && ( HidDev->Attributes.ProductID == NBW_PID ) ){

    JvHidDeviceController1->CheckOutByIndex(HidDev,Idx);

    HidDevice = HidDev;

    HidDevice->OpenFile();

    }

    return true;

    }

    I not know if the JVcl hid component opens it before me or takes this informations from the windows registry, I will investigate on this. The strange fact is that this problem will arrise only with the ulink2 and only if it is debugging: no other hid device gives me the problem.

Children
No data