[coldfire-gnu-discuss] Debugging/Running program in internal Flash.

Claude Sylvain csylvain at electro-technica.com
Thu Feb 15 15:40:36 UTC 2007


Hello Nathan,


 >
 > Nathan Sidwell wrote:
 >

 >>
 >> Claude Sylvain wrote:
 >>
 >> ..
 >> m68k-elf-sprite:Opening P&E USBMultilink port 1 (USB1 : USB-ML-CF Rev C
 >> (PE6012345))
 >> m68k-elf-sprite:Target reset
 >> 0x00000000 in __interrupt_vector ()
 >> Breakpoint 1 at 0x512: file ./src/main.c, line 172.
 >> Note: automatically using hardware breakpoints for read-only addresses.
 >> Program received signal SIGTRAP, Trace/breakpoint trap.
 >> 0x00000004 in __interrupt_vector ()
 >> (gdb)
 >>

 >
 > Because you've not loaded the program, GDB has not initialized $pc.
 > you need to set it manually
 >   p/x $pc = __reset
 >

 >>
 >> Using the disassemble command of GDB, I take a look at the reset entry
 >> point (defined as __reset) and found something that looks like an
 >> endless loop.  See the GDB output below:
 >>

 >
 > This is an error in the rom linker script.  You can work around it
 > by jumping directly to __start
 >   p/x $pc = __start
 >


This seems to not work.
I am not able to figure out what is going wrong.

Here is what GDB says:


				   ----------

..
m68k-elf-sprite:Opening P&E USBMultilink port 1 (USB1 : USB-ML-CF Rev 
C (PE60123
45))
m68k-elf-sprite:Target reset
0x00000000 in __interrupt_vector ()
(gdb) break main
Breakpoint 1 at 0x512: file ./src/main.c, line 172.
(gdb) p/x $pc = __start
$1 = 0x400
(gdb) p/x $pc
$2 = 0x400
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000404 in __start ()
(gdb) disassemble 0x400 0x420
Dump of assembler code from 0x400 to 0x420:
0x00000400 <__start+0>: moveal #536903680,%sp
0x00000406 <__start+6>: moveal #0,%fp
0x0000040c <__start+12>:        movel #0,%d1
0x00000412 <__start+18>:        movel %d1,%sp at -
0x00000414 <__start+20>:        movel %fp,%sp at -
0x00000416 <__start+22>:        jmp 0xc48 <__start1>
0x0000041c <__do_global_dtors_aux+0>:   linkw %fp,#0
End of assembler dump.
(gdb) stepi
0x00000404 in __start ()
(gdb) stepi
0x00000404 in __start ()
(gdb) stepi
0x00000404 in __start ()
(gdb) stepi
0x00000404 in __start ()
(gdb) stepi
0x00000404 in __start ()
(gdb)

				   ----------


Regards,

Claude Sylvain
Electro-Technica inc.





More information about the coldfire-gnu-discuss mailing list