FTDI Community

General Category => Discussion - Software => Topic started by: kaspro on April 15, 2020, 05:48:40 AM

Title: Setting bMaxPacketSize0 to anything other than "8" on a USB Slave doesn't work
Post by: kaspro on April 15, 2020, 05:48:40 AM
Hey all, I'm currently working on hardware for the Nintendo Switch and one requirement is that the USB device needs to report back bMaxPacketSize0 of 64.

I'm attaching two files to this forum post: The descriptors of the controller I'm emulating, and my VNC2 solution. You'll notice they match 1:1 except for the bMaxPacketSize0.

Once I set bMaxPacketSize0, the hardware stops working. I've run the software with a debugger, and once I hit the last line below, it dies.

Code: [Select]
hidkbd_ioctl.ioctl_code = VOS_IOCTL_USBSLAVEHID_ATTACH;
hidkbd_ioctl.set.data = (void *)hUSBSLAVE_1;
vos_dev_ioctl(hUSBSLAVE_HID, &hidkbd_ioctl);

It works perfectly fine if I leave bMaxPacketSize0 at 8 (it even works in Windows!) but the Switch requires this to be 64.

Anyone know if this is a possibility with the VNC2? I've spent many hours on this one problem (close to 30) and already purchased a lot of hardware for it so I'm hoping this will work.

I've also looked through every sample and none of them ever modify bMaxPacketSize0 which is scary to me.
Title: Re: Setting bMaxPacketSize0 to anything other than "8" on a USB Slave doesn't work
Post by: FTDI Community on April 16, 2020, 04:38:47 PM
Hello,

We are dealing with your request via email.
Please feel free to add any resolution here when complete to help other community users.

Best Regards,
FTDI Community