在lwip 2.1.2的版本,打开的debug 调试的步骤:
1.在debug.h 文件中找到debug打印的定义

默认LWIP_DEBUG这个宏没有定义,
2.在lwipopt.h 文件中或者其他文件定义 一下LWIP_DEBUG这个宏,

3.在opt.h 中可以打开各种宏的调试信息,
/*
---------------------------------------
---------- Debugging options ----------
---------------------------------------
*/
/**
* @defgroup lwip_opts_debugmsg Debug messages
* @ingroup lwip_opts_debug
* @{
*/
/**
* LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
* compared against this value. If it is smaller, then debugging
* messages are written.
* @see debugging_levels
*/
#if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
#endif
/**
* LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
* debug messages of certain types.
* @see debugging_levels
*/
#if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
#endif
/**
* ETHARP_DEBUG: Enable debugging in etharp.c.
*/
#if !defined ETHARP_DEBUG || defined __DOXYGEN__
#define ETHARP_DEBUG LWIP_DBG_ON//LWIP_DBG_OFF
#endif
/**
* NETIF_DEBUG: Enable debugging in netif.c.
*/
#if !defined NETIF_DEBUG || defined __DOXYGEN__
#define NETIF_DEBUG &nb

本文介绍了在lwip 2.1.2版本中如何开启debug调试,包括在debug.h和lwipopt.h中定义LWIP_DEBUG宏,以及在opt.h中启用不同模块的调试信息。
2897

被折叠的 条评论
为什么被折叠?



