2026-01-27 2:29 AM - edited 2026-01-27 2:36 AM
Hi everyone,
I’m feeling a bit defeated by a task that should be "Hello World" level simple. I’m trying to get a basic printf to show up in PuTTY using a NUCLEO-G474RE, but I’m getting absolutely nothing in the terminal.
I do this all the time with my NUCLEO-H723ZG using USART3 and it works like a charm. For the G4, I’ve switched over to USART2, but no luck.
Here is my setup:
Toolchain: CubeMX + CMake.
The Logic: I've overwritten __io_putchar() with a HAL_UART_Transmit call.
The Config: USART2 is enabled, baud rate matches PuTTY (115200), and the clocks seem fine.
I even had a friend who uses G4 boards regularly take a look, and even he couldn't figure out why the data isn't hitting the ST-Link. It feels like I'm missing one tiny, G4-specific checkbox or jumper setting.
I've put together a bare-bones repository with just the code for the printf here: https://github.com/mpek29/nucleoG4
Has anyone else run into similar issues ?
Thanks in advance for any pointers, I'm sure it's something silly I've overlooked!
Solved! Go to Solution.
2026-01-27 3:54 AM
@mƎALLEm wrote:on NUCLEO-G474RE, VCP is connected to USART1 and you should solder SB12 and SB20 as I stated previously.
The User Manual says LPUART1 by default, or USART1 by changing SBs ?
Screenshot above.
2026-01-27 4:02 AM - edited 2026-01-27 5:12 AM
@Andrew Neil wrote:
@mƎALLEm wrote:
on NUCLEO-G474RE, VCP is connected to USART1 and you should solder SB12 and SB20 as I stated previously.
The User Manual says LPUART1 by default, or USART1 by changing SBs ?
Screenshot above.
In fact, it could be both (USART1):
or (LPUART1 the default configuration)
He needs to play with the solder bridges.
Meanwhile, @mpek29 you can use the printf example provided by the CubeG4 over this link:
2026-01-27 4:10 AM - edited 2026-01-27 4:11 AM
@Andrew Neil wrote:
@mpek29 wrote:I've gathered that it’s possible to achieve the same functionality using UART2 instead for the NUCLEO-G474RE. .
Where did you "gather" that?
@mpek29 Did you ask ST's AI assistant, "Sidekick" ?
It does say UART2:
But that is wrong!
2026-01-27 5:52 AM
USART2 can be used at PA2&PA3 in the same way as LPUART1 can be.
Something has probably got lost in the clicking.
Debug as usually, by observing all relevant (RCC, USART, GPIO) registers' content (assuming you've checked the hardware already - pins connections, clock) and observing the waveforms on given pins using oscilloscope/LA.
JW
2026-01-27 6:01 AM
I’ve found the solution! It turns out I had mistakenly selected the wrong board/MCU part number during the initial setup in STM32CubeMX.
After restarting the project with the correct board profile and configuring LPUART1, everything is working perfectly. My apologies for the confusion, and thanks to everyone who took a look!