cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401RE multiple virtual com port issue?

Nredd.1
Associate III

HI,

I am using a stm32f401RE chip on my board, a single virtual com port is working fine, but if it is possible to run twice virtual COMS? and what are the processing steps?

Regards,

Naren

4 REPLIES 4
TDK
Guru

Creating a composite USB device is possible, but requires some work and is not supported by CubeMX directly. There are some examples out there:

https://github.com/GaryLee/stm32f103_dual_vcp

If you feel a post has answered your question, please click "Accept as Solution".
Nredd.1
Associate III

Thanks, TDK

I am tried as per the above link, two com ports are detected, but data is not sending

0693W00000KafC5QAJ.png 

uint8_t *data = "****technologies \n";

while(1)

{

  CDC_Transmit_FS(data, strlen(data));

 HAL_Delay (1);

}

Regards,

naren

TDK
Guru

> CDC_Transmit_FS(data, strlen(data));

The code in the provided link requires 3 arguments for CDC_Transmit_FS and you are only providing 2. Are you sure you're using the code in the link?

Not saying it'll work out of the box, but should get you some of the way there. It will still require some experience on your part.

If you feel a post has answered your question, please click "Accept as Solution".
Nredd.1
Associate III

HI,

We acquired the data from both virtual com ports, We are trying to transmit the data to both ports, but the single port is only working?

CDC_Transmit_FS((uint8_t *)uart_ctx->buf.data[buf_idx], uart_ctx->buf.len[buf_idx], 2 * i) 

//CDC_Transmit_FS("data",strlen("data"),1);

//HAL_Delay(100);

//CDC_Transmit_FS("data",strlen("data"),2);

//HAL_Delay(100);

Regards,

Naren