Skip to main content
Graduate
February 4, 2024
Question

printf() on NUCLEO-F767ZI board not working

  • February 4, 2024
  • 2 replies
  • 1039 views

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;

}

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    February 4, 2024

    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 

    Super User
    February 5, 2024

    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