tinyusb icon indicating copy to clipboard operation
tinyusb copied to clipboard

Multiple USB Host Failures during Enumeration Attempt on DS4/PS4 Devices

Open arntsonl opened this issue 6 months ago • 7 comments

Operating System

Others

Commit SHA

e95973d3462cdacd165a4057632d46248ded7b8a

Board

GP2040-CE Development Kit (RP2040 with USB-Host Connected to Pins 23/24)

Firmware

Current main compilation of GP2040-CE from 'main' of https://github.com/OpenStickCommunity/GP2040-CE/

UF2 is flashed to an RP2040 based development board for GP2040-CE

What happened ?

After updating our project updated to Pico SDK 2.1.1, I am getting multiple failures in the USB host code using the latest TinyUSB and Pico PIO usb libraries.

The failures occur during process enumeration on the DualShock 4 and PS4 dongles, and I cannot get a consistent failure spot between devices. When plugging in a "Mayflash Magicboots PS4 1.1 Dongle", the EP 00 Control Data fails repeatedly. When plugging in a "Dualshock 4" device, the control data will successfully open, set address to 1, and then fail when setting EP0 to size 64. I have tried different combinations of older builds but nothing seems to open a DS4 device successfully. I have also tried modifying delay timeouts, but sending control data seems to randomly succeed or fail depending on the device. And none of the Playstation 4 based devices will mount to the TinyUSB host in latest 'main'.

How to reproduce ?

  1. Clone GP2040-CE (https://github.com/OpenStickCommunity/GP2040-CE)
  2. Build the GP2040-CE project which includes submodule update tinyusb and pio-pico-usb
  3. Flash the UF2 onto a PICO with a USB host pin setup (Haute42 devices can be used to verify)
  4. Plug in a DS4 dongle such as a "Mayflash Magicboots" or "Haute Booter5" or "Dualshock 4" controller
  5. Observe the dongle / controller does not properly connect to the device

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

I've attached 3 debug logs here: Sony Dualshock 4, Haute Booter5 ps4 dongle, and Mayflash Magicboots PS4 v1.1 dongle. Each device fails at a different location but they all seem to fail when a data packet is sent during enumeration.

TinyUSB_Ticket_Dongle_Dualshock4.log

TinyUSB_Ticket_Dongle_Haute_Booter5.log

TinyUSB_Ticket_Dongle_Mayflash.log

Screenshots

Image

Image

Image

I have checked existing issues, dicussion and documentation

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

arntsonl avatar Jun 13 '25 15:06 arntsonl

It's worth noting that this same behavior is observed with several other non-PS4 HID devices.

mikepparks avatar Jun 13 '25 21:06 mikepparks

Can you test ps4 device with the stock host/cdc_msc_hid (configured to use pio) to see if that works or not

hathach avatar Aug 07 '25 15:08 hathach

Should I test against latest 'master' branch? I will give it a try this afternoon and let you know.

arntsonl avatar Aug 07 '25 15:08 arntsonl

yes and you should only try https://github.com/sekigon-gonnoc/Pico-PIO-USB/pull/186, make sure you test with the stock example hid_controller as well.

hathach avatar Aug 08 '25 02:08 hathach

Yes this worked @hathach ! We can successfully enumerate DS4 devices, I've tested 3 dongles and everything works correctly now. Thank you, confirmed fixed!

arntsonl avatar Aug 09 '25 19:08 arntsonl

I apologize, this version actually does not even work on our TinyUSB. My git submodule update didn't pull in the refs so we were still running the old version.

arntsonl avatar Aug 12 '25 17:08 arntsonl

I apologize, this version actually does not even work on our TinyUSB. My git submodule update didn't pull in the refs so we were still running the old version.

ah, I don't quite get what you mean here. To rule out other factor, please try to test latest of tinyusb and pio using the stock examples hid_controller to test with.

hathach avatar Sep 03 '25 07:09 hathach