USB CDC how to increase speed (baud rate) ?
Hello everyone,
I am working on a signal analyser device, which needs to transmit data serially as fast as possible (idealy 1Mbaud/s).
I am doing the following loop to transmit:
uint8_t buf_high[1] = {124}; // '|'
uint8_t buf_low[1] = {48}; // '0'
initRxContinuous();
while(buffer[0] == 'c'){
//delay_us(1);
if(HAL_GPIO_ReadPin(GPIOA, GDO0_Pin) == 1){
while(CDC_Transmit_FS(buf_high, 1));
}
else{
while(CDC_Transmit_FS(buf_low, 1));
}
}
But I only see around 56000 bytes in 10 seconds, so 5600 bytes/s = 44800 baud/s
Is there a way to set the baud rate in USB CDC? I dont see any configuration for that in cubemx. My MCU is STM32F042F6P6.
Would really appreciate some help, since I will not believe that a simple Arduino UNO has higher baud rates (1Mbaud/s) than my MCU which has a 48 MHz clock compared to 16 MHz. There has to be a way of transmitting serial data faster.
