cancel
Showing results for 
Search instead for 
Did you mean: 

Dual Virtual Com Port not Working one of the port.

APate.8
Associate II

I have implemented dual virtual Com port with STM32f767. One of the port works good but another stops after sending two times. Does anyone have had the same issue before. ? 

2 REPLIES 2
APate.8
Associate II

Sorry I just forgot to mention that I have enabled tow com port and one MSC. So total 5 interface will be used.

Total end points:

MSC: two end points (1 IN and 1 OUT)

CDC1: Three end points(2 Data and 1 CMD)

CDC 2: Three end points(2 Data and 1 CMD)

There are two storage device as MSC class.

MCU STM32F767VIHx

I believe there is enough end points to support this configuration,5IN and 5 OUT.

I have allocated buffer as per below

 HAL_PCD_SetRxFiFo(&hpcd_USB_OTG_FS, 0x40); 
 HAL_PCD_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x20); 	
 HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 3, 0x40);	
 HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 5, 0x40);	
 HAL_PCD_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x40);

Total size is less than 1.25kb (40+20+40+40+40 =0x120 <0x140)

When I transmit using CDC_Transmit function it always get busy state for second port. its random 32bit number as TxState2 for CDC2.

I have used FREERTOS V2 and CubeMx 6.0.1 and Firmware V1.16.0 to generate Project.

Does anyone have idea why is this happening ?

Is there anything that I have missed or known issues or limitation ?

APate.8
Associate II

Got it working by enabling index and compare it with epnum.

However, it only works if send from receive function.

CDC_Transmit_FS only works if sent from Receive function. If I send from another freertos task it doesnt works well.