Debugging is a very important part of developing new code. Without a good way to debug code, it becomes very difficult to find and fix bugs in the code. The
Modtronix Embedded Debugger was developed to make it easier developing complex projects that can be created with the Modtronix TCP/IP stack. For details, click
here.
The Modtronix Embedded Debugger is an application that will display detailed debug information for very short messages received from the hardware being debugged. These detailed messages are defined in XML project files. Each project can have multiple project files. The Modtronix SBC65EC Web Server is shipped with two project files:
- The one is in the "net" folder at "../src/net/mxdebug.xml". This project file should not be modified by the user (unless the user makes modifications to the TCP/IP stack), and contains debug defines for the Modtronix TCP/IP Stack.
- The second is in the "src" folder at "../src/mxdebug.xml". This project file contains debug messages for the application. All code added by the user should be in the "src" folder. Any debug info the user wants to add should be done in this project file.
At delivery, the Modtronix SBC65EC Web Server has debugging disabled. All pre-built hex files shipped with the Modtronix SBC65EC Web Server also have debugging switched off! For details on changing the debug information outputted, or disabling it, see the Debugging section of this document.
To enable and view the debug information outputted by the Modtronix SBC65EC Web Server, do the following:
- Download the Modtronix SBC65EC Web Server source code, and comment out the "#define DEBUG_OFF" line in the "projdefs.h" file.
- Open one of the supplied MPLAB project files in MPLAB, and build the project. The project will now be built with the debugger enabled - debug messages will be output on the serial port.
- Download, install and start the Modtronix Embedded Debugger
- Select the project folder with the "File", "Select Project Folder" menu item. Set it to the "../src" folder of the dowloaded source code. After doing this multiple tabs will be created in the Modtronix Embedded Debugger.
- Connect the target board to the serial port of the PC running the Modtronix Embedded Debugger. The serial port used can be configured in the program options. The default speed is 57600.
- Apply power to the target board. It will now start outputting debug information that will be displayed in the Modtronix Embedded Debugger.