Skip to main content
Visitor II
June 26, 2024
Question

Not able to identify the error in the code

  • June 26, 2024
  • 3 replies
  • 1066 views

Can anyone help to find the error in the code because it is not able to print anything on the console. I have also try to change the pins of UART but then also it is not be to print anything on the console. 

3 replies

Andrew Neil
Super User
June 26, 2024

You need to provide a lot more details!

What "console" are you talking about?

What board are you running on/

How is that board connected to the "console"?

etc, etc - see:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

Start with a minimal example which just sends fixed message

sending continuous uppercase 'U' is good - as you can then easily check that on a 'scope, see if the baud rate is correct, etc 

Then try receiving, and doing a simple loop-back ...

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
June 26, 2024

Understand we are not psychic here..

Is this the STM32F411RE you've mention in a prior post? Is it on a NUCLEO-F411RE board?

Check the MSP code initializing the USART2 clocks, and GPIO pins.

The baud rate must match those of the ST-LINK VCP/CDC connection, if that's what you're attempting to use.

Send some data directly via HAL_UART_Transmit(), then check the plumbing for the __io_putchar() for printf() to work.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
February 25, 2026

Since this is your first project (like my first Flooring Project website), small setup mistakes can stop everything from working.

If nothing is printing on the console, it’s likely a configuration issue — such as UART not initialized properly, wrong baud rate, incorrect COM port, or TX/RX pin mismatch.

In my Abu Dhabi Flooring Project, I also learned that even a tiny setup error can cause no output. Double-check the initialization and serial settings, the issue is usually something small but important.