Author Topic: usb reports are angry with me again.  (Read 133 times)

ulao

  • Frequent Contributor
  • ****
  • Posts: 107
usb reports are angry with me again.
« on: May 15, 2018, 11:28:16 pm »
I made sure to completely remove the drivers after my changes. I even went so far to reboot. One of my reports (0x18) are stalling. 

My other reports all seem to work. The only difference is my report length size (193+rID).

   
Code: [Select]
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)
 
  //get pressure
0x85, 0x15,                    //   REPORT_ID (21)
0x95, 0x0D,                    //   REPORT_COUNT (13)
0x09, 0x00,                    //   USAGE (Undefined)
0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)

//get info
0x85, 0x11,                    //   REPORT_ID (17)
0x95, 0x05,                    //   REPORT_COUNT (5)
0x09, 0x00,                    //   USAGE (Undefined)
0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)

//get EEPROM
0x85, 0x17,                    //   REPORT_ID (23)
0x95, 0x30,                    //   REPORT_COUNT (48)
0x09, 0x00,                    //   USAGE (Undefined)
0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)

**************** this report.
  //get DC LCD
0x85, 0x18,                    //   REPORT_ID (24)
0x96, 0xC1, 0x00,              //   REPORT_COUNT (193)
0x09, 0x00,                    //   USAGE (Undefined)
0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
****************


  //get data
0x85, 0x16,                    //   REPORT_ID (22)
0x95, 0x22,                    //   REPORT_COUNT (34)
0x09, 0x00,                    //   USAGE (Undefined)
0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)


0x85, 0x12,                    //   REPORT_ID (18)
0x95, 0x08,                    //   REPORT_COUNT (8) 7 + report ID
0x09, 0x00,                    //   USAGE (Undefined)
0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
   
0x85, 0x14,                    //   REPORT_ID (20)
0x96, 0xc4,  0x00,             //   REPORT_COUNT (196) 192+(rid,command, 0, 0)
0x09, 0x00,                    //   USAGE (Undefined)
0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
0xc0,                           // END_COLLECTION

I check in the drive firmware and the report never makes it in. I check the code that sends it and it does send a length of 194.  I check a sniffer and I get a stall on this report.  I think it has to do with my report descriptor.


edit: just researching this a bit did I goof on my report size?
1001 01 00 = 0x94 = REPORT_COUNT with no length (can only have value 0?)
1001 01 01 = 0x95 = 1-byte REPORT_COUNT (can have a value from 0 to 255)
1001 01 10 = 0x96 = 2-byte REPORT_COUNT (can have a value from 0 to 65535)
1001 01 11 = 0x97 = 4-byte REPORT_COUNT (can have a value from 0 to 4294967295)

or is the range -128 to 128 ? Maybe I need a 0x95 instead?
« Last Edit: May 15, 2018, 11:47:23 pm by ulao »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2703
    • Lakeview Research
Re: usb reports are angry with me again.
« Reply #1 on: May 16, 2018, 11:24:02 am »
This is correct:

1001 01 01 = 0x95 = 1-byte REPORT_COUNT (can have a value from 0 to 255)

ulao

  • Frequent Contributor
  • ****
  • Posts: 107
Re: usb reports are angry with me again.
« Reply #2 on: May 16, 2018, 09:29:18 pm »
Wow the hours I spent on this... my issue was my read eeprom loop.

for (char i=1;i<192;i++)
needed...
for (unsigned char i=1;i<192;i++)
So it was looping forever.

« Last Edit: May 16, 2018, 09:44:48 pm by ulao »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2703
    • Lakeview Research
Re: usb reports are angry with me again.
« Reply #3 on: May 17, 2018, 08:26:44 pm »
Glad you got it working, thanks for reporting back