cancel
Showing results for 
Search instead for 
Did you mean: 

printf() on NUCLEO-F767ZI board not working

rdevisetti
Associate II

I had written a function to support printf() using USART3 for NUCLEO-F767ZI board. Please check the code below, but I did not see the prints on the console in STM32CudeIDE. Please let me know what the issue can be. Do I need to do any changes on the board to make it work?

 

int _write(int file, char *ptr, int len)

{

HAL_UART_Transmit(&huart3, (uint8_t*)ptr, len, HAL_MAX_DELAY);

return len;

}

2 REPLIES 2
STTwo-32
ST Employee

Hello @rdevisetti 

I suggest you to take a look at the FAQ: "How to redirect the printf function to a UART for debug messages"

Best regards.

STTwo-32 

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.

Andrew Neil
Evangelist III

Before trying to integrate that into printf(), do you have the UART working on its own?

If the UART doesn't work on its own, it's not going to work via printf !

 

Use this button to properly post source code:

AndrewNeil_0-1707132689130.png

 

To get that extra row of icons, press this button:

AndrewNeil_1-1707132689130.png