Re: Help with building gdb with BDM support for the Coldfire

"Mark Giacobbe" <[email protected]> Mon, 5 May 2008 12:01:07 -0400
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <[email protected]>
I have another interesting issue.  No matter what address I try to set, all
address show the same values.

[pcmadm@localhost bin]$ ./m68k-elf-gdb --command=5307.gdb
GNU gdb 6.7
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=m68k-elf".
trying kernel driver: /dev/bdmcf0
trying bdm server: localhost:/dev/bdmcf0
m68k-bdm: architecture 68000 connected to /dev/bdmcf0
m68k-bdm: Coldfire debug module version is 1 (5307/5407(e))
Process /dev/bdmcf0 created; pid = 0
0x4010270a in ?? ()

Resetting uP

Setup internal registers

Setup internal SRAM

Setup Chip Selects

Setup GPIO

Setup SDRAM

     SDRAM refresh
(gdb) d32 0x0 16
0x0:    0xbeaddeed      0x01000100      0x40102708      0x40102708
0x10:   0x40102708      0x40102708      0x40102708      0x40102708
0x20:   0x40102708      0x40102708      0x40102708      0x40102708
0x30:   0x40102708      0x40102708      0x40102708      0x40102708
(gdb) d32 0xb0000000 16
0xb0000000:     0xbeaddeed      0x01000100      0x40102708      0x40102708
0xb0000010:     0x40102708      0x40102708      0x40102708      0x40102708
0xb0000020:     0x40102708      0x40102708      0x40102708      0x40102708
0xb0000030:     0x40102708      0x40102708      0x40102708      0x40102708
(gdb) set32 0xb0000000 0x12345678
(gdb) d32 0xb0000000 16
0xb0000000:     0x12345678      0x01000100      0x40102708      0x40102708
0xb0000010:     0x40102708      0x40102708      0x40102708      0x40102708
0xb0000020:     0x40102708      0x40102708      0x40102708      0x40102708
0xb0000030:     0x40102708      0x40102708      0x40102708      0x40102708
(gdb) d32 0x0 16
0x0:    0x12345678      0x01000100      0x40102708      0x40102708
0x10:   0x40102708      0x40102708      0x40102708      0x40102708
0x20:   0x40102708      0x40102708      0x40102708      0x40102708
0x30:   0x40102708      0x40102708      0x40102708      0x40102708
(gdb)

set32 is
 set *((unsigned long*) $arg0) = $arg1

and d32 is
 x /$arg1w $arg0

Address 0xb0000000 is sdram and address 0x0 is regular sram.

I have taken the chip select configurations from a project/debugger I know
works.

One thing I have to ask is when gdb starts it is different from the
README.gdbserver file.  The readme shows:

trying kernel driver: /dev/bdmcf0
  trying bdm server: localhost:/dev/bdmcf0
  m68k-bdm: detected MCF5235
  m68k-bdm: architecture CF5235 connected to /dev/bdmcf0
  m68k-bdm: Coldfire debug module version is 0 (5206(e)/5235/5272/5282)
  Process /dev/bdmcf0 created; pid = 0

and my setup shows
trying kernel driver: /dev/bdmcf0
trying bdm server: localhost:/dev/bdmcf0
m68k-bdm: architecture 68000 connected to /dev/bdmcf0
m68k-bdm: Coldfire debug module version is 1 (5307/5407(e))
Process /dev/bdmcf0 created; pid = 0

Is this correct?  That it is showing 68000 architecture?

Any help is greatly appreciated!!

Thanks
Mark


On Thu, May 1, 2008 at 8:39 PM, Chris Johns <[email protected]>
wrote:

> Mark Giacobbe wrote:
>
> > Before (see below), I could not use the test of
> >
> >    telnet localhost bdm
> >
> > I would get a refused connection.  I found the issue for that.  The bdm
> > file for xinetd.d was incorrect.  I had to change the path to the server.
> >  The included one in the README was incorrect for my system.
> >
> > I changed it from
> > service bdm
> >      {
> >        socket_type  = stream
> >        port    = 6543
> >        wait    = no
> >        user    = root
> >        server    = /usr/sbin/bdmd
> >        server_args  = -n
> >        log_on_failure  += USERID
> >        disable    = no
> >      }
> >
> > to
> > service bdm
> >      {
> >        socket_type  = stream
> >        port    = 6543
> >        wait    = no
> >        user    = root
> >        server    = /usr/local/sbin/bdmd
> >        server_args  = -n
> >        log_on_failure  += USERID
> >        disable    = no
> >      }
> >
> > for the server I had to add 'local' to the path.
> >
> >
> Interesting. I think the doco should be changed to include local as this
> is the default prefix the package should build for. I prefer we build for
> local and keep the package out of the operating system paths.
>
> Thanks for the feed back.
>
>  Now telnet works (for both user and root) and gdb works for both user and
> > root.   Also I changed the owner/group for m68k-bdm-elf-gdb, and
> > m68k-gdb-server to user (not sure if this was needed, but I did it anyway).
> >  I did this because I configured/compiled/installed everything as root.
> >
>
> You should not need to change the owner/group as the permissions should
> allow any user to run the program.
>
>
> Regards
> Chris
> ---
> [email protected]              Send a post to the list.
> [email protected]        Join the list.
> [email protected]    Join the list in digest mode.
> [email protected]     Leave the list.
>
>