Hello, I'm trying to send data my usb device using simpleHIDWrite tool, but I'm getting this error: access violation at address 00000, read of address 00000 Does anyone have an idea about what could be the source of this problem.
Time to pick up a good introductory level book about C, and read up on pointers, null pointers and pointer indirection (referencing the target of the pointer).
I think I know what a null pointer means. In fact after more searching on my problem I found that when I make a report with a report size = 8 and a report count = 64 or more I get this error but when the report count = 63 There is no error and all the data are transmitted, The problem is that I'm transmitting 64 byte while I'm declaring the report count to be 63. I'm supposing that the first byte sent is the report id so the total size of the transmitted data is 63+1=64. I'm wondering If I can omit the report id and use it as a data byte.
Thanks for your support Tsuneo, I'll test this on monday.
Hello, I tried the new software, it seems that I always start by sending a zero even that the first byte is not defined to be zero. Do you have any idea about this problem?
Here is my report descriptor:
0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xA1, 0x01, // COLLECTION (Application) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x40, // REPORT_COUNT (64) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x81, 0x02, // INPUT (Data,Var,Abs) 0x95, 0x40, // REPORT_COUNT (64) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0x95, 0x01, // REPORT_COUNT (1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xB1, 0x02, // FEATURE (Data,Var,Abs) 0xc0 // END_COLLECTION
> it seems that I always start by sending a zero even that the first byte is not defined to be zero.
It's the Windows way how MS implement PC HID driver. When your report descriptor on the device has no report ID, the default report ID (0) is assumed by the HID spec. On the firmware side, no report ID is preceded on the reports, exchanged by the device. But Windows application has to add the report ID: 0 before every type of reports. This report ID is deleted by the PC HID driver, when it is sent to the device. Also, this report ID is added by the HID PC driver, when it comes from the device.
Tsuneo
I'm really grateful for your help sir, Every thing is clear, but it is weird that this matter is not mentioned in the HID spec, or not very highlighted to attract my attention.