[coldfire-gnu-discuss] Debugging code in Flash with SG++ Lite

Maxim Kuvyrkov maxim at codesourcery.com
Tue Nov 2 07:28:02 UTC 2010


On 10/14/2010 08:41 PM, Tarmo Kuuse wrote:

> I'm confused. The 52223 is not supposed to execute anything on address
> 0xa. On reset, ColdFire loads the stack pointer from address 0x0
> (=0x20008000), then the program counter from address 0x4 (=0x00000418)
> and finally executes the instruction at PC. Address 0xa is not in the
> menu, so why does it generate a SIGTRAP? Debugging from Flash should not
> be so complicated - am I missing something?

Am not sure what may be causing the problem as I don't have an M52223EVB 
board handy to test.  Below are a couple of theories though:

1. Double initialization.

The board is being initialized twice in your setup.  The reset sequence 
which is part of the binary image does the first initialization and the 
sprite executes initialization for the second time using commands from 
the board file.

You can try attaching the sprite to the running board without resetting 
and initializing the board, there is the "-a" sprite command-line option 
for that.  You can add a spinning loop at the beginning of your main() 
to avoid the program running away before you attach to it.

2. The binary image is written incorrectly.

I suggest you try an evaluation copy of SourceryG++ for ColdFire ELF and 
use the SourceryG++ Sprite to program the flash.

Regards,

-- 
Maxim Kuvyrkov
CodeSourcery
maxim at codesourcery.com
(650) 331-3385 x724



More information about the coldfire-gnu-discuss mailing list