ARM: Compiling for Debugging
Once you have
learned a little about NoICE, the next step is to try
source-level debugging.
This example uses ImageCraft ICCARM. You
can follow along even if you don't have this compiler. All files necessary for
you to run the NoICE demo will be provided. Setup for other compilers is
generally similar.
You can download all the files for this example here: hellofoo.zip.
Using another compiler? The steps are similar. Consult your compiler's documentation
to see what debug formats are available and how to select them.
Here is the list of what NoICE supports.
Creating a project
In the ImageCraft IDE, select "Project", "New" to create an empty project.
We called ours "hellofoo.prj". (You could just open hellofoo.prg from the zip file, but you
will learn more if you do it yourself. You probably hate it when people tell you that.)
Select "Project", "Options..." to open the Compiler Options dialog.
In the "Compiler" tab, be sure that "Output Format" is set to "Intel HEX With Debugging Support".
To produce a debug file from the command line or a make file, use the "-g" compiler switch.
|
|
Click on the "Target" tab.
Our example is for an Philips LPC2106, so we select "Philips LPC2106".
Be sure to specify the exact processor and memory configuration
appropriate to your target.
The small version of printf is fine for our needs.
Be sure to uncheck "No C$$init in linker command file".
|
|
Adding Source Code
In the ImageCraft IDE, open or create the source file hellofoo.c, and
add it to the project.
Add the file "myserial.c" to the project. Printf won't work
unless you add myserial.c or otherwise implement putchar and getchar functions.
Build the project, generating hellofoo.dbg and hellofoo.hex, along with
various files that won't concern us further.
(If you don't have the ImageCraft compiler, hellofoo.dbg and .hex are include
in hellofoo.zip.)
|
|
Continue the tutorial with Source-level debugging
|