Contents|Index|Previous|Next

Producing S-records / Direct download

The following documentation describes how to download and run directly on the DDB board.

Producing S-records

Before you can download a program to the DDB board, without GDB, the program must be converted into S-records.

First compile a little-endian executable (‘hello.xl’) using the ‘-EL’ option to GCC.

% mips64vr4300-elf-gcc -g hello.c -o hello.xl -EL
%

The following command reads the contents of ‘hello.x1’, converts the code and data into S-records, and puts the result into the ‘hello.srec’ file.

% mips64vr4300-elf-objcopy -O srec hello.x1 hello.srec
%

Here are the first few lines of ‘hello.srec’:

S00D000068656C6C6F2E7372656303
S31AA01000001024023CE00042340060824000688040AAAA0A3C5534
S31AA0100015554A3500008A44000880440000084400080944000011
S31AA010002A000005000A1500000000030020150000000014000497
S31AA010003F08000000001004023CE00042340060824010A0023C36

Downloading to the DDB board

You can download programs to the DDB board for execution directly on the board, without GDB. The DDB board has a standalone ROM monitor called PMON that supports loading of programs via a serial port or Ethernet. For complete information on configuring PMON for use with Ethernet, PMON information is available via anonymous FTP from:

ftp.cygnus.com:/private/releng/PMON

There is a README file there with the current information on PMON support at Cygnus Solutions as well as PMON documentation. This is a protected directory, therefore you must first ‘cd’ to it before you can browse it with the ‘ls’ or ‘dir’ commands.

Use the Unix ‘tip’ program to download a program to the DDB. In this example, the DDB board is connected to serial port ‘/dev/ttya’ on the Unix host:

% tip /dev/ttya
NEC010> load tty0
Downloading from tty0, ^C to abort
~>
hello.srec
NEC010> g

Downloading a program via Ethernet is similar. First, convert the program to S-records as described earlier. Then copy the S-record file to a directory that is readable by all users, and use the Unix command ‘chmod o+r’ to make the S-record file readable. A good choice for a directory is ‘/tmp’, since it is likely to be already readable by all users.

PMON uses the TFTP protocol to download programs via Ethernet. You must have a TFTP server running on your Unix host in order to use net downloads. This server can be installed by your system administrator. The PMON information is available via anonymous FTP from:

ftp.cygnus.com:/private/releng/PMON

The following is an example of a net download. Substitute your Unix host’s name or IP address for ‘host’ in the ‘load’ command:

% cp hello.srec /tmp

% chmod o+r /tmp/hello.srec

% tip /dev/ttya

NEC010> load host:/tmp/hello.srec
Downloading from host:/tmp/hello.srec, ^C to abort
~>
hello.srec
Entry address is a0100000
total = 0x7588 bytes
NEC010>
g