cancel
Showing results for 
Search instead for 
Did you mean: 

LWIP LOG NOT DISPLAYED

MGOEL.1
Associate II

HI 

I HAVE ENABLED LOG LIKE THIS 

MGOEL1_0-1727013119452.png

WHAT ELSE NEEDS TO BE DONE I HAVE SEEN OLD POST TO WRITE MAIN.C

MGOEL1_0-1727013309202.png

 

BUT STILL NOT SHOWING LOG?

LWIP LOG WILL BE VISIBLE IN CONSOLE OR SWV CONSOLE WHERE?

THANKS IN ADVANCE

4 REPLIES 4
STea
ST Employee

Hello @MGOEL.1 ,

the output of the log as I see in the redefinition of the write function will be redirected to the itm console.

you need to first enable the swv feature in debug configuration setting the clock frequency and the open the port associated with the redirected print 

here is a code tetorial showing how to do it 
Using Printf Debugging, LIVE expressions and SWV Trace in CubeIDE || STM32 || ITM || SWV (youtube.com)


Regards

In order 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.
MGOEL.1
Associate II

@STea thanks for video but i am getting error No source available for "_write _r() at 0x8010be0" i  have checked in debugging as per others errors still it is not printing on s w v port

print f  ("test= %d \n", count);

count++;

fflush(stdout);

MGOEL1_4-1727178736023.png

 

MGOEL1_0-1727178300506.pngMGOEL1_1-1727178351993.pngMGOEL1_2-1727178395576.png

MGOEL1_3-1727178606899.png

thanks in advance

 

STea
ST Employee

Hello @MGOEL.1 ,

you should add this in you main.c file 

/* USER CODE BEGIN 4 */
int _write(int file, char *ptr, int len)
{
  (void)file;
  int DataIdx;

  for (DataIdx = 0; DataIdx < len; DataIdx++)
  { //To get printf working using serial wire viewer (available on cubeIDE only)
	 ITM_SendChar(*ptr++);
  }
  return len;
}
/* USER CODE END 4 */

without any ioputchar prototype needed 

STea_0-1727184553191.png

STea_1-1727184618609.png

if you still experiencing issue, send you main.c file to take a look.

Regards

In order 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.

@STea i have written in main still getting same error

MGOEL1_0-1727232854117.png

i have attached main file .Not able to understand this error

Thanks