S I G N U M S Y S T E M S
8 3 0
Note:
You cannot use Chameleon’s startup macro as is.
However, most Chameleon macros can be modified for the
use with the GDB server.
Board and CPU Customization
Connecting to custom-made boards and processors involves the following steps.
1.
Appropriately modify the emulation parameter file specified in the -emu option. If
Chameleon Debugger is connected to the CPU, some of the parameters returned by the emu
command may need to be stored in this file. Start the GDB server to verify the connection
to the target.
2.
Adjust the startup macro and termination macro used with the -init and -term options,
respectively. The initialization macro should enable RAM on the target, set up the PLL, and
kill the watchdogs. If you are loading code to flash, enable write access to the flash.
3.
When testing your macros, use the ECHO ON directive to receive screen feedback. Also,
utilize the DB, DW and DD macro commands to validate your settings.
Loading to Flash
The GDB server can load the code directly to flash memory. The flash type and its base address
should be provided through the –flash option. Examples of how to configure the GDB server
for several microcontrollers with internal flash memory are shown on page
4
.
The current version of the server supports the following flash types:
external CFI compatible NOR flash,
internal flash in most microcontrollers based on the ARM7, ARM9, and Cortex-M3 cores.
Some target systems utilize RAM to improve programming speed. Use the –ram option to
specify the size and location of a RAM buffer on the target processor. Typically, 2KB of RAM is
ample for efficient flash programming.
For more information on the supported flash types and flash specific parameters see
Command-
Line Flasher for ARM, XScale and Cortex: User Manual,
available at
signum.com/tecdoc.htm
.
There is no need to define in the debugger where the flash is located. Writing to flash memory
from within the debugger invokes the flash programmer automatically. This allows you both to
download the code to the flash using simple load and file commands and to write directly at an
arbitrary flash address using the -data-write-memory command or an assignment expression like
this:
(gdb) set *(char *)0x100 = 0x12
To restrict flash programming to code loading, call the server with the -no-flash-write option.
This option requires any loading to the flash to be preceded by the “monitor flash before-load”
and followed by the “monitor flash after-load” GDB commands.
6