Skip to main content
Visitor II
September 22, 2024
Question

LWIP LOG NOT DISPLAYED

  • September 22, 2024
  • 3 replies
  • 1442 views

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

    This topic has been closed for replies.

    3 replies

    ST Employee
    September 23, 2024

    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

    MGOEL.1Author
    Visitor II
    September 24, 2024

    @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

     

    ST Employee
    September 24, 2024

    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

    MGOEL.1Author
    Visitor II
    September 25, 2024

    @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