This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: Using LWIP debug output on Tiva

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

How do I get the LWIP debug output to print to the UART? I am using one of the eval boards with the USB UART on UART0. There is a LWIP_DEBUG that is defined but I guess I need to add some code to get the UART to work. I have tried a few things but just get errors. Any example would be appreciated. Thanks

  • Try this: Import the project from TivaWare: C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\enet_lwip

    Then edit the file lwipopts.h, starting on line 393, change #if 0 to #if 1. On line 404 define LWIP_DEBUG as UARTprintf(const char *pcString, ...)

    #if 1
    #define U8_F "c"
    #define S8_F "c"
    #define X8_F "x"
    #define U16_F "u"
    #define S16_F "d"
    #define X16_F "x"
    #define U32_F "u"
    #define S32_F "d"
    #define X32_F "x"
    extern void UARTprintf(const char *pcString, ...);
    #define LWIP_DEBUG UARTprintf(const char *pcString, ...)
    #endif
    

    Select the level of LWIP_DBG_MIN_LEVEL (lines 409 - 411). Turn on the debug messages you want in lines 417 to 449.

  • Hello Bob

    I have got it printing now, but some of the variables are not printing correctly using UARTPrintf. 

    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum %x\n", udphdr->chksum));

    The above just prints garbage. If I remove the variable then it prints the message ok. Is there any solution to this?

    Thanks

    Jon

  • UARTprintf() handles %x, so I don't know what the issue is. What does the garbage look like?