cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446RE : Terminal and USB Virtual Port

Lagodolio
Senior

Hello, I have some problems with my STM32F446RE (Nucleo-64 )and terminal program (as puTTY and so on).

I connected it by its usb connector (CN1) and it was recognized as Virtual Port: Well!

So I opened STM32Cube MX and set:

-STM32F446 board.

-USB_OTG_FS, as Device only (no VBus or SOF).

-USB_Device as CDC (Communication Device Class)

RCC clock is HSC with Crystal/Ceramic Resonator , 8Mhz Input Frequency, 168Mhz HCLK and 48Mhz to USB.

I have generate code for Keil (and for Atollic too, with the same effect).

So I modified main.c by

-Inserting: #include "usbd_cdc_if.h"

The "int main(void)" function now is:

int main(void)
{
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
 MX_GPIO_Init();
 MX_USB_DEVICE_Init();
 uint8_t Text[] = "Hello\r\n";
 HAL_Delay(1000);
 while (1)
   {
     CDC_Transmit_FS(Text,6); 
      HAL_Delay(1000);
    }
}

in "usbd_cdc_if.c" I set:

#define APP_RX_DATA_SIZE 64
#define APP_TX_DATA_SIZE 64
 
 
 

I compiled my project with no errors.

 Debug and Run didn't give any errors but if I open my COM by a terminal...no message appears!

Can you help me?

Thanks and best regards!

1 ACCEPTED SOLUTION

Accepted Solutions

CN1 connects to the ST-LINK's F103 device, it does NOT connect to the F446.

Please review the schematic in user manual for a specific understanding of the wiring.

The ST-LINK's VCP connects to an F446 USART

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

CN1 connects to the ST-LINK's F103 device, it does NOT connect to the F446.

Please review the schematic in user manual for a specific understanding of the wiring.

The ST-LINK's VCP connects to an F446 USART

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Lagodolio
Senior

OPS... you are right!

I'm sorry , I thought "USB Virtual Port " I saw in Windows device manager was cn1 USB...

Thanks for your help!