AnsweredAssumed Answered

USB Lib V2.1.0, Endpoint buffers, howto

Question asked by krueger.thomas on Aug 12, 2014
Latest reply on Oct 6, 2014 by krueger.thomas
Gooood morning........STM

Today i am looking at defining more endpoints for a usb uvc "device".
I do understand, that endpoints shall be initialized after an appropriate SETUP message
has been received by the host.

The usblib v2.1.0 has a "class"-callback "Init" or "Interface_Init" which handles the initalization of endpoints stated in the Configuration/Interface Descriptor.
The service routine then inits endpoints by program on this "Interface Init" call.

My question is, how endpoint buffers are working.

From "usb_conf.h" i paste the following buffer settings(mine):

/****************** USB OTG FS CONFIGURATION **********************************/
//The value of RX_FIFO_FS_SIZE should be aware of 4-byte alignment (ie. multiple of 4).
 #define RX_FIFO_FS_SIZE                          128        //Sets the Receive FIFO size for the full speed core. which Endpoint??
 //max endpoint
 #define TX0_FIFO_FS_SIZE                          64        //Sets the Transmit FIFO size for a device endpoint CONTROL-EP
 #define TX1_FIFO_FS_SIZE                         128        // dito for ep1 and so on.
 #define TX2_FIFO_FS_SIZE                          0        // 0 means, EP not used ?!
 #define TX3_FIFO_FS_SIZE                          0
 
 //HOST mode only: Sets the non-periodic Transmit FIFO size for Host mode (Full Speed).
 #define TXH_NP_FS_FIFOSIZ                         96
 //Sets the Periodic Transmit FIFO size for Host mode (Full Speed).
 #define TXH_P_FS_FIFOSIZ                          96
 

i know that endpoint transfer happen on a 64-byte packet basis.(or less)(hardware related)

On F2/F4 devices there are only 4 endpoints (ep0(control),ep1,ep2,ep3)

What limits apply to above buffers?

Fe. if i set RXfifo to 1024, is that ok? (what endpoint does the rxfifo relate to?)

TxFifos can have what size?

I assume that these "Fifos" can be used as a buffer for data exchange, and the driver will handle status according (how).

io-routines:
DCD_EP_Tx(...)
Rx..?

Outcomes