Bdale and I are building a little rocket computer based on the TI cc1111
processor chip. It's got an 8051 CPU inside, so we're using sdcc to
build code for it.
It also has a built-in debug interface that can be used to control
execution on the part, including reading/writing memory and registers as
well as controlling 4 hardware breakpoints.
These 4 hardware breakpoints can be used to stop execution even in
flash, without rewriting the flash contents.
What I've written is a clone of the 's51' program which talks over the
debug port to the cc1111 through a USB to GPIO adapter based on the
cp2103 chip. This is available at git://keithp.com/git/ccdbg and is
licensed GPLv2. There's also a program loader there, which can either
write a program to flash or into ram.
Because there's only 4 hw breakpoints, I can't use the current sdcdb
technique of setting a breakpoint at every function entry/exit to
construct a call trace. What I'm doing is reconstructing the call trace
dynamically by reading the stack. I also read the instructions after the
return to find out how many registers were saved, so I can find the next
frame. This code is available in a copy of the sdcc tree at
This is working for primitive demos; obvious there's more abstract
interpretation to be done to correctly walk the call chain, but I think
the basic technique will work as long as I assume that sdcc is
generating all of the code.
One option would be to annotate stack manipulation in the debug file
generated by the compiler, but that wouldn't work with assembly language
functions very well.
Figured I should at least let the sdcc people know about this work if
there was wider interest.
for the Silabs MCUs there is a related effort which may be of interest.
Ricky White (the author of ec2drv) has set up a web site:
ec2drv and newcdb are GPL as well, maybe get in contact with Ricky?
On Tue, 2008-12-30 at 10:27 +0100, Frieder Ferlemann wrote:
> for the Silabs MCUs there is a related effort which may be of interest.
> Ricky White (the author of ec2drv) has set up a web site:
Thanks for the pointer; I'll give 'newcdb' a try. Any reason why sdcdb
and newcdb exist as separate projects still?