Debugging a program located in internal FLASH of the M52235 ColdFire MCU.
Claude Sylvain
csylvain at electro-technica.com
Sat Feb 17 04:14:29 UTC 2007
Hello,
The last time I tryed to get out of trouble, I forgot to change the
PC value (as you recommend me to do).
So, I tryed again (without forgetting to change the PC value).
Here is the GDB output:
----------
..
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) 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) p/x *(int *)&__data_start = 0x1234567
$3 = 0x1234567
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000404 in __start ()
(gdb) p/x *(int *)&__data_start = 0x1234567
$4 = 0x1234567
(gdb) continue
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000404 in __start ()
(gdb) stepi
0x00000404 in __start ()
(gdb)
0x00000404 in __start ()
(gdb)
0x00000404 in __start ()
(gdb)
0x00000404 in __start ()
(gdb) print *(unsigned int *) &__data_start
$5 = 19088743
(gdb)
----------
As you can see, the MCU is still stucked at the middle of an instruction.
Claude Sylvain
Electro-Technica inc.
More information about the coldfire-gnu-discuss
mailing list