Sections
You are here: Home Documentation Tutorials Programming the Make Controller Kit Debugging

Debugging

How to debug your projects.

There are two ways to go about debugging programs running on your Make Controller:

  1. Use the simple Debug system in which the Make Controller will send out debug messages via OSC over USB and/or Ethernet.  This option is simple to use, but not the most powerful option.
  2. Set up to do breakpoint debugging.  This option is more complicated, but much more powerful.

Debug via OSC

A debugging function called "Debug" is defined by the Controller Library. This function allows you to send debug data to another machine via UDP or via USB.

The Debug( ) function is declared as follows:

  int Debug( int level, char* string, ... );

The idea is that the function can be called with parameters like printf( ) or sprintf( ). The first parameter specifies the debug level. This helps categorize messages according to severity. Here are some examples:

  Debug( DEBUG_ALWAYS, "Hello" );

Debug( DEBUG_ERROR, "Oh no! No memory" );

Debug( DEBUG_MESSAGE, "Done parsing. Length %d", length );

There is a debug subsystem in the firmware API which can be accessed via OSC. You can control the debug level and whether USB and or UDP channels get the Debug messages. By default the system debug level is set to DEBUG_MESSAGE - which means that all messages will be sent.

Breakpoint Debugging

No matter which way you go about it, you'll need a piece of JTAG hardware for breakpoint debugging.  If you've purchased Rowley's CrossWorks IDE, it's pretty easy to set this up - basically, just plug in and then check their documentation if you have any trouble.  If you want to go the open source route, you can do breakpoint debugging with OpenOCD (Open On-Chip Debugger).  Check the Debug With OpenOCD tutorial for details on how to do that.
 
Log in


Forgot your password?
New user?