nucleo STM32G474RE UART communication
Hello,
I just created a default project with the nucleo board template and with VCP initialized, how can I transmit data via UART using the VCP?
Hello,
I just created a default project with the nucleo board template and with VCP initialized, how can I transmit data via UART using the VCP?
The VCP is simply one (LP)U(S)ARTx routed to the ST-Link, which in turn appears as an USB device at the PC.
In case of your NUCLEO-STM32G474RE it is LPUART1 used for this by default. It can be changed to USART1 by changing solder bridges, see UM2505 chapter 6.6.5 "Virtual COM port (VCP): LPUART and USART".
The prinf() function calls
int _write( int file, char *ptr, int len );
which must be implemented to transfer characters to the UART. If you need no other files and file handles the function might ignore its first argument and print everything to the same UART.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.