Debugging
[System Modules]


Detailed Description

Introduction

For code development, the debug feature can be enabled. To do this, comment out the following line in the "projdefs.h" file:
 #define DEBUG_OFF 
For the production version, please be sure to disable the debug feature! If enabled, it will slow the code down a bit. All pre-built hex files shipped with the Modtronix SBC65EC Web Server have debugging switched off! To use debugging, the above mentioned define must be removed (commented out) and the project rebuilt!

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.

Adding Debug Messages

Adding debug messages to new code is simple:

After following these steps, the code has to be recompiled and the new firmware uploaded to the target board.


Files

file  debug.h
 Code Debugging.


Generated on Mon Oct 9 13:22:09 2006 for SBC65EC Web Server by  doxygen 1.4.7