Author Topic: FFconst data exchange  (Read 17773 times)

ffb_boy

  • Member
  • ***
  • Posts: 10
FFconst data exchange
« on: May 26, 2012, 03:15:45 pm »
Hi
Back again with my own HID descriptor , The joystick is detected correclty by windows the joystick panel is well updated, on the register databas all the effect are well declared and USBlyser told me that the protocol look fine.
With this I try to to launch FFconst to code the constant effect , start by the simple one ...
But when I launch the software it block until I remove my card , with USBlyser I see this
Seq      Request            Request Details         Raw Data   I/O   Status
3      Class Interface         Get Report (Feature id:3 len:5)         in   
4      Class Interface         Get Report (Feature id:3 len:5)         in   
0005-0004   Control Transfer              Get Report (Feature id:3 len:5)         in   Unsuccessful (Stall PID)
0006-0003   Control Transfer              Get Report (Feature id:3 len:5)         in   Unsuccessful (Stall PID)
7      Bulk or Interrupt Transfer   Output Report id:12 len:2   0C 04              out   
8      Bulk or Interrupt Transfer   Output Report id:12 len:2   0C 04              out


An In the sequence 4-5 the data send by the PC look like this
Offset    Field Size    Value       Description
0    bmRequestType    1       A1h 
4..0:    Recipient     ...00001     Interface
6..5:    Type        .01.....     Class
7:    Direction     1.......     Device-to-Host
1    bRequest    1 01h       Get Report
2    wValue.LowByte    1 03h       Report ID
3    wValue.HiByte    1 03h       Feature Report
4    wIndex 2    0000h       Interface
6    wLength 2    0005h       Report Length

And after this nobody works.
What is the problem ?
What I'm supposed to send ?
Thanks



   

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: FFconst data exchange
« Reply #1 on: May 26, 2012, 06:07:03 pm »
The host is asking for a Feature Report, and the device is STALLIng the request instead of returning the report data.

Jan

ffb_boy

  • Member
  • ***
  • Posts: 10
Re: FFconst data exchange
« Reply #2 on: May 28, 2012, 08:17:51 am »
Hi Jan,
I suppose I've to answer as it is described in the descriptor above (I can post all If someone is interested)
It is a FFb joystick decriptor

...
      0xA1,0x02,       // Collection Datalink
         0x85,0x03,       // Report ID 3
         0x09,0x80,       // Usage ROM Effect Block Count
         0x75,0x10,       // Report Size 10h (16d)
         0x95,0x01,       // Report Count 1
         0x15,0x00,       // Logical Minimum 0
         0x35,0x00,       // Physical Minimum 0
         0x27,0xFF,0xFF,0x00,0x00, // Logical Maximum FFFFh (65535d)
         0x47,0xFF,0xFF,0x00,0x00, // Physical Maximum FFFFh (65535d)
         0xB1,0x02,       // Feature (Variable)
         0x09,0x83,       // Usage PID Pool Move Report
         0x26,0xFF,0x00, // Logical Maximum FFh (255d)
         0x46,0xFF,0x00, // Physical Maximum FFh (255d)
         0x75,0x08,       // Report Size 8
         0x95,0x01,       // Report Count 1
         0xB1,0x02,       // Feature (Variable)
         0x09,0xA9,       // Usage Undefined
         0x09,0xAA,       // Usage Undefined
         0x75,0x01,       // Report Size 1
         0x95,0x02,       // Report Count 2
         0x15,0x00,       // Logical Minimum 0
         0x25,0x01,       // Logical Maximum 1
         0x35,0x00,       // Physical Minimum 0
         0x45,0x01,       // Physical Maximum 1
         0xB1,0x02,       // Feature (Variable)
         0x75,0x06,       // Report Size 6
         0x95,0x01,       // Report Count 1
         0xB1,0x03,       // Feature (Constant, Variable)
      0xC0,             // End Collection

which is done like this
2 bytes : Usage ROM Effect Block Count
1 byte  : Usage PID Pool Move Report
2 bits : undefined
6 bits : filling bits

Where can I find info about how to update this data?

Thanks

Update:
I've answer like this
      Info_Pool.Report.RomBlockCount = 0x00FF;
      Info_Pool.Report.RomBlockCount = 0x01;
      Info_Pool.Report.undefined_1 = 0x00;
      Info_Pool.Report.undefined_2 = 0x00;
      Info_Pool.Report.unused = 0x00;
      USBEP0SendRAMPtr((BYTE*)&Info_Pool, sizeof(Info_Pool),USB_EP0_NO_OPTIONS); 
And USBLYSER give me a success but now I've a new Output request 0x0C 0x04 : DC device Reset : what I've to aswer ?
Thanks

« Last Edit: May 28, 2012, 09:36:27 am by ffb_boy »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: FFconst data exchange
« Reply #3 on: May 28, 2012, 10:35:00 am »
The host is sending an Output report with the bytes 0x0C 0x04? See the report descriptor to find out what those bytes mean.

Then the host resets the port? Does the HID's interrupt OUT endpoint ACK or NAK the received data (above)?

Jan

ffb_boy

  • Member
  • ***
  • Posts: 10
Re: FFconst data exchange
« Reply #4 on: May 28, 2012, 04:04:35 pm »
The 0x0C 0x04 come from this part of the descriptor
      0xA1,0x02,       // Collection Datalink
         0x85,0x0C,       // Report ID Ch (12d)
         0x09,0x97,       // Usage DC Stop All Effects
         0x09,0x98,       // Usage DC Device Reset
         0x09,0x99,       // Usage DC Device Pause
         0x09,0x9A,       // Usage DC Device Continue
         0x09,0x9B,       // Usage PID Device State
         0x09,0x9C,       // Usage DS Actuators Enabled
         0x15,0x01,       // Logical Minimum 1
         0x25,0x06,       // Logical Maximum 6
         0x75,0x08,       // Report Size 8
         0x95,0x01,       // Report Count 1
         0x91,0x00,       // Output
      0xC0 ,             // End Collection

And I receive
Output Report (ID 12)
Usage Range       Lg/Ph     Value
DC Device Reset  Off..On   On

I use the last microchip USB stack , the protocol used is HID so all the request logicaly pass trought
USER_USB_CALLBACK_EVENT_HANDLER => EVENT_EP0_REQUEST => USBCBCheckOtherReq()
but this request not pass in the USBCBCheckOtherReq functions ( I put a flag serialcom output flag in this functions).
do you think is not a End point 0 request ?

Thanks


Edit:
This request is detail like this by USBsniffer

URB Bulk or Interrupt Transfer issued
Device Object   USBPDO-7
Driver Object   usbhub
URB Function   URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
Endpoint 01h   1 Out, Interrupt
Report Type   Output
Report ID           12
Report Length   2

and In my descriptor I have the good endpoint 0x81 and 0x01
So the problem is somewhere else



« Last Edit: May 28, 2012, 04:13:01 pm by ffb_boy »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: FFconst data exchange
« Reply #5 on: May 28, 2012, 08:04:56 pm »
The host is using the HID's interrupt OUT endpoint to send the Output report.

Jan

ffb_boy

  • Member
  • ***
  • Posts: 10
Re: FFconst data exchange
« Reply #6 on: May 29, 2012, 02:48:08 am »
Yes I've seen it and my endpoint are configured to work with interrupt.
Thanks


ffb_boy

  • Member
  • ***
  • Posts: 10
Re: FFconst data exchange
« Reply #7 on: May 30, 2012, 07:33:09 am »
Hi,
I've resolved my problem , I've activated the ENDPOINT OUT http://www.microchip.com/forums/fb.ashx?m=655009
but now I receive correctly the output Report but I didn't receive the set report
thanks



[attachment deleted by admin]