2021-06-13 06:19 PM
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. ?
2021-06-15 07:32 PM
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 ?
2021-06-16 01:43 AM
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.