USB 2 CV Failed: Illegal FS bulk endpoint MaxPacketSize: 200
Posted: Tue Jan 17, 2017 2:05 pm
HW:XK-AUDIO-216-MC Development board,
Software: USB AUDIO 2.0 REFERENCE SOFTWARE
it will failed when using "usb 2 Command Verifier" to do the "Chapter 9 Tests".
screenshot is attached. and the failure is related to the MaxPacketSize.
Illegal full speed bulk endpoint MaxPacketSize : 200
(1.2.80) A Full speed Bulk endpoint must have a MaxPacketSize of
0x08/0x10/0x20/0x40.
from the code, I found the MaxPacketSize is set to 0x200 in the descriptor, it's fixed and will not change according to the USB Speed.
So I added some code after XUD_ResetEndpoint, try to modify the MaxPacketSize according to the return USBSpeed, but it seems when doing the test in "usb 2 CV", it will not reset the endpoint. Can someone provide some suggestion? Thanks a lot!
if (result == XUD_RES_RST)
{
#ifdef __XC__
g_curUsbSpeed = XUD_ResetEndpoint(ep0_out, ep0_in);
#else
g_curUsbSpeed = XUD_ResetEndpoint(ep0_out, &ep0_in);
#endif
g_currentConfig = 0;
g_curStreamAlt_Out = 0;
g_curStreamAlt_In = 0;
printstrln("XUD_ResetEndpoint");
printstr("g_curUsbSpeed = ");
printintln(g_curUsbSpeed);
#if 1 //Code added
//For HS, the max packet size is 0x200
if(g_curUsbSpeed == XUD_SPEED_HS) {
cfgDesc_Audio2.configDesc_Midi[68] = 0x00;
cfgDesc_Audio2.configDesc_Midi[69] = 0x02;
cfgDesc_Audio2.configDesc_Midi[82] = 0x00;
cfgDesc_Audio2.configDesc_Midi[83] = 0x02;
}
else{//For FS, the max packet size is 0x40
cfgDesc_Audio2.configDesc_Midi[68] = 0x40;
cfgDesc_Audio2.configDesc_Midi[69] = 0x00;
cfgDesc_Audio2.configDesc_Midi[82] = 0x40;
cfgDesc_Audio2.configDesc_Midi[83] = 0x00;
}
#endif
Software: USB AUDIO 2.0 REFERENCE SOFTWARE
it will failed when using "usb 2 Command Verifier" to do the "Chapter 9 Tests".
screenshot is attached. and the failure is related to the MaxPacketSize.
Illegal full speed bulk endpoint MaxPacketSize : 200
(1.2.80) A Full speed Bulk endpoint must have a MaxPacketSize of
0x08/0x10/0x20/0x40.
from the code, I found the MaxPacketSize is set to 0x200 in the descriptor, it's fixed and will not change according to the USB Speed.
So I added some code after XUD_ResetEndpoint, try to modify the MaxPacketSize according to the return USBSpeed, but it seems when doing the test in "usb 2 CV", it will not reset the endpoint. Can someone provide some suggestion? Thanks a lot!
if (result == XUD_RES_RST)
{
#ifdef __XC__
g_curUsbSpeed = XUD_ResetEndpoint(ep0_out, ep0_in);
#else
g_curUsbSpeed = XUD_ResetEndpoint(ep0_out, &ep0_in);
#endif
g_currentConfig = 0;
g_curStreamAlt_Out = 0;
g_curStreamAlt_In = 0;
printstrln("XUD_ResetEndpoint");
printstr("g_curUsbSpeed = ");
printintln(g_curUsbSpeed);
#if 1 //Code added
//For HS, the max packet size is 0x200
if(g_curUsbSpeed == XUD_SPEED_HS) {
cfgDesc_Audio2.configDesc_Midi[68] = 0x00;
cfgDesc_Audio2.configDesc_Midi[69] = 0x02;
cfgDesc_Audio2.configDesc_Midi[82] = 0x00;
cfgDesc_Audio2.configDesc_Midi[83] = 0x02;
}
else{//For FS, the max packet size is 0x40
cfgDesc_Audio2.configDesc_Midi[68] = 0x40;
cfgDesc_Audio2.configDesc_Midi[69] = 0x00;
cfgDesc_Audio2.configDesc_Midi[82] = 0x40;
cfgDesc_Audio2.configDesc_Midi[83] = 0x00;
}
#endif