cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446RE USB CDC device problem

KSriv.1
Associate

Hi, I'm trying to follow this tutorial :- https://youtu.be/Hk--a4K497M -- demonstrating how to transmit simple string to PC via usb virtual com port. Unfortunately, I'm getting no output on my serial port.

During debugging, I found that CDC_Transmit_FS() always returns USBD_BUSY since hcdc->TxState never goes to zero. Also, hcdc->RxBuffer and hcdc->TxBuffer throw an error stating cannot access memory at a certain address.

0693W000007ZdGGQA0.pngThings I have tried :-

1) increase heap and stack size to 800 and 1200 respectively.

2) change USB_HS_MAX_PACKET_SIZE and CDC_DATA_HS_MAX_PACKET_SIZE to 256.

3) Adding more delay before CDC_Transmit_FS().

PS: I'm able to send and receive data via USB using MBed online compiler's library (Serial (USBTX, USBRX)).

OS: Windows 10, Serial port monitor : CoolTerm , Toolchain: STM32CubeIDE.

1 ACCEPTED SOLUTION

Accepted Solutions
Paul1
Lead

Have a look at attached. We use the VCP/CDC for diagnostics. This is a print of our internal wiki notes about it...

  • STM32_VCP_CDC.docx
  • It also has links to other forum posts on the subject.

Basic issue:

  • Some windows programs require the ST to return the port settings of a UART (echo back the baudrate etc.)
  • So modify the ST code to echo back the windows settings, or use a program that doesn't check them (teraterm)

Paul

View solution in original post

2 REPLIES 2
Paul1
Lead

Have a look at attached. We use the VCP/CDC for diagnostics. This is a print of our internal wiki notes about it...

  • STM32_VCP_CDC.docx
  • It also has links to other forum posts on the subject.

Basic issue:

  • Some windows programs require the ST to return the port settings of a UART (echo back the baudrate etc.)
  • So modify the ST code to echo back the windows settings, or use a program that doesn't check them (teraterm)

Paul

KSriv.1
Associate

Hi, thanks for replying !

I tried teraterm, USB CDC transmission is still not working (still stuck in usbd_busy loop) however USART via USART2 is now working !