Additionally, the debug levels have to be set for the different code modules. This is done in the lines following the "#define DEBUG_OFF" line in the "projdefs.h" file. The following debug levels can be enabled for each file:
Each debug module has to be configured for its desired debug level. For example, if detailed debug information is required for the "http" module, the "#define DEBUG_HTTP LOG_WARN" line can be changed to "#define DEBUG_HTTP LOG_DEBUG".
In the source code debug information is written out with lines that look like this:
#if (DEBUG_HTTP >= LOG_INFO) debugPutMsg(1); #endif
This example will display the debug message defined in the project file in the "HTTP" section with a "message code" = 1. The debug message will only be written out if the debug level for the HTTP module is configured (in the projdefs.h file) to be LOG_INFO or higher (LOG_ERROR, LOG_WARN or LOG_INFO).
After the project has been configured for the desired debug level, it has to be recompiled and the target board programmed with the new firmware.
After following these steps, the code has to be recompiled and the new firmware uploaded to the target board.
|Code Debugging. |