Question
USB Lib V2.1.0, Endpoint buffers, howto
Posted on August 12, 2014 at 19:07
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). &sharpdefine RX_FIFO_FS_SIZE 128 //Sets the Receive FIFO size for the full speed core. which Endpoint?? //max endpoint &sharpdefine TX0_FIFO_FS_SIZE 64 //Sets the Transmit FIFO size for a device endpoint CONTROL-EP &sharpdefine TX1_FIFO_FS_SIZE 128 // dito for ep1 and so on. &sharpdefine TX2_FIFO_FS_SIZE 0 // 0 means, EP not used ?! &sharpdefine TX3_FIFO_FS_SIZE 0 //HOST mode only: Sets the non-periodic Transmit FIFO size for Host mode (Full Speed). &sharpdefine TXH_NP_FS_FIFOSIZ 96 //Sets the Periodic Transmit FIFO size for Host mode (Full Speed). &sharpdefine 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..? #usb-lib-v2.1.0-endpoints