Help for reading a XBOX gamepad with an Arduino Giga R1

Hi everybody.
Is there any kind of tutorial, hint, example code, or whatever to let me start reading a XBOX gamepad with an Arduino Giga R1?
Any help appreciated.
Claudio

Have a look on the internet... not all are good, but worth a try.

Thank you for the hint, but the project you are referring to, bypass the usb, and use a serial connection. I would like to use the usb host available on the Giga R1.
Thank you in any case for the suggestion

Sorry, not at computer now.

You might take a look at what a couple of us was playing with a while ago

No promises, but…

Thank you, looks promising, i'll take a look

Hi Kurt, it seems to be a great job to build up all this stuff, but a file seems to be missing, it is GIGA_digitalWriteFast.h. Can you give me an help?
Best regards
Claudio

Sorry, it is in another of my github projects:
Arduino_GIGA-stuff/libraries at main · KurtE/Arduino_GIGA-stuff

Alternatively you can always switch from digitalWriteFast to digitalWrite (Slow) :laughing:

yes, i've replaced GIGA_digitalWriteFast.h with digitalWriteFast.h and it compiles. Now i'm struggling to see the data from the xbox gamepad, but without results. Maybe I will try with a PS4 gamepad...

I am assuming that the controller is plugged into the USB Host port?
I don't remember how well that works with XBox.

It also may depend on which type of XBox controller you are trying to interface
to. XBox 360? or One? or ???

For example at one point I was playing with trying to get the XBox One controllers
to be readable using Bluetooth (BLE). It can be tricky as for example older XBox ones by default don't use BLE. You need to update their firmware to newer versions.
Plus ran into other difficulties. There are a couple of threads about some of this
up on this forum, like:
ArduinoBLE - trying to connect to XBox One controller and other BLE devices - Projects / Programming - Arduino Forum

Yes of course the controlled is plugged into USB A. I've also tested a PS4 controller with no luck. I will do some trial and error procedure to see if I spot the issue.

What sketch are you running?

Have you tried the USBHost Device Info sketch?

I'm running Giga_USBHostGamepad. Do you think it would be better to run USBHost Device?

Just to give you additional information, if it can be of some help, USBHost_DeviceInfo works well, and it displays ID vendor 0x054C (Sony), Product ID: 0x09CC (DualShock 4), and similar data for XBOX gamepad. That also means the electrical layout has no problems. While USBHostGamepad and USBHostJoystick are not able to detect anything connected to the port. I believe there should be something in the code to be fixed in the last two sketches.

Sorry been busy, and it has been a long time since I played with this stuff and I don't remember what state everything is in.

I tried plugging in a PS4 and you are correct it does not what to bind. The USB device info does look correct.

My guess is that when we were last playing with it, we had probably XBox 360, maybe XBOXONE and Switch (not sure which version) controllers working.

I will try to take a look, but no promises that I will solve it.

Got it working again, I think.

The issue is that, if you look at the device info for this device:



*** starting Device information sketch ***
Device:0x2400c714
VID: 54C, PID: 9cc

----------------------------------------
Device Descriptor:
  bcdUSB: 512
  bDeviceClass: 0
  bDeviceSubClass: 0
  bDeviceProtocol: 0
  bMaxPacketSize: 64
  idVendor: 0x54c
  idProduct: 0x9cc
  bcdDevice: 256
  iManufacturer: 1
  iProduct: 2
  iSerialNumber: 0
  bNumConfigurations: 1
Manufacturer: Sony Interactive Entertainment
Product: Wireless Controller
Speed: 0

----------------------------------------
Size of configuration Descriptor: 225
Configuration Descriptor
2400E8E0 - 09 02 E1 00 04 01 00 C0  FA 09 04 00 00 00 01 01  : ........ ........
2400E8F0 - 00 00 0A 24 01 00 01 47  00 02 01 02 0C 24 02 01  : ...$...G .....$..
2400E900 - 01 01 06 02 03 00 00 00  0A 24 06 02 01 01 03 00  : ........ .$......
2400E910 - 00 00 09 24 03 03 02 04  04 02 00 0C 24 02 04 02  : ...$.... ....$...
2400E920 - 04 03 01 00 00 00 00 09  24 06 05 04 01 03 00 00  : ........ $.......
2400E930 - 09 24 03 06 01 01 01 05  00 09 04 01 00 00 01 02  : .$...... ........
2400E940 - 00 00 09 04 01 01 01 01  02 00 00 07 24 01 01 01  : ........ ....$...
2400E950 - 01 00 0B 24 02 01 02 02  10 01 00 7D 00 09 05 01  : ...$.... ...}....
2400E960 - 09 84 00 01 00 00 07 25  01 00 00 00 00 09 04 02  : .......% ........
2400E970 - 00 00 01 02 00 00 09 04  02 01 01 01 02 00 00 07  : ........ ........
2400E980 - 24 01 06 01 01 00 0B 24  02 01 01 02 10 01 80 3E  : $......$ .......>
2400E990 - 00 09 05 82 05 22 00 01  00 00 07 25 01 00 00 00  : .....".. ...%....
2400E9A0 - 00 09 04 03 00 02 03 00  00 00 09 21 11 01 00 01  : ........ ...!....
2400E9B0 - 22 FB 01 07 05 84 03 40  00 05 07 05 03 03 40 00  : "......@ ......@.
2400E9C0 - 05                                                : .
Config:
 wTotalLength: 225
 bNumInterfaces: 4
 bConfigurationValue: 1
 iConfiguration: 0
 bmAttributes: 192
 bMaxPower: 250
****************************************
** Interface level **
  bInterfaceNumber: 0
  bAlternateSetting: 0
  Number of endpoints: 0
  bInterfaceClass: 1
  bInterfaceSubClass: 1
  bInterfaceProtocol: 0
  iInterface: 0
  CS_INTERFACE(CDC/ACM): Call Management Functional Descriptor.
    00000000 - 00 01 47 00 02 01 02                              : ..G....
  CS_INTERFACE(CDC/ACM): Abstract Control Management Functional Descriptor.
    00000000 - 01 01 01 06 02 03 00 00  00                       : ........ .
  CS_INTERFACE(CDC/ACM): Union Functional Descriptor
    00000000 - 02 01 01 03 00 00 00                              : .......
  CS_INTERFACE(CDC/ACM): Direct Line Management Functional Descriptor.
    00000000 - 03 02 04 04 02 00                                 : ......
  CS_INTERFACE(CDC/ACM): Abstract Control Management Functional Descriptor.
    00000000 - 04 02 04 03 01 00 00 00  00                       : ........ .
  CS_INTERFACE(CDC/ACM): Union Functional Descriptor
    00000000 - 05 04 01 03 00 00                                 : ......
  CS_INTERFACE(CDC/ACM): Direct Line Management Functional Descriptor.
    00000000 - 06 01 01 01 05 00                                 : ......
****************************************
** Interface level **
  bInterfaceNumber: 1
  bAlternateSetting: 0
  Number of endpoints: 0
  bInterfaceClass: 1
  bInterfaceSubClass: 2
  bInterfaceProtocol: 0
  iInterface: 0
****************************************
** Interface level **
  bInterfaceNumber: 1
  bAlternateSetting: 1
  Number of endpoints: 1
  bInterfaceClass: 1
  bInterfaceSubClass: 2
  bInterfaceProtocol: 0
  iInterface: 0
  CS_INTERFACE(CDC/ACM): Call Management Functional Descriptor.
    00000000 - 01 01 01 00                                       : ....
  CS_INTERFACE(CDC/ACM): Abstract Control Management Functional Descriptor.
    00000000 - 01 02 02 10 01 00 7D 00                           : ......}. 
  Endpoint: 1 Out
    Attrributes: 9 Isochronous
    Size: 132
    Interval: 1
Unknown: 2400E966 - 07 25 01 00 00 00 00                              : .%.....
****************************************
** Interface level **
  bInterfaceNumber: 2
  bAlternateSetting: 0
  Number of endpoints: 0
  bInterfaceClass: 1
  bInterfaceSubClass: 2
  bInterfaceProtocol: 0
  iInterface: 0
****************************************
** Interface level **
  bInterfaceNumber: 2
  bAlternateSetting: 1
  Number of endpoints: 1
  bInterfaceClass: 1
  bInterfaceSubClass: 2
  bInterfaceProtocol: 0
  iInterface: 0
  CS_INTERFACE(CDC/ACM): Call Management Functional Descriptor.
    00000000 - 06 01 01 00                                       : ....
  CS_INTERFACE(CDC/ACM): Abstract Control Management Functional Descriptor.
    00000000 - 01 01 02 10 01 80 3E 00                           : ......>. 
  Endpoint: 82 In
    Attrributes: 5 Isochronous
    Size: 34
    Interval: 1
Unknown: 2400E99A - 07 25 01 00 00 00 00                              : .%.....
****************************************
** Interface level **
  bInterfaceNumber: 3
  bAlternateSetting: 0
  Number of endpoints: 2
  bInterfaceClass: 3
  bInterfaceSubClass: 0
    HID
  bInterfaceProtocol: 0
    None
  iInterface: 0
  HID Descriptor size: 507
  Endpoint: 84 In
    Attrributes: 3 Interrupt
    Size: 64
    Interval: 5
  Endpoint: 3 Out
    Attrributes: 3 Interrupt
    Size: 64
    Interval: 5
>>>>> USBDumperDevice::getHIDDesc(3) called <<<<< 
2400E9D0 - 05 01 09 05 A1 01 85 01  09 30 09 31 09 32 09 35  : ........ .0.1.2.5
2400E9E0 - 15 00 26 FF 00 75 08 95  04 81 02 09 39 15 00 25  : ..&..u.. ....9..%
2400E9F0 - 07 35 00 46 3B 01 65 14  75 04 95 01 81 42 65 00  : .5.F;.e. u....Be.
2400EA00 - 05 09 19 01 29 0E 15 00  25 01 75 01 95 0E 81 02  : ....)... %.u.....
2400EA10 - 06 00 FF 09 20 75 06 95  01 15 00 25 7F 81 02 05  : .... u.. ...%....
2400EA20 - 01 09 33 09 34 15 00 26  FF 00 75 08 95 02 81 02  : ..3.4..& ..u.....
2400EA30 - 06 00 FF 09 21 95 36 81  02 85 05 09 22 95 1F 91  : ....!.6. ...."...
2400EA40 - 02 85 04 09 23 95 24 B1  02 85 02 09 24 95 24 B1  : ....#.$. ....$.$.
2400EA50 - 02 85 08 09 25 95 03 B1  02 85 10 09 26 95 04 B1  : ....%... ....&...
2400EA60 - 02 85 11 09 27 95 02 B1  02 85 12 06 02 FF 09 21  : ....'... .......!
2400EA70 - 95 0F B1 02 85 13 09 22  95 16 B1 02 85 14 06 05  : ......." ........
2400EA80 - FF 09 20 95 10 B1 02 85  15 09 21 95 2C B1 02 06  : .. ..... ..!.,...
2400EA90 - 80 FF 85 80 09 20 95 06  B1 02 85 81 09 21 95 06  : ..... .. .....!..
2400EAA0 - B1 02 85 82 09 22 95 05  B1 02 85 83 09 23 95 01  : .....".. .....#..
2400EAB0 - B1 02 85 84 09 24 95 04  B1 02 85 85 09 25 95 06  : .....$.. .....%..
2400EAC0 - B1 02 85 86 09 26 95 06  B1 02 85 87 09 27 95 23  : .....&.. .....'.#
2400EAD0 - B1 02 85 88 09 28 95 3F  B1 02 85 89 09 29 95 02  : .....(.? .....)..
2400EAE0 - B1 02 85 90 09 30 95 05  B1 02 85 91 09 31 95 03  : .....0.. .....1..
2400EAF0 - B1 02 85 92 09 32 95 03  B1 02 85 93 09 33 95 0C  : .....2.. .....3..
2400EB00 - B1 02 85 94 09 34 95 3F  B1 02 85 A0 09 40 95 06  : .....4.? .....@..
2400EB10 - B1 02 85 A1 09 41 95 01  B1 02 85 A2 09 42 95 01  : .....A.. .....B..
2400EB20 - B1 02 85 A3 09 43 95 30  B1 02 85 A4 09 44 95 0D  : .....C.0 .....D..
2400EB30 - B1 02 85 F0 09 47 95 3F  B1 02 85 F1 09 48 95 3F  : .....G.? .....H.?
2400EB40 - B1 02 85 F2 09 49 95 0F  B1 02 85 A7 09 4A 95 01  : .....I.. .....J..
2400EB50 - B1 02 85 A8 09 4B 95 01  B1 02 85 A9 09 4C 95 08  : .....K.. .....L..
2400EB60 - B1 02 85 AA 09 4E 95 01  B1 02 85 AB 09 4F 95 39  : .....N.. .....O.9
2400EB70 - B1 02 85 AC 09 50 95 39  B1 02 85 AD 09 51 95 0B  : .....P.9 .....Q..
2400EB80 - B1 02 85 AE 09 52 95 01  B1 02 85 AF 09 53 95 02  : .....R.. .....S..
2400EB90 - B1 02 85 B0 09 54 95 3F  B1 02 85 E0 09 57 95 02  : .....T.? .....W..
2400EBA0 - B1 02 85 B3 09 55 95 3F  B1 02 85 B4 09 55 95 3F  : .....U.? .....U.?
2400EBB0 - B1 02 85 B5 09 56 95 3F  B1 02 85 D0 09 58 95 3F  : .....V.? .....X.?
2400EBC0 - B1 02 85 D4 09 59 95 3F  B1 02 C0 00 00 00 00 00  : .....Y.? ........

HID Report Descriptor (0x2400e9d0) size: 512
  05 01	// Usage Page(1) - Generic Desktop
  09 05	// Usage(5) -(?)
  A1 01	// Collection(1) top Usage(10005)
    85 01	// Report ID(1)
    09 30	// Usage(30) -(X)
    09 31	// Usage(31) -(Y)
    09 32	// Usage(32) -(Z)
    09 35	// Usage(35) -(Rz)
    15 00	// Logical Minimum(0)
    26 FF 00	// Logical maximum(ff)
    75 08	// Report Size(8)
    95 04	// Report Count(4)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    09 39	// Usage(39) -(Hat)
    15 00	// Logical Minimum(0)
    25 07	// Logical maximum(7)
    35 00	// Physical Minimum(0)
    46 3B 01	// Physical Maximum(13b)
    65 14	// Unit(14)
    75 04	// Report Size(4)
    95 01	// Report Count(1)
    81 42	// Input(42)	// (Data, Variable, Absolute, Null State)
    65 00	// Unit(0)
    05 09	// Usage Page(9) - Button
    19 01	// Usage Minimum(1) -  (BUTTON 1)
    29 0E	// Usage Maximum(e) -  (BUTTON 14)
    15 00	// Logical Minimum(0)
    25 01	// Logical maximum(1)
    75 01	// Report Size(1)
    95 0E	// Report Count(e)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    06 00 FF	// Usage Page(ff00) - Vendor Defined
    09 20	// Usage(20) -
    75 06	// Report Size(6)
    95 01	// Report Count(1)
    15 00	// Logical Minimum(0)
    25 7F	// Logical maximum(7f)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    05 01	// Usage Page(1) - Generic Desktop
    09 33	// Usage(33) -(Rx)
    09 34	// Usage(34) -(Ry)
    15 00	// Logical Minimum(0)
    26 FF 00	// Logical maximum(ff)
    75 08	// Report Size(8)
    95 02	// Report Count(2)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    06 00 FF	// Usage Page(ff00) - Vendor Defined
    09 21	// Usage(21) -
    95 36	// Report Count(36)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    85 05	// Report ID(5)
    09 22	// Usage(22) -
    95 1F	// Report Count(1f)
    91 02	// Output(2)	// (Data, Variable, Absolute)
    85 04	// Report ID(4)
    09 23	// Usage(23) -
    95 24	// Report Count(24)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 02	// Report ID(2)
    09 24	// Usage(24) -
    95 24	// Report Count(24)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 08	// Report ID(8)
    09 25	// Usage(25) -
    95 03	// Report Count(3)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 10	// Report ID(10)
    09 26	// Usage(26) -
    95 04	// Report Count(4)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 11	// Report ID(11)
    09 27	// Usage(27) -
    95 02	// Report Count(2)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 12	// Report ID(12)
    06 02 FF	// Usage Page(ff02) - Vendor Defined
    09 21	// Usage(21) -
    95 0F	// Report Count(f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 13	// Report ID(13)
    09 22	// Usage(22) -
    95 16	// Report Count(16)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 14	// Report ID(14)
    06 05 FF	// Usage Page(ff05) - Vendor Defined
    09 20	// Usage(20) -
    95 10	// Report Count(10)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 15	// Report ID(15)
    09 21	// Usage(21) -
    95 2C	// Report Count(2c)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    06 80 FF	// Usage Page(ff80) - Vendor Defined
    85 80	// Report ID(80)
    09 20	// Usage(20) -
    95 06	// Report Count(6)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 81	// Report ID(81)
    09 21	// Usage(21) -
    95 06	// Report Count(6)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 82	// Report ID(82)
    09 22	// Usage(22) -
    95 05	// Report Count(5)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 83	// Report ID(83)
    09 23	// Usage(23) -
    95 01	// Report Count(1)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 84	// Report ID(84)
    09 24	// Usage(24) -
    95 04	// Report Count(4)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 85	// Report ID(85)
    09 25	// Usage(25) -
    95 06	// Report Count(6)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 86	// Report ID(86)
    09 26	// Usage(26) -
    95 06	// Report Count(6)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 87	// Report ID(87)
    09 27	// Usage(27) -
    95 23	// Report Count(23)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 88	// Report ID(88)
    09 28	// Usage(28) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 89	// Report ID(89)
    09 29	// Usage(29) -
    95 02	// Report Count(2)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 90	// Report ID(90)
    09 30	// Usage(30) -
    95 05	// Report Count(5)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 91	// Report ID(91)
    09 31	// Usage(31) -
    95 03	// Report Count(3)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 92	// Report ID(92)
    09 32	// Usage(32) -
    95 03	// Report Count(3)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 93	// Report ID(93)
    09 33	// Usage(33) -
    95 0C	// Report Count(c)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 94	// Report ID(94)
    09 34	// Usage(34) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A0	// Report ID(a0)
    09 40	// Usage(40) -
    95 06	// Report Count(6)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A1	// Report ID(a1)
    09 41	// Usage(41) -
    95 01	// Report Count(1)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A2	// Report ID(a2)
    09 42	// Usage(42) -
    95 01	// Report Count(1)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A3	// Report ID(a3)
    09 43	// Usage(43) -
    95 30	// Report Count(30)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A4	// Report ID(a4)
    09 44	// Usage(44) -
    95 0D	// Report Count(d)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 F0	// Report ID(f0)
    09 47	// Usage(47) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 F1	// Report ID(f1)
    09 48	// Usage(48) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 F2	// Report ID(f2)
    09 49	// Usage(49) -
    95 0F	// Report Count(f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A7	// Report ID(a7)
    09 4A	// Usage(4a) -
    95 01	// Report Count(1)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A8	// Report ID(a8)
    09 4B	// Usage(4b) -
    95 01	// Report Count(1)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 A9	// Report ID(a9)
    09 4C	// Usage(4c) -
    95 08	// Report Count(8)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 AA	// Report ID(aa)
    09 4E	// Usage(4e) -
    95 01	// Report Count(1)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 AB	// Report ID(ab)
    09 4F	// Usage(4f) -
    95 39	// Report Count(39)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 AC	// Report ID(ac)
    09 50	// Usage(50) -
    95 39	// Report Count(39)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 AD	// Report ID(ad)
    09 51	// Usage(51) -
    95 0B	// Report Count(b)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 AE	// Report ID(ae)
    09 52	// Usage(52) -
    95 01	// Report Count(1)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 AF	// Report ID(af)
    09 53	// Usage(53) -
    95 02	// Report Count(2)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 B0	// Report ID(b0)
    09 54	// Usage(54) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 E0	// Report ID(e0)
    09 57	// Usage(57) -
    95 02	// Report Count(2)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 B3	// Report ID(b3)
    09 55	// Usage(55) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 B4	// Report ID(b4)
    09 55	// Usage(55) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 B5	// Report ID(b5)
    09 56	// Usage(56) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 D0	// Report ID(d0)
    09 58	// Usage(58) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    85 D4	// Report ID(d4)
    09 59	// Usage(59) -
    95 3F	// Report Count(3f)
    B1 02	// Feature(2)	// (Data, Variable, Absolute)
    C0	// End Collection
  00
  00
  00
  00
  00

--------------------
* Top usage summary
--------------------
Report ID: 0: 10005
--------------------
parseInterface nb:0
 bInterfaceClass = 1
 bInterfaceSubClass = 1
 bProtocol = 0
parseInterface nb:1
 bInterfaceClass = 1
 bInterfaceSubClass = 2
 bProtocol = 0
parseInterface nb:1
 bInterfaceClass = 1
 bInterfaceSubClass = 2
 bProtocol = 0
parseInterface nb:2
 bInterfaceClass = 1
 bInterfaceSubClass = 2
 bProtocol = 0
parseInterface nb:2
 bInterfaceClass = 1
 bInterfaceSubClass = 2
 bProtocol = 0
parseInterface nb:3
 bInterfaceClass = 3
 bInterfaceSubClass = 0
    HID
 bProtocol = 0
    None
New Debug device: VID:054c PID:09cc [dev: 0x2400c714 - intf: 0]
USB host device(54c:9cc) connected
Manufacturer: Sony Interactive Entertainment
Product: Wireless Controller

The actual HID interface that outputs joystick data is on Interface 3 (4th interface)

** Interface level **
  bInterfaceNumber: 3
  bAlternateSetting: 0
  Number of endpoints: 2
  bInterfaceClass: 3
  bInterfaceSubClass: 0
    HID
  bInterfaceProtocol: 0
    None
  iInterface: 0
  HID Descriptor size: 507
  Endpoint: 84 In
    Attrributes: 3 Interrupt

The problem is that the Arduino MBED library Arduino_USBHostMbed5 is configured
with max of 2 interfaces per device, so we toss it...

But if you go into that library (library folder)\Arduino_USBHostMbed5\src\USBHost\USBHostConf.h

Look for the line: about line 95

* Maximum number of interfaces of a usb device
*/
#define MAX_INTF                    2

and change the 2 to a 4 and rebuild your sketch and hopefully it will work for you.

Note: You can get a lot more debug output if you edit in that same library
...\src\USBHost\dbg.h and change
#define DEBUG 0 /*INFO,ERR,WARN*/
to 1 or 2 or 3... depending on how much...

Note: I don't think I have all of the support in here we have done for the Teensy boards, but it does at least get you the basics. For example, I don't think I have support in this sketch for handling something like the NyKO keyboard into it. Or print information
from the touch area...

Starting joystick test...

Match PID(0x54c)/VID(0x9cc): 8

After get end points

New Gamepad device: VID:054c PID:09cc [dev: 0x2400cb64 - intf: 3]Match PID(0x54c)/VID(0x9cc): 8

Exclude 1

Joystick (54C:9CC): connected

Manufacturer: Sony Interactive Entertainment

Product: Wireless Controller

joystick buttons = 0

lx: 127, ly: 123, rx: 123, ry: 123

DPAD: 8

ltv: 0, rtv: 0

joystick buttons = 0

lx: 127, ly: 123, rx: 123, ry: 123

DPAD: 8

ltv: 0, rtv: 0

joystick buttons = 0

lx: 127, ly: 123, rx: 123, ry: 124

DPAD: 8

ltv: 0, rtv: 0

joystick buttons = 0

lx: 127, ly: 123, rx: 122, ry: 124

DPAD: 8

ltv: 0, rtv: 0

Hi Kurt, thank you for the help, but I didn't solve my issue. I've set DEBUG to 3, and set MAX_INTF to 4, but the PS4 gamepad is not working.
I get the following output:

----------------------------------------
Size of configuration Descriptor: 225
[USB_ERR: C:\Users\Claudio\Documents\Arduino\libraries\GIGA_USBHostMBe5_devices\examples\GIGA_USBHost_DeviceInfo\USBDumperDevice.cpp:437]controlRead FAILED(18)
Configuration Descriptor
Enumerate returned status not OKDevice:0x2400c714
VID: 54C, PID: 9cc

----------------------------------------
Device Descriptor:
  bcdUSB: 512
  bDeviceClass: 0
  bDeviceSubClass: 0
  bDeviceProtocol: 0
  bMaxPacketSize: 64
  idVendor: 0x54c
  idProduct: 0x9cc
  bcdDevice: 256
  iManufacturer: 1
  iProduct: 2
  iSerialNumber: 0
  bNumConfigurations: 1
Speed: 0

I've a doubt you can have other changes in your code, because in my USBHostConf.h the define MAX_INTF is at line 75 and not 95. I don't know if it can help. I did a test also with a XBOX game controller with same result.

Sorry, mistype it 75...

Only changes in that file:

The only other change in that library I have are a couple of debug outputs:

The only changes in my own library is again some more debug output...

So not sure what is different with yours?
Question: Is your PS4 controller really a PS4 controller? i.e. Sony or is it a clone?
The reason I ask is not all clones are created equal. I do have have a couple
different ones...

For sure the PS4 controller is an Amazon Clone. If you think the original can work, I can purchase one.
Two questions:
What about the enumerate error 18?
Do you think the USBHostGiga lib can behave better?
Thanks
Claudio

Not sure: is it one of these clones?

My sketch is failing to load descriptor in the function:

uint16_t USBDumperDevice::getConfigurationDescriptor(uint8_t* buf, uint16_t max_len_buf) {
  USB_TYPE res;
  uint16_t total_conf_descr_length = 0;

  // fourth step: get the beginning of the configuration descriptor to have the total length of the conf descr
  res = host->controlRead(dev,
                          USB_DEVICE_TO_HOST | USB_RECIPIENT_DEVICE,
                          GET_DESCRIPTOR,
                          (CONFIGURATION_DESCRIPTOR << 8) | (0),
                          0, buf, CONFIGURATION_DESCRIPTOR_LENGTH);

  if (res != USB_TYPE_OK) {
    USB_ERR("GET CONF 1 DESCR FAILED");
    return 0;
  }
  total_conf_descr_length = buf[2] | (buf[3] << 8);
  if (max_len_buf == 0) return total_conf_descr_length;

  total_conf_descr_length = min(max_len_buf, total_conf_descr_length);

  USB_DBG("TOTAL_LENGTH: %d \t NUM_INTERF: %d", total_conf_descr_length, buf[4]);

  res = host->controlRead(dev,
                          USB_DEVICE_TO_HOST | USB_RECIPIENT_DEVICE,
                          GET_DESCRIPTOR,
                          (CONFIGURATION_DESCRIPTOR << 8) | (0),
                          0, buf, total_conf_descr_length);
  if (res != USB_TYPE_OK) {
    USB_ERR("controlRead FAILED(%u)", res);
    return 0;
  }
  return total_conf_descr_length;
}

It is printing the message on the almost last line (about 5 up).
It did read in a partial one earlier in this function.

You might try changing this line:
USB_DBG("TOTAL_LENGTH: %d \t NUM_INTERF: %d", total_conf_descr_length, buf[4]);

to USB_INFO instead of DBG and see if it gives us any hints. Maybe giving a bogus size...

I hope it can give us an help. This is the output with USB_INFO

----------------------------------------
Size of configuration Descriptor: 225
[USB_INFO: C:\Users\Claudio\Documents\Arduino\libraries\GIGA_USBHostMBe5_devices\examples\GIGA_USBHost_DeviceInfo\USBDumperDevice.cpp:429]TOTAL_LENGTH: 225 	 NUM_INTERF: 4
[USB_ERR: C:\Users\Claudio\Documents\Arduino\libraries\GIGA_USBHostMBe5_devices\examples\GIGA_USBHost_DeviceInfo\USBDumperDevice.cpp:437]controlRead FAILED(18)
Configuration Descriptor
Enumerate returned status not OKDevice:0x2400c714
VID: 54C, PID: 9cc

----------------------------------------
Device Descriptor:
  bcdUSB: 512
  bDeviceClass: 0
  bDeviceSubClass: 0
  bDeviceProtocol: 0
  bMaxPacketSize: 64
  idVendor: 0x54c
  idProduct: 0x9cc
  bcdDevice: 256
  iManufacturer: 1
  iProduct: 2
  iSerialNumber: 0
  bNumConfigurations: 1
Speed: 0