[coldfire-gnu-discuss] Debugging from flash

Frank Bennett frank.bennett at valcomelton.com
Fri Oct 31 14:05:00 UTC 2008


I'm having the same problem.

I am running, debugging my standalone application out of SDRAM 
just fine until I attempt a restart (set pc indirect location 4). 
The actual process I was attempting is:
  o Flash external flash with application elf file debugged in SDRAM
  o boot from internal Flash, relocate
  o init SDRAM controller
  o copy external Flash to SDRAM @ location 0 
  o start execution at address found in location 4 (restart)

void RunProgramImage(void)
{
    /*  Call application startup code */
    asm("move.l 4.l, %d1; move.l %d1, -(%a7); rts;");
}

Using start_c.c I added:
  o disable interrupts til after initialization
  o put __cs3_regions on a long boundary alignment via linker script
  o linked in _sbrk() to set heap_ptr=NULL (probably not necessary since it's in .bss)

Now __cs3_start_c seems to init the .bss section but now I die in the first call to 
malloc(discovered using pemico debugger).
....suggestions?

thanks,
Frank Bennett

using gdb/sprite I run the application, hit <ctrl>c, I only get:

(gdb) set $pc=0x400
(gdb) s
26              move.l  #__cs3_region_start_ipsbar+0x108050,%a0
Current language:  auto; currently asm
(gdb)
28              move.l  #0x8fff,%d0
(gdb)
29              move.w  %d0,0x7FB4(%a0)
(gdb)
30              move.l  #__cs3_region_start_rambar+0x01,%d1
(gdb)
31              movec.l %d1,#0x81
(gdb)
32              move.l  #__cs3_region_start_rombar+0x01,%d1
(gdb)
33              movec.l %d1,#0xC04
(gdb)
35              move.l  #0xc0,%d0
(gdb)
36              move.b  %d0,0x-8000(%a0)
(gdb)
37              move.l  #__cs3_region_start_ipsbar,%a0
(gdb)
44              clr.l   %d0
(gdb)
45              move.w  %d0,__cs3_region_start_ipsbar+0x140000
(gdb)
46              jmp _start
(gdb)
_start () at start.S:21
21              move.l #__cs3_stack, %sp
(gdb)
_start () at start.S:23
23              move.l #0, %fp
(gdb)
_start () at start.S:25
25              move.l %fp,%sp at -
(gdb)
_start () at start.S:26
26              jmp __cs3_start_c
(gdb)
__cs3_start_c () at start_c.c:27
27      {
Current language:  auto; currently c
(gdb)
0x40000000 in ?? ()
(gdb) bt
#0  0x40000000 in ?? ()
(gdb) b __cs3_start_c
Breakpoint 4 at 0x554: file start_c.c, line 27.
(gdb) info r
d0             0x0      0x0
d1             0xf0000001       0xf0000001
d2             0xfffffffc       0xfffffffc
d3             0x408    0x408
d4             0x49     0x49
d5             0xf      0xf
d6             0x4115c5 0x4115c5
d7             0xf      0xf
a0             0x40000000       0x40000000
a1             0x0      0x0
a2             0xf40003ee       0xf40003ee
a3             0x6120bc1        0x6120bc1
a4             0xffffffff       0xffffffff
a5             0x672ae608       0x672ae608
fp             0x0      0x0
sp             0x2000ffec       0x2000ffec
ps             0x41e02704       0x41e02704
pc             0x40000000       0x40000000
(gdb)







More information about the coldfire-gnu-discuss mailing list