cancel
Showing results for 
Search instead for 
Did you mean: 

How to activate debug messages for LWIP?

Not applicable

I was able to activate the messages for USB Host, but I am not able for LWIP, it seems that there is a specific combination of options, so that messages are enabled

Thank you.

/** Enable debug message printing, but only if debug message type is enabled
 *  AND is of correct type AND is at least LWIP_DBG_LEVEL.
 */
#ifdef __DOXYGEN__
#define LWIP_DEBUG
#undef LWIP_DEBUG
#endif
 
#ifdef LWIP_DEBUG
#define LWIP_DEBUGF(debug, message) do { \
                               if ( \
                                   ((debug) & LWIP_DBG_ON) && \
                                   ((debug) & LWIP_DBG_TYPES_ON) && \
                                   ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \
                                 LWIP_PLATFORM_DIAG(message); \
                                 if ((debug) & LWIP_DBG_HALT) { \
                                   while(1); \
                                 } \
                               } \
                             } while(0)
 
#else  /* LWIP_DEBUG */
#define LWIP_DEBUGF(debug, message)
#endif /* LWIP_DEBUG */

0690X00000DYNnfQAH.png

1 REPLY 1
alister
Lead

Add to your lwipopts.h,

#define LWIP_DEBUG 0
//#define NETIF_DEBUG LWIP_DBG_ON
//#define DHCP_DEBUG LWIP_DBG_ON
//#define UDP_DEBUG  LWIP_DBG_ON
//#define MEMP_DEBUG LWIP_DBG_ON
//#define MEM_DEBUG LWIP_DBG_ON
//#define ICMP_DEBUG LWIP_DBG_ON

Uncomment whichever topic you want logging.