Closed JonnyHaystack closed 2 years ago
It looks like youre using an old version of Tinyusb. usbh_edpt_open
which it is trying to suggest was removed back in March.
The non-trivial designated initializer error has been fixed upstream in commit https://github.com/hathach/tinyusb/pull/1480/commits/688a3a0cc2ba23c671df453257fdf3e601934588 which only happens on some compilers.
Try updating to latest upstream TinyUSB
Just got around to trying again and I've got it compiling now. Thanks for your help 😄
Is this supposed to work on 3rd party 360 wireless adapters? Mine has VID 045E and PID 0291 which I think is the same as the official one but it doesn't seem to be picking up controller inputs or even entering the xinput mount callback.
This is the debug logging I get from unplugging the adapter and plugging it back in:
[0:0:0] USBH DEVICE REMOVED
Address = 1
XINPUT close
HUB close
hcd_device_close 1
[0:] USBH DEVICE ATTACH
hcd_port_reset
hcd_port_connect_status
[0:0:0] USBH DEVICE REMOVED
[0:] USBH DEVICE ATTACH
hcd_port_reset
hcd_port_connect_status
Full Speed
[0:0] Open EP0 with Size = 8
hcd_edpt_open dev_addr 0, ep_addr 0
hw_endpoint_init dev 0 ep 0 out xfer 0
dev 0 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Get 8 byte of Device Descriptor
[0:0] Get Descriptor: 80 06 00 01 00 00 08 00
hw_endpoint_init dev 0 ep 0 out xfer 0
dev 0 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Transfer complete
Sent setup packet
on EP 00 with 8 bytes
hcd_edpt_xfer dev_addr 0, ep_addr 0x80, len 8
hw_endpoint_init dev 0 ep 0 in xfer 0
dev 0 ep 0 in setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Prepare BufCtrl: [0] = 0x7408 [1] = 0x0000
Buffer complete
buf_status 0x00000001
Single Buffered: ep_ctrl = A0000180
Sync BufCtrl: [0] = 0xe008 [1] = 0x0000
Completed transfer of 8 bytes on ep 0 in
Transfer complete
on EP 80 with 8 bytes
[0:0] Control data:
0000: 12 01 00 02 FF FF FF 08 ||
hcd_edpt_xfer dev_addr 0, ep_addr 0x0, len 0
hw_endpoint_init dev 0 ep 0 out xfer 0
dev 0 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Prepare BufCtrl: [0] = 0xf400 [1] = 0x0000
Buffer complete
buf_status 0x00000001
Single Buffered: ep_ctrl = A0000180
Sync BufCtrl: [0] = 0x6000 [1] = 0x0000
Short packet on buffer 0 with 0 bytes
Completed transfer of 0 bytes on ep 0 out
Transfer complete
on EP 00 with 0 bytes
Set Address = 1
[0:0] Set Address: 00 05 01 00 00 00 00 00
hw_endpoint_init dev 0 ep 0 out xfer 0
dev 0 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Transfer complete
Sent setup packet
on EP 00 with 8 bytes
hcd_edpt_xfer dev_addr 0, ep_addr 0x80, len 0
hw_endpoint_init dev 0 ep 0 in xfer 0
dev 0 ep 0 in setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Prepare BufCtrl: [0] = 0x7400 [1] = 0x0000
Buffer complete
buf_status 0x00000001
Single Buffered: ep_ctrl = A0000180
Sync BufCtrl: [0] = 0xe000 [1] = 0x0000
Short packet on buffer 0 with 0 bytes
Completed transfer of 0 bytes on ep 0 in
Transfer complete
on EP 80 with 0 bytes
hcd_device_close 0
[0:1] Open EP0 with Size = 8
hcd_edpt_open dev_addr 1, ep_addr 0
hw_endpoint_init dev 1 ep 0 out xfer 0
dev 1 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Get Device Descriptor
[0:1] Get Descriptor: 80 06 00 01 00 00 12 00
hw_endpoint_init dev 1 ep 0 out xfer 0
dev 1 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Transfer complete
Sent setup packet
on EP 00 with 8 bytes
hcd_edpt_xfer dev_addr 1, ep_addr 0x80, len 18
hw_endpoint_init dev 1 ep 0 in xfer 0
dev 1 ep 0 in setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Prepare BufCtrl: [0] = 0x3408 [1] = 0x0408
Buffer complete
buf_status 0x00000001
Double Buffered: ep_ctrl = D0000180
Sync BufCtrl: [0] = 0xa008 [1] = 0x8008
Prepare BufCtrl: [0] = 0x7402 [1] = 0x0000
Buffer complete
buf_status 0x00000001
Single Buffered: ep_ctrl = A0000180
Sync BufCtrl: [0] = 0xe002 [1] = 0x0000
Short packet on buffer 0 with 2 bytes
Completed transfer of 18 bytes on ep 0 in
Transfer complete
on EP 80 with 18 bytes
[0:1] Control data:
0000: 12 01 00 02 FF FF FF 08 5E 04 91 02 07 01 00 00 ||
0010: 00 01 ||
hcd_edpt_xfer dev_addr 1, ep_addr 0x0, len 0
hw_endpoint_init dev 1 ep 0 out xfer 0
dev 1 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Prepare BufCtrl: [0] = 0xf400 [1] = 0x0000
Buffer complete
buf_status 0x00000001
Single Buffered: ep_ctrl = A0000180
Sync BufCtrl: [0] = 0x6000 [1] = 0x0000
Short packet on buffer 0 with 0 bytes
Completed transfer of 0 bytes on ep 0 out
Transfer complete
on EP 00 with 0 bytes
Get Configuration[0] Descriptor (9 bytes)
[0:1] Get Descriptor: 80 06 00 02 00 00 09 00
hw_endpoint_init dev 1 ep 0 out xfer 0
dev 1 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Transfer complete
Sent setup packet
on EP 00 with 8 bytes
hcd_edpt_xfer dev_addr 1, ep_addr 0x80, len 9
hw_endpoint_init dev 1 ep 0 in xfer 0
dev 1 ep 0 in setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Prepare BufCtrl: [0] = 0x3408 [1] = 0x4401
Buffer complete
buf_status 0x00000001
Double Buffered: ep_ctrl = D0000180
Sync BufCtrl: [0] = 0xa008 [1] = 0xc001
Short packet on buffer 1 with 1 bytes
Completed transfer of 9 bytes on ep 0 in
Transfer complete
on EP 80 with 9 bytes
[0:1] Control data:
0000: 09 02 41 01 08 01 00 A0 82 ||
hcd_edpt_xfer dev_addr 1, ep_addr 0x0, len 0
hw_endpoint_init dev 1 ep 0 out xfer 0
dev 1 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Prepare BufCtrl: [0] = 0xf400 [1] = 0x0000
Buffer complete
buf_status 0x00000001
Single Buffered: ep_ctrl = A0000180
Sync BufCtrl: [0] = 0x6000 [1] = 0x0000
Short packet on buffer 0 with 0 bytes
Completed transfer of 0 bytes on ep 0 out
Transfer complete
on EP 00 with 0 bytes
process_enumeration 1343: ASSERT FAILED
Not sure how to find out exactly what that assertion is that's failing, and I don't think I'm seeing any logging from the actual XInput host driver here. Though I do notice that when unplugging it logs XINPUT close
, so it seems like it is using the correct driver?
Did you increase CFG_TUH_ENUMERATION_BUFSIZE
? stock is 256, try 512.
I did not. And now I see that that was in the README... To be fair it wasn't there when I first read it. It seems to be working perfectly now! Thanks so much again 😃
Hi, thanks for this, I'm just having a bit of trouble getting it to work.
When trying to build minimal example using latest Pico SDK and the tinyusb version it comes with, I get the following error
I tried checking out tinyusb to the same commit that your fork is on and then applying the changes again, but that just gave a different error: