cancel
Showing results for 
Search instead for 
Did you mean: 

Debbug printf with Nucleo-h743zI2

Ariel1
Associate II

Hi everyone,

Im  pretty new with using stm32.

Im trying to debug and make printf output to the log.

 

I found alot of vidoes but got pretty lost.

 

Im confused about what is the way of doing it from the start. 

 

I need to setup the external clock?

Then the  trace asynchronous Sw?

 

 

Any explaination would be amazing, thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
5 REPLIES 5

@Ariel1 wrote:

Im  pretty new with using stm32.


Do you have any experience with any other microcontroller(s)? With C programming in general?

 


@Ariel1 wrote:

Im confused about what is the way of doing it from the start. 


The best thing is not to start with printf - that's getting rather advanced!

The first thing to do when starting with any new embedded platform is just to get a simple LED blinking.

"Blinky" is the embedded equivalent of "Hello, World".

While doing that, get used to using the debugger - stepping the code, viewing data & registers, etc.

The next step is to send characters using simple, direct, UART output.

In the case of STM32, use HAL_UART_Transmit().

This will not only prove your software, but also the hardware connections to your terminal (or whatever).

The above is steps 1-3 here:

https://wiki.st.com/stm32mcu/wiki/Category:Getting_started_with_STM32

Then - and only then - you can move on to printf 

https://community.st.com/t5/stm32-mcus/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages/tac-p/733969/highlight/true#M1096

https://wiki.st.com/stm32mcu/wiki/Getting_started_with_UART

https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Step3_Introduction_to_the_UART

 

More on STM32 getting started:

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719468/highlight/true#M260690

 

 

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.

Thanks alot,

 

I was able to connect USART2 via FTDI from the PC to the NUCLEO-H743ZI2.

And read/send data.

 

But what im missing out is how i can send/read data via my St-linkv3 usb connection for debugging.

 

How do i know what USART i need to configure(such that i can redirect it) ?

I cant find it in the user manual of the NUCLEO-H743ZI2.

 

Any advice would be great, thanks alot! 


@Ariel1 wrote:

I was able to connect USART2 via FTDI from the PC to the NUCLEO-H743ZI2. And read/send data.


So that's answered the original question, then?

If so, please mark the solution:

https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256

 


@Ariel1 wrote:

what im missing out is how i can send/read data via my St-linkv3 usb connection for debugging.


That's a new question - please start a new thread for that.

Post a link here so that people can find it...

(but first, check out the Nucleo board's User Manual - it's in there)

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.

Hi thanks for your quick response. 

 

It didn't answered my original question because I still cannot debug and output logs.

I found that in the manual: 

"By default the USART3 communication between the target STM32H7 and the STLINK-V3E is enabled, to support the Virtual COM port (SB12 and SB19 ON)."

 

It means I can just use USART3 and it will be used to output to the VCP?

 

Thanks, Ariel

Found that:

https://qiita.com/Tohno/items/53d1ef8804428858f3b4

 

Thanks for your help!