Problem with endpoint configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with endpoint configuration

1,379 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cdevelop on Wed Nov 28 02:08:01 MST 2012
Hi,

I am using nxpUSBlib now for a couple of weeks on an LPC1751. One of the problems I discoverd is that if two endpoints are configured one as IN and one as OUT (bulk) on the same logical endpoint number, only the last configured endpoint works.

The physical endpoint number is saved in the "endpointhandle" where it is saved on the logical enpoint index. So if two endpoints are configured on the same logical endpoint only the last one written is in the "endpointhandle". If you want to select an endpoint by logical number it uses the physical endpoint of the last configured endpoint.

endpointhandle[Number] = (Number==ENDPOINT_CONTROLEP) ? ENDPOINT_CONTROLEP : PhyEP;

In all example codes there is always chosen for seperated logical enpoint numbers. Now I know why.

Can someone tell me why this is done in this way?

Thanks.

Labels (1)
0 Kudos
Reply
3 Replies

1,329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vu on Wed Mar 06 20:48:07 MST 2013
Hi cdevelop,

I think this's issue from nxpUSBlib.
In my opinion, you can separate endpointhandle[] to two specific arrays endpointhandle_IN[] and endpointhandle_OUT[] for IN and OUT directions. And you must replace endpointhandle[] with endpointhandle_IN[] or endpointhandle_OUT[] in related functions.
With that, you can use one logical endpoint for both directions.
Correct me if anything go wrong.

Thanks.
0 Kudos
Reply

1,329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by danhauck on Thu Feb 07 07:44:13 MST 2013
Hi cdevelop,

have you solved the problem?

My Intension is to use 5 endpoints + 1 control endpoint for a composite device. But the number of logical endpoints at the lpc1347 is limited to 5. When I change the define for the limitation from 5 to 6. EP 6 didn`t work. When I use 1 logical endpoint for to physical endpoints (in an out) it didn`t work.

I thought the nxpusblib is a great thing. But more and more I revise my oppinion

regards

Daniel
0 Kudos
Reply

1,329 Views
lpcware
NXP Employee
NXP Employee
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.
0 Kudos
Reply