cancel
Showing results for 
Search instead for 
Did you mean: 

STM32cubeMX USB_DEVICE Middleware - Optimum Parameter setting guide line

mahapusha
Associate III

Dear Members,

Is there any guidelines to select the values or size of three parameters in STM32cubeMX, middleware (USB device, CDC) to achieve the highest speed on CDC? I am using STM32L4P5VGT. My application streams the sensor data to the Laptop using USB CDC class, once powered on.

To understand the question more in detail, I attached my current settings, are acceptable or can be optimised by reduction or increase, same time, need to avoid wastage of RAM also, so it can be used for other purposes if I am using too much.
Regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ghofrane GSOURI
ST Employee

Hello @mahapusha 

First let me thank you for posting .

Please check this POST , it could be very helpful.

THX

Ghofrane

View solution in original post

2 REPLIES 2
Ghofrane GSOURI
ST Employee

Hello @mahapusha 

First let me thank you for posting .

Please check this POST , it could be very helpful.

THX

Ghofrane

@Ghofrane GSOURI 
I have checked the above link and found it useful for some tricks for dual buffer swapping which was better than mine in code and performance.

Regarding the size allocation, it also does not provide useful info.
1) Can the caller pass the buffer size within 64K to this function for live data buffer? - uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len)? The buffer size defined using CubeMx will be used to command exchange between the PC to the device, User RX/TX buffers are also defined in CubeM separately.

2) UserTxBufferFS[APP_TX_DATA_SIZE] and UserRxBufferFS[APP_RX_DATA_SIZE] are used for application data only on USB CDC overhead also will be part of these buffers?

3) ST has any plan for USB device in LL library also, ie without HAL?

Regards