U1SOF value (USB_SOF_THRESHOLD_xx) is too short on host stack
> To MAL team,
U1SOF value on usb_host_local.h is too short, even on the latest MAL.
C:\Microchip Solutions v2012-10-15\Microchip\USB\usb_host_local.h
#define USB_SOF_THRESHOLD_08 0x12 // U1SOF - Threshold for a max packet size of 8
#define USB_SOF_THRESHOLD_16 0x1A // U1SOF - Threshold for a max packet size of 16
#define USB_SOF_THRESHOLD_32 0x2A // U1SOF - Threshold for a max packet size of 32
#define USB_SOF_THRESHOLD_64 0x4A // U1SOF - Threshold for a max packet size of 64
Of course, these values are typical ones described on the data sheets, but the values on the data sheets are wrong.
These values count up just major "bytes" on the packets, ignoring bit time of bit-stuff, EOP, and inter-packet delay
I've once pointed out this issue in this post,
http://www.microchip.com/forums/fb.ashx?m=490793And then, PIC32 OTG user's manual added this chapter,
http://ww1.microchip.com/...n/DeviceDoc/61126F.pdf27.4.1 Configuring the SOF Threshold (page 27-51)
The calculation example of this chapter clearly shows that USB_SOF_THRESHOLD_64 should be 0x4E, instead of 0x4A
613 bits = 78 bytes (round up) = 0x4E
But this value is still too short, because it doesn't count in bit stuff yet, as Note 3 tells.
I recommend MAL team to discuss on U1SOF issue with the designer of OTG silicon macro well.
Tsuneo