Skip to main content
Mathias Zviedris
Associate II
July 24, 2017
Question

How to set LWIP debug to usart2 ?

  • July 24, 2017
  • 8 replies
  • 3119 views
Posted on July 24, 2017 at 10:29

Hi,

i already have done the setup for the lwip stack on the STM3210C-Eval board. I can already send via TCP/UDP and also RS232 to the uC (PC-->uC) and get also a echo back (uC-->PC). The debug output of the lwip-stack is already configured via cubemx, too. But i have absolutly no idea, how to configure the lwip-stack (via lwipopts.h or something else) that i can see the debug output of the lwip on RS232. Can anybody give a hint ?

Thanks in advance,

Mathias

    This topic has been closed for replies.

    8 replies

    waclawek.jan
    Super User
    July 24, 2017
    Posted on July 24, 2017 at 13:05

    Create a function which outputs a string through the method of your choice (), then

    #define LWIP_PLATFORM_DIAG(message) yourfunction(message)

    (you can similarly define LWIP_PLATFORM_ASSERT(message))

    Debug is enabled globally by

    #define LWIP_DEBUG                      1

    and then there are individual debugs, e.g.

     #define UDP_DEBUG                        LWIP_DBG_ON

    #define LWIP_DBG_TYPES_ON    (LWIP_DBG_ON | LWIP_DBG_TRACE)

    See [lwip-1.4.1]/src/include/lwip/debug.h

    JW

    Mathias Zviedris
    Associate II
    July 26, 2017
    Posted on July 26, 2017 at 11:29

    Hi Jan, thank you for your fast and very good response ! I enabled the debuggin via cubemx and thought, that LWIP_DEBUG is already defined. I didnt have a look on it and that was the cause of the problem. Now i can debug . Thank you

    waclawek.jan
    Super User
    July 26, 2017
    Posted on July 26, 2017 at 14:08

    I enabled the debuggin via cubemx and thought, that LWIP_DEBUG is already defined.

    And what did that do then?

    I am not interested in Cube/MX at all, but ST might want to hear some feedback.

    JW