hathach/tinyusb

SetRequest arrive with wrong buffer content (from other request), when incoming many requests

sadykowich opened this issue · 1 comments

Operating System

Windows 10

Board

Raspberry Pico

Firmware

TinyUSB 0.15.0
Pico SDK 1.5.1

What happened ?

I would like to port this g29emu (https://github.com/mathijsvandenberg/g29emu) project to Pico with using TinyUSB.
It is almost done but the SetReport requests PS4 auth content not arrived (maybe lost or overwrite with another?): request_id, request_type are good, but the buffer content is other request's content when incoming many requests from the host (PS4).
I attached the log file:

  • 1-56. lines: host read the device infos
  • in 57. line: PS4 device ask
  • 58-100. lines: 1st PS4 auth sequence (*)
  • 102-144. lines: 2nd PS4 auth sequence (*)
  • 146-188. lines: 3rd PS4 auth sequence (*)
  • etc.

(*): all PS4 auth sequences contains the followings:

  • start with 0xf3 request (with constant response) as you see in 58. line
  • next arrive from PS4 setReport 0xf0 requests bytes: 0xf0, sequence (01...) and item counter (00..07) as you see in 59-66. lines
  • after arrive getReport request (0xf2) and send back the sequence number, as you see in 67. line (sequence is 0x01)
  • and finally arrive 33 getReport request (0xf1) and send back the auth sequences, as you see in 68-100. lines

To the 408. line seems all good, but the USB communication beetween PS4 and PR2040 contains only the PS4 auth request.
When i start a game on PS4 the game sent some setting to the wheel (in 410-415. lines), what are ok, but starts send to the wheel FFB and engine's RPM to the wheel as you see in lines what are start with "--->>> tud_hid_set_report_cb"

As you see the data start with 0x30 0xf8 ... or 0x30 0xf5 ... and so one. (from the 454. line)
The 9. PS4 auth sequence was ok, but the 10. (0x0a) PS4 auth sequence arrived with wrong buffer. The 0x0a auth sequence:

  • starts in 4784. line with 0xf3 (ok)
  • next 8 setReport request:
  • 1st ok (in 4905. line starts with 0xf0 0x0a 0x00 ...)
  • 2nd ok (in 5026. line starts with 0xf0 0x0a 0x01 ...)
  • 3rd ok (in 5147. line starts with 0xf0 0x0a 0x02 ...)
  • 4nd not (in 5268. line starts with 0xf8 0x12 0x01 ...) -> so it seem that the report id (0xf0), report type (0x03) are ok, but the buffer content isn't

I attached the log text file.

How to reproduce ?

I think with continously SetReport/GetReport requests.

Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)

log_error_SetReqGetReq.txt

Screenshots

No response

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.

I found the solution, this was on the desk: #2273