Running RTEMS samples on MCP750

Charles-Antoine Gauthier charles.gauthier at
Thu Aug 31 14:01:34 UTC 2000

I just tried the load command with gdb 4.18 configured for
powerpc-rtems. Hum, it downloads through the serial line. What a pain,
it is so slow... Does your debugger download through the network?

Here is how we debug our MVME167 and MBX860 boards, which both run a
flavor of xxxBug. Our approach requires that the boards be connected to
the LAN.

1. Generate ELF executables rather than S-record files. Produce one
version of the ELF executable with symbols for debugging. Produce a
stripped version of the ELF executable for downloading. We have to do
this because our targets do not have enough RAM to hold the debug
sections except for the simplest applications. Our makefiles produce the
two versions of the images for us.

4. Configure and start up a TFTP daemon on some computer that has access
to the executable files. Typically, the server runs on the development
system, but I have also been able to NFS-mount my build tree on some
other computer and to download from that second computer. TFTP servers
are available for MacOS, Windows XX, and Unix systems. The only issues
are that each component in the patch to the executable file must be
world readable, and that TFTP has no authentication mechanism
whatsoever, so be warned that you are opening up a potentially huge
security hole in your system (which is why you may want to run TFTP
somewhere else, or to copy your executables to a special download
directory so you don't share your build tree with the world).

5. Start up a terminal emulator and connect to the target.

6. Use NIOT to teach your board to download from the machine that has
the TFTP server. See the
c/src/lib/libbsp/powerpc/motorola_shared/BOOTING file for details. You
only need to do this the first time and whenever you change servers.

7. Issue the PLH command on the target with the full path name to the
stripped executable. If all goes well, within a few seconds, your image
will be in memory, each section at the right address. PLH reads the
section headers to determine what to do with the incoming data. It also
sets the initial PC for you. It's great.

If your ppcBug does not have an PLH command, use the NIOP command. You
must then specify the download address and the skip count to skip over
the headers. You must also set the PC by hand.

8. Suspend the terminal emulator or quit it.

9. Start up gdb and load the file with the symbols. You should consider
using DDD as the front end or Insight to get a nicer GUI interface.
Connect to the target. You are set for debugging.

To reload the image in the target, suspend the debugger and re-activate
the terminal emulator. Just download a fresh image. Suspend the terminal
emulator and re-activate the debugger. Set the PC and voilà! You are
ready for a new run of the same image.

This looks overly complicated, but the cycle is much faster than
downloading S-records through the serial line. Use cut and paste to
re-issue the PLH command to the target. We can go through a full
download, run, reset, download cycle in a few seconds. Also, at times,
we find it convenient to suspend gdb and investigate the state of the
system using xxxBug.

Joel Sherrill wrote:
> Hoang Ngo wrote:
> >
> > I ran into the same problem before and someone else
> > helped me, so i guess it's pay back time. Here we go:
> >
> > - There is a script called psim-gdb somewhere in the
> > src tree. Use that to run your prgs.
> That only works when you want to run on the powerpc
> simulator.  This person is trying the mcp750.
> More than likely it is a combination of how to download
> and what registers are set at the time.  I thought there
> were download instructions in the BSP source.  ...
> Yes.. c/src/lib/libbsp/powerpc/motorola_shared/BOOTING.
> > Hope that helps.
> >
> > Hoang
> >
> > -----Original Message-----
> > From: Stefan Asserhall [mailto:assers at]
> > Sent: Wednesday, August 30, 2000 8:31 AM
> > To: rtems-users at
> > Cc: assers at
> > Subject: Running RTEMS samples on MCP750
> >
> > We've successfully built RTEMS for the powerpc MCP750, but the samples
> > won't run the way we expected. Should it be possible to do the following?
> > If not, how should it be done?
> >
> >  cd mcp750/samples
> >  ppc-gdb hello.exe
> >  ...
> >  (gdb) target ppcbug /dev/ttyS1
> >  ...
> >  (gdb) load
> >  .entry_point_section    : 0x00000000 .. 0x00000004
> >  .text   : 0x00003000 .. 0x0001e4cc
> >  ...
> >  (gdb) run
> >  ...
> >
> > For us the processor dies after run, and must be reset.
> >
> > Stefan Asserhäll
> >
> > PS. This is probably a VERY stupid question...
> >
> > ----------------------------------------------------------------------------
> > ---
> > -- Stefan Asserhäll, Saab Ericsson Space, SE-405 15 Göteborg, Sweden
> > --
> > -- Tel: +46 31 7354332 Fax: +46 31 7354000 E-mail: Stefan.Asserhall at
> > --
> > ----------------------------------------------------------------------------
> > ---
> --
> Joel Sherrill, Ph.D.             Director of Research & Development
> joel at                 On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>    Support Available             (256) 722-9985

Charles-Antoine Gauthier
Institute for Information Technology   Institut de technologie de
National Research Council of Canada    Conseil national de recherches du

More information about the users mailing list