printf does not work in example project "LwIP_HTTP_Server_Netconn_RTOS" on Nucleo-STM32F767ZI board
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-02-04 10:00 PM
Hi,
I started a new project with selected target of Nucleo-STM32F767ZI board, and followed the instructions from
"How to redirect the printf function to a UART for debug messages"
The printf works in the new project, however, when I did the same in the example project "LwIP_HTTP_Server_Netconn_RTOS", I did not get anything from printf.
I added the following into the main.c of the example project:
and
Regards
Chao
- Labels:
-
ST-Link
-
STM32F7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-03-01 6:51 AM
Hello @Chao ,
can you please attach the modification done in a text format because i can't read the pictures they are too much blurry .
in the meanwhile her are the step you need to follow to get Printf redirection with UART :
- choose the UART instance directly connected to the Virtual Com Port (VCP) of STLINK this can be found in the in you case UART3 PD8 and PD9.
- make sure that the application in which you are trying to implement the redirection of printf does not have any conflicting GPIO config with those pins or this UART instance (which dosn't seem to be the case in the lwip example )
- check if you enable the GPIOD clock the UART clock and you properly configured UART3 instance and selected pin PD_8 and PD_9
- define the putchar prototype as follows in main.c (for CubeIDE):
-
#include "string.h"
#include <stdio.h>
-
int __io_putchar(int ch)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART3 and Loop until the end of transmission */
HAL_UART_Transmit(&huart3, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
-
you will find in this link a working implementation of printf redirection with uart on the Nucleo-STM32F767ZI board from which you can cross check all the necessary configuration .
BR
