Content originally posted in LPCWare by cdevelop on Wed Nov 28 03:17:42 MST 2012
Hi,
I also discovered something else. In the USB_Init_Device() routine the control endpoint is configured. Only the OUT endpoint. Why?
In the DcdIrqHandler() of the LPC17XX when a reset occures the control endpoint is reconfigured for both IN and OUT.
if(SIEDeviceStatus & DEV_RST) // reset
{
HAL_Reset(); // reset hardware
USB_DeviceState = DEVICE_STATE_Default; // change device state
// reconfigure control endpoints
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, 0, ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,0);
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, 0, ENDPOINT_DIR_IN, USB_Device_ControlEndpointSize,0);
}
So in the "endpoinhandle" only the physical endpoint number of the IN endpoint is saved.
The actual confiruation of the control enpoints is done in HAL_reset(). Are these all known issues? At least it is not consitent.
I think I am goning to fix all this for LPC17XX.