Debugging a program located in internal FLASH of the M52235 ColdFire MCU.

Claude Sylvain csylvain at electro-technica.com
Sun Feb 18 06:12:38 UTC 2007


Hello Marc,


 >
 > Marc Vincent wrote:
 >
 >
 > You need to setup both RAMBAR's before accessing internal SRAM (your
 > stack push: movel %d1,%sp at -). Try inserting these lines before the
 > push:
 >
 >    movel #0x20000201,%d0
 >    movec %d0,rambar
 >    movel #0x20000200,%d0
 >    movel %d0,0x40000002 /* SCM RAMBAR */
 >
 >
 > Note: Maybe the setup script used by the sprite already enables the
 > internal SRAM in order to load program to it, but you need to do the
 > above anyway to run without gdb.
 >
 >

I have not the startup source code.  So, I can not make any 
change/correction to it.

Note that "__start" is not the address pointed by the reset 
vector.  The address pointed by the reset vector is "__reset".
I voluntarily changed the PC to force the MCU to start from that 
point ("__start") to avoid an endless loop (at "__reset") in which 
the MCU stuck.

All the problems seems to be in the startup code.

First problem: The startup module "cf-unhosted-crt0.o" used by 
"m52235evb-rom.ld" can not be used in standalone mode (without the 
debugger) because of an endless loop at "__reset" that enable the 
debugger to take control of the MCU.

Second problem: Even if this startup module is used with the 
debugger, something hang the MCU at the middle of an instruction !?


It seems to me that two solutions are possible:

1) Get the startup source code and try to patch those problems.  The 
startup source code is not included with Sourcery G++ Lite.
Is it possible to get it ?

2) Write a startup module from scratch.


Regards,

Claude Sylvain
Electro-Technica inc.





More information about the coldfire-gnu-discuss mailing list