cancel
Showing results for 
Search instead for 
Did you mean: 

How to use printf and scanf using uart for stm32h7 boards

Aarra.1
Senior

Hello,

I have been using the stm32h757i-eval board for a while. And I want to redirect the printf and scanf functions to the uart. I have referred the forum for the solution but couldn't find any helpful answers . I'm using stm32 cube ide (1.7.0).

Kindly help me to perform the same.

1 ACCEPTED SOLUTION

Accepted Solutions
Javier1
Principal

i guess you already tried this https://shawnhymel.com/1873/how-to-use-printf-on-stm32/

I never used a H7 board , i guess you issues come from having two M4 and M7 cores?

View solution in original post

6 REPLIES 6
Javier1
Principal

i guess you already tried this https://shawnhymel.com/1873/how-to-use-printf-on-stm32/

I never used a H7 board , i guess you issues come from having two M4 and M7 cores?

Thank you so much for your response @Javier Muñoz​ 

This article helps alot!

I have tried the link you suggested @Javier Muñoz​ and configured my board exactly the way mentioned.

But I do not see anything being printed on my console.

I'm not sure if its the issue with dual cores, as according to my understanding you can configure individual cores.

Or if the issue is with my uart configuration.

Kindly help me with with my queries.

Regards

Show us how your Uart is configured, maybe post your code or something so we get a clear picture of your setup.

Quick question: are you using the correct USART1 port (pins PB14 and PB15)? (the one connected to your stm32h757i-eval's stlink)

https://www.st.com/resource/en/schematic_pack/mb1246-b0x_schematic.pdf

0693W00000GZtDYQA1.png0693W00000GZtEbQAL.png

Michael E
ST Employee

Hello @Aarra.1​ , you can also try with the STM32 step by step on the wiki.

The Step 3 explain how to print a debug message through UART.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you very much for your response.

I was going wrong with the usart configuration and have solved the issue now.