Skip to main content
Zhonghao Huang
Associate II
May 29, 2018
Question

USB CDC based on STM32F103 has different transmission effect on Windows7 and Ubuntu

  • May 29, 2018
  • 1 reply
  • 685 views
Posted on May 29, 2018 at 09:22

I used STM32F103 to send data to the PC via USB CDC at a frequency of 4000Hz, 21 bytes per packet. The code generated by STMCube. And then I found that only 1000 packets can be received per second on Windows7 via serial assistant, but it can normally receive 4000 packets per second on Ubuntu via CuteCOM. How do I achieve the same effect on Windows7? Thank you.

int main(void)
{
 HAL_Init();
 SystemClock_Config();
 MX_GPIO_Init();
 MX_USB_DEVICE_Init();
 while(1)
 {
 __WFI();
 }
}
void HAL_SYSTICK_Callback(void) //4000Hz
{
 CDC_Transmit_FS(buff, 21);
}

I use python to test, and the result is:

0690X0000060Kz6QAE.png 0690X0000060KzGQAU.png #stm32f1 #cdc #usb-fs
This topic has been closed for replies.

1 reply

Zhonghao Huang
Associate II
May 31, 2018
Posted on May 31, 2018 at 08:13

Can anyone help me? Thanks~~~