Problems with gdb with mcf5235BCC EVB

matthew riek matthew.riek at gmail.com
Fri Feb 8 06:38:50 UTC 2008


Hi,

I'm new to RTEMS, and I am wanting to do a mcf5329 BSP.  I also have a
mcf5235BCC so I thought I would try to get RTEMS going on the 5235 first
given there is already a BSP for it.  Once I have RTEMS working nicely and
understood on the 5235, i'll start the BSP for the 5329.  I have downloaded
the latest (as of 2 days ago) fedora rpm's (m68k-rtems4.9) toolchain,
obtained the latest CVS head and can build RTEMS and the example
hello_world_c okay.  I also downloaded from sourceforge the
m68k-bdm-1.4-pre1.tar.bz2 package, built and installed the
m68k-bdm-gdbserver.  I have the parallel port P&E wiggler that came with the
5235 EVB, and I can seemingly talk to the board (bdm-chk works until the
SRAM test, which fails and I am assuming because RAMBAR is not set).

I have attached my gdb init script, that initializes SDRAM, and I can
successfully load the hello elf file.  I can step through a few instructions
but it fails when setting the SR register:

313         move.w  d0, (0x40140000)
Current language:  auto; currently asm
(gdb) nexti
314         move.l  #0x01000000,d0              | Set system frequency to
150 MHz
(gdb) nexti
315         move.l  d0, (0x40120000)
(gdb) nexti
316         move.w  #0x2700,sr                  | Disable interrupts
(gdb) nexti
m68k-bdm: error: Invalid target command
Remote failure reply: E01

Mind you, it doesn't fail here all the time, but seems rather intermittent
which is concerning.  If I skip over this bit, It fails at the first jsr
call, as the stack pointer $sp is seemingly uninitialized.  If I set SP to
something reasonable (0x2000fffc) then it fails at the first call to an
rts.  I have also noted that after stepping through a jsr, the stack pointer
is set back to 0xffffffff, not SP-4 as expected.  Both the A7 and otherA7
registers seem to be nuked by executing a jsr too.

Anyway that is some context, now for my questions :D.

1) Does anyone have a gdbinit script for the 5235, or can anyone see
something obviously wrong with the one I have attached.
2) Any ideas why the setting of the SR register fails sometimes (more often
than not).
3) What is the common way to setup the stack pointer when debugging from
memory?  I understand that when running from flash it is set from the vector
table. Should I add code to the 5235 BSP to set the stack pointer when
debugging from ram?
4) does bdm-chk work out of the box with the 5235 (ie, should it pass all
tests) or will I need to configure it.  I haven't looked into this yet, so
please answer this one only if you know off the top of your head.

Oh, also, is anyone else working on a 5329 port?

Any help would be greatly appreciated.  I do feel I am missing something
simple.

Cheers,

Matt Riek.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20080208/43fd3b26/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdbinit
Type: application/octet-stream
Size: 2379 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20080208/43fd3b26/attachment.obj>


More information about the users mailing list