cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to identify the error in the code

jainamaster14
Associate

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. 

2 REPLIES 2
Andrew Neil
Evangelist III

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 ...

 

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 Venmo
Up vote any posts that you find helpful, it shows what's working..