OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [sgml/] [user-guide/] [target-setup.sgml] - Diff between revs 28 and 174

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
Target Setup
Target Setup
The following sections detail the setup of many of the targets
The following sections detail the setup of many of the targets
supported by eCos.
supported by eCos.
This information is presented here only temporarily. It is intended
This information is presented here only temporarily. It is intended
that there will be separate documents detailing this information for
that there will be separate documents detailing this information for
each target in future releases. Consequently not much effort has been
each target in future releases. Consequently not much effort has been
put into bringing the following documentation up to date -- much of it
put into bringing the following documentation up to date -- much of it
is obsolete, bogus or just plain wrong.
is obsolete, bogus or just plain wrong.
-->
MN10300 stdeval1 Hardware Setup
MN10300 stdeval1 Hardware Setup
The eCos Developer’s Kit package comes with a pair
The eCos Developer’s Kit package comes with a pair
of EPROMs which provide GDB support for the Matsushita MN10300 (AM31)
of EPROMs which provide GDB support for the Matsushita MN10300 (AM31)
series evaluation board using CygMon, the Cygnus ROM monitor. Images
series evaluation board using CygMon, the Cygnus ROM monitor. Images
of these EPROMs are also provided at BASE_DIR/loaders/mn10300-stdeval1/cygmon.bin.
of these EPROMs are also provided at BASE_DIR/loaders/mn10300-stdeval1/cygmon.bin.
The LSB EPROM (LROM) is installed to socket IC8 on the board and
The LSB EPROM (LROM) is installed to socket IC8 on the board and
the MSB EPROM (UROM) is installed to socket IC9. Attention should
the MSB EPROM (UROM) is installed to socket IC9. Attention should
be paid to the correct orientation of these EPROMs during installation.
be paid to the correct orientation of these EPROMs during installation.
The CygMon stubs allows communication with GDB by way of the
The CygMon stubs allows communication with GDB by way of the
serial port at connector CN2. The communication parameters are fixed
serial port at connector CN2. The communication parameters are fixed
at 38400 baud, 8 data bits, no parity bit, and 1 stop bit (8-N-1).
at 38400 baud, 8 data bits, no parity bit, and 1 stop bit (8-N-1).
No flow control is employed. Connection to the host computer should
No flow control is employed. Connection to the host computer should
be made using a standard RS232C serial cable (not a null modem cable).
be made using a standard RS232C serial cable (not a null modem cable).
A gender changer may also be required.
A gender changer may also be required.
MN10300 Architectural Simulator Setup
MN10300 Architectural Simulator Setup
The MN10300 simulator is an architectural simulator for the
The MN10300 simulator is an architectural simulator for the
Matsushita MN10300 that implements all features of the microprocessor
Matsushita MN10300 that implements all features of the microprocessor
 necessary to run eCos. The current implementation provides accurate
 necessary to run eCos. The current implementation provides accurate
simulation of the instruction set, interrupt controller, timers,
simulation of the instruction set, interrupt controller, timers,
and  serial I/O.
and  serial I/O.
In this release, you can run the same eCos binaries in the
In this release, you can run the same eCos binaries in the
simulator that can run on target hardware, if built for ROM start-up,
simulator that can run on target hardware, if built for ROM start-up,
with the  exception of those that use the watchdog timer.
with the  exception of those that use the watchdog timer.
However, note that AM33 devices required to run eCos are not
However, note that AM33 devices required to run eCos are not
simulated; therefore you cannot run eCos binaries built for the
simulated; therefore you cannot run eCos binaries built for the
AM33 under the simulator. For the AM33, the simulator is effectively
AM33 under the simulator. For the AM33, the simulator is effectively
an instruction-set only simulator.
an instruction-set only simulator.
To simplify connection to the simulator, you are advised to
To simplify connection to the simulator, you are advised to
create a GDB macro by putting the following code in your personal
create a GDB macro by putting the following code in your personal
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
define msim
define msim
 target sim --board=stdeval1 --memory-region 0x34004000,0x8
 target sim --board=stdeval1 --memory-region 0x34004000,0x8
 rbreak cyg_test_exit
 rbreak cyg_test_exit
 rbreak cyg_assert_fail
 rbreak cyg_assert_fail
end
end
You can then connect to the simulator by invoking the command msim on
You can then connect to the simulator by invoking the command msim on
the command line:
the command line:
(gdb) msim
(gdb) msim
You can achieve the same effect by typing out the macro’s
You can achieve the same effect by typing out the macro’s
content on  the command line if necessary.
content on  the command line if necessary.
AM33 STB Hardware Setup
AM33 STB Hardware Setup
The Matsushita AM33 STB System Reference Board may be used
The Matsushita AM33 STB System Reference Board may be used
in two modes: via a JTAG debugger, or by means of a GDB stub ROM.
in two modes: via a JTAG debugger, or by means of a GDB stub ROM.
Use with GDB Stub ROM
Use with GDB Stub ROM
The eCos Developer’s Kit package comes with a ROM
The eCos Developer’s Kit package comes with a ROM
image which provides GDB support for
image which provides GDB support for
the Matsushita(R) AM33 STB System Reference Board. To install the
the Matsushita(R) AM33 STB System Reference Board. To install the
GDB stub ROM requires the use of the JTAG debugger and the Flash ROM
GDB stub ROM requires the use of the JTAG debugger and the Flash ROM
programming code available from Matsushita. An image of this ROM
programming code available from Matsushita. An image of this ROM
is also provided at loaders/am33-stb/gdbload.bin under
is also provided at loaders/am33-stb/gdbload.bin under
the root of your eCos installation.
the root of your eCos installation.
Ensure that there is a Flash ROM card in MAIN MEMORY SLOT <0>.
Ensure that there is a Flash ROM card in MAIN MEMORY SLOT <0>.
Follow the directions for programming a Flash ROM supplied with
Follow the directions for programming a Flash ROM supplied with
the programming software.
the programming software.
The final programming of the ROM will need to be done with
The final programming of the ROM will need to be done with
a command similar to the following:
a command similar to the following:
fdown "gdbload.bin",0x80000000,16,1
fdown "gdbload.bin",0x80000000,16,1
Once the ROM has been programmed, close down the JTAG debugger,
Once the ROM has been programmed, close down the JTAG debugger,
turn the STB off, and disconnect the JTAG cable. Ensure that the
turn the STB off, and disconnect the JTAG cable. Ensure that the
hardware switches are in the following configuration:
hardware switches are in the following configuration:
U U D D D U D D
U U D D D U D D
D = lower part of rocker switch pushed in
D = lower part of rocker switch pushed in
U = upper part of rocker switch pushed in
U = upper part of rocker switch pushed in
This is also the configuration required by the Flash programming
This is also the configuration required by the Flash programming
code, so it should not be necessary to change these.
code, so it should not be necessary to change these.
Restart the STB and the stub ROM will now be able to communicate
Restart the STB and the stub ROM will now be able to communicate
with GDB. eCos programs should be built
with GDB. eCos programs should be built
with RAM startup.
with RAM startup.
Programs can then be downloaded via a standard RS232 null
Programs can then be downloaded via a standard RS232 null
modem serial cable connected to the SERIAL1 connector on the STB
modem serial cable connected to the SERIAL1 connector on the STB
front panel (the AM33"s serial port 0). This line is programmed
front panel (the AM33"s serial port 0). This line is programmed
to run at 38400 baud, 8 data bits, no parity and 1 stop bit (8-N-1)
to run at 38400 baud, 8 data bits, no parity and 1 stop bit (8-N-1)
with no flow control. A gender changer may also be required. Diagnostic
with no flow control. A gender changer may also be required. Diagnostic
output will be output to GDB using the same connection.
output will be output to GDB using the same connection.
This procedure also applies for programming ROM startup eCos
This procedure also applies for programming ROM startup eCos
programs into ROM, given a binary format image of the program from mn10300-elf-objcopy.
programs into ROM, given a binary format image of the program from mn10300-elf-objcopy.
Use with the JTAG debugger
Use with the JTAG debugger
To use eCos from the JTAG debugger, executables must be built
To use eCos from the JTAG debugger, executables must be built
with ROM startup and then downloaded via the JTAG debugger. For
with ROM startup and then downloaded via the JTAG debugger. For
this to work there must be an SDRAM memory card in SUB MEMORY SLOT <0> and
this to work there must be an SDRAM memory card in SUB MEMORY SLOT <0> and
the hardware switches on the front panel set to the following: 
the hardware switches on the front panel set to the following: 
D U D D D U D D
D U D D D U D D
D = lower part of rocker switch pushed in
D = lower part of rocker switch pushed in
U = upper part of rocker switch pushed in
U = upper part of rocker switch pushed in
Connect the JTAG unit and run the debugger as described in
Connect the JTAG unit and run the debugger as described in
the documentation that comes with it.
the documentation that comes with it.
eCos executables should be renamed to have a “.out” extension
eCos executables should be renamed to have a “.out” extension
and may then be loaded using the debugger"s “l” or “lp” commands.
and may then be loaded using the debugger"s “l” or “lp” commands.
Diagnostic output generated by the program will be sent out
Diagnostic output generated by the program will be sent out
of the AM33"s serial port 0 which is connected to the SERIAL1
of the AM33"s serial port 0 which is connected to the SERIAL1
connector on the STB front panel. This line is programmed to run
connector on the STB front panel. This line is programmed to run
at 38400 baud, 8 data bits, no parity, and one stop bit (8-N-1)
at 38400 baud, 8 data bits, no parity, and one stop bit (8-N-1)
with no flow control. Connection to the host computer should be
with no flow control. Connection to the host computer should be
using a standard RS232 null modem serial cable. A gender changer
using a standard RS232 null modem serial cable. A gender changer
may also be required.
may also be required.
Building the GDB stub ROM image
Building the GDB stub ROM image
eCos comes with a pre-built GDB stub ROM image for the AM33-STB
eCos comes with a pre-built GDB stub ROM image for the AM33-STB
platform. This can be found at loaders/am33-stb/gdbload.bin relative
platform. This can be found at loaders/am33-stb/gdbload.bin relative
to the eCos installation directory.
to the eCos installation directory.
If necessary, the ROM image can be re-built as follows:
If necessary, the ROM image can be re-built as follows:
                On Windows hosts, open a Bash session using
                On Windows hosts, open a Bash session using
Start->Programs->Red Hat eCos->eCos
Start->Programs->Red Hat eCos->eCos
Development Environment
Development Environment
Create a build directory and cd into it
Create a build directory and cd into it
Run (all as one line):
Run (all as one line):
cygtclsh80 BASE_DIR/packages/pkgconf.tcl                          \
cygtclsh80 BASE_DIR/packages/pkgconf.tcl                          \
  --target=mn10300_am33 --platform stb --startup rom              \
  --target=mn10300_am33 --platform stb --startup rom              \
  --disable-kernel --disable-uitron --disable-libc --disable-libm \
  --disable-kernel --disable-uitron --disable-libc --disable-libm \
  --disable-io --disable-io_serial --disable-wallclock
  --disable-io --disable-io_serial --disable-wallclock
--disable-watchdog
--disable-watchdog
            
            
where BASE_DIR is the path to the eCos installation
where BASE_DIR is the path to the eCos installation
directory.
directory.
Edit the configuration file
Edit the configuration file
pkgconf/hal.h
pkgconf/hal.h
 in the build directory tree by ensuring the following configuration
 in the build directory tree by ensuring the following configuration
options are set as follows:
options are set as follows:
#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
#define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
#define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
#undef  CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
#undef  CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
#define CYG_HAL_ROM_MONITOR
#define CYG_HAL_ROM_MONITOR
            
            
Run: make
Run: make
Run: make -C hal/common/current/current/src/stubrom
Run: make -C hal/common/current/current/src/stubrom
The file
The file
hal/common/current/src/stubrom
hal/common/current/src/stubrom
 will be an ELF format executable of the ROM image. Use mn10300-elf-objcopy to
 will be an ELF format executable of the ROM image. Use mn10300-elf-objcopy to
convert this to the appropriate format for loading into the Matsushita
convert this to the appropriate format for loading into the Matsushita
FLASH ROM programmer, mode “binary” in this case:
FLASH ROM programmer, mode “binary” in this case:
$ mn10300-elf-objcopy -O binary hal/common/current/src/stubrom/ \
$ mn10300-elf-objcopy -O binary hal/common/current/src/stubrom/ \
  stubrom stubrom.img
  stubrom stubrom.img
TX39 Hardware Setup
TX39 Hardware Setup
The eCos Developer’s Kit package comes with a pair
The eCos Developer’s Kit package comes with a pair
of ROMs that provide GDB support for
of ROMs that provide GDB support for
the Toshiba JMR-TX3904 RISC processor reference board by way of CygMon. 
the Toshiba JMR-TX3904 RISC processor reference board by way of CygMon. 
Images of these ROMs are also provided at BASE_DIR/loaders/tx39-jmr3904/cygmon50.bin and BASE_DIR/loaders/tx39-jmr3904/cygmon66.bin for
Images of these ROMs are also provided at BASE_DIR/loaders/tx39-jmr3904/cygmon50.bin and BASE_DIR/loaders/tx39-jmr3904/cygmon66.bin for
50 MHz and 66 MHz boards respectively. The ROMs are installed to
50 MHz and 66 MHz boards respectively. The ROMs are installed to
sockets IC6 and IC7 on the memory daughterboard according to their
sockets IC6 and IC7 on the memory daughterboard according to their
labels. Attention should be paid to the correct orientation of these
labels. Attention should be paid to the correct orientation of these
ROMs during installation.
ROMs during installation.
The GDB stub allows communication with GDB using the serial
The GDB stub allows communication with GDB using the serial
port (channel C) at connector PJ1. The communication parameters
port (channel C) at connector PJ1. The communication parameters
are fixed at 38400 baud, 8 data bits, no parity bit, and 1 stop
are fixed at 38400 baud, 8 data bits, no parity bit, and 1 stop
bit (8-N-1). No handshaking is employed. Connection to the host
bit (8-N-1). No handshaking is employed. Connection to the host
computer should be made using an RS232C null modem cable.
computer should be made using an RS232C null modem cable.
CygMon and eCos currently provide support for a 16Mbyte 60ns
CygMon and eCos currently provide support for a 16Mbyte 60ns
72pin DRAM SIMM fitted to the PJ21 connector. Different size DRAMs
72pin DRAM SIMM fitted to the PJ21 connector. Different size DRAMs
may require changes in the value stored in the DCCR0 register. This
may require changes in the value stored in the DCCR0 register. This
value may be found near line 211 in hal/mips/arch/&Version;/src/vectors.S
value may be found near line 211 in hal/mips/arch/&Version;/src/vectors.S
in eCos, and near line 99 in
in eCos, and near line 99 in
          libstub/mips/tx39jmr/tx39jmr-power.S in
          libstub/mips/tx39jmr/tx39jmr-power.S in
CygMon. eCos does not currently use the DRAM for any purpose itself,
CygMon. eCos does not currently use the DRAM for any purpose itself,
so it is entirely available for application use.
so it is entirely available for application use.
TX39 Architectural Simulator Setup
TX39 Architectural Simulator Setup
The TX39 simulator is an architectural simulator which implements
The TX39 simulator is an architectural simulator which implements
all  the features of the Toshiba TX39 needed to run eCos. The current
all  the features of the Toshiba TX39 needed to run eCos. The current
implementation provides accurate simulation of the instruction set,
implementation provides accurate simulation of the instruction set,
 interrupt controller, and timers, as well as having generic support
 interrupt controller, and timers, as well as having generic support
for diagnostic output, serial I/O, and exceptions.
for diagnostic output, serial I/O, and exceptions.
In this release, you can run the same eCos binaries in the
In this release, you can run the same eCos binaries in the
simulator that can run on target hardware, if it is built for ROM
simulator that can run on target hardware, if it is built for ROM
start-up.
start-up.
To simplify connection to the simulator, you are advised to
To simplify connection to the simulator, you are advised to
create a GDB macro by putting the following code in your personal
create a GDB macro by putting the following code in your personal
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
define tsim
define tsim
 target sim --board=jmr3904pal --memory-region 0xffff8000,0x900 \
 target sim --board=jmr3904pal --memory-region 0xffff8000,0x900 \
            --memory-region 0xffffe000,0x4 \
            --memory-region 0xffffe000,0x4 \
            --memory-region 0xb2100000,0x4
            --memory-region 0xb2100000,0x4
 rbreak cyg_test_exit
 rbreak cyg_test_exit
 rbreak cyg_assert_fail
 rbreak cyg_assert_fail
end
end
You can then connect to the simulator by invoking the command tsim on
You can then connect to the simulator by invoking the command tsim on
the command line:
the command line:
(gdb) tsim
(gdb) tsim
You can achieve the same effect by typing out the macro’s
You can achieve the same effect by typing out the macro’s
content on the command line if necessary.
content on the command line if necessary.
TX49 Hardware Setup
TX49 Hardware Setup
The eCos installation CD contains a copy of the eCos GDB stubs
The eCos installation CD contains a copy of the eCos GDB stubs
in  SREC format which must be programmed into the board’s
in  SREC format which must be programmed into the board’s
FLASH memory.
FLASH memory.
Preparing the GDB stubs
Preparing the GDB stubs
These stub preparation steps are not strictly necessary as
These stub preparation steps are not strictly necessary as
the eCos distribution ships with pre-compiled stubs in the directory loaders/tx49-ref4955 relative
the eCos distribution ships with pre-compiled stubs in the directory loaders/tx49-ref4955 relative
to the installation root.
to the installation root.
Building the GDB stub image with the eCos Configuration Tool
Building the GDB stub image with the eCos Configuration Tool
                  Start with a new document - selecting the
                  Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the TX49 REF4955 hardware.
 menu item, and then select the TX49 REF4955 hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the stubs package template to build a GDB stub.
 dialog box, select the stubs package template to build a GDB stub.
Click
Click
OK.
OK.
Build eCos stubs using
Build eCos stubs using
Build->Library.
Build->Library.
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
images have the prefix gdb_module.
images have the prefix gdb_module.
 Building the GDB stub image with ecosconfig
 Building the GDB stub image with ecosconfig
                  Make an empty directory to contain the build tree,
                  Make an empty directory to contain the build tree,
                  and cd into it.
                  and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new ref4955 stubs 
$ ecosconfig new ref4955 stubs 
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
images have the prefix gdb_module.
images have the prefix gdb_module.
 Installing GDB stubs into FLASH
 Installing GDB stubs into FLASH
Boot into the board’s firmware in little-endian mode:
Boot into the board’s firmware in little-endian mode:
Set the switches like this:   
Set the switches like this:   
SW1: 10000000 (first lever up, the rest down)
SW1: 10000000 (first lever up, the rest down)
SW2: 10000010
SW2: 10000010
Connect serial cable on the lower connector, configure terminal
Connect serial cable on the lower connector, configure terminal
emulator for 38400, 8-N-1.
emulator for 38400, 8-N-1.
When booting the board, you should get this prompt:
When booting the board, you should get this prompt:
HCP5 rev 0.9B .
HCP5 rev 0.9B .
HCP5?
HCP5?
Select o (option), a (FLASH) and b (boot write). You should
Select o (option), a (FLASH) and b (boot write). You should
see this:
see this:
Boot ROM Write
Boot ROM Write
ROM address-ffffffffbd000000, Boot Bus-[32bit]
ROM address-ffffffffbd000000, Boot Bus-[32bit]
ID2 0 4 ffffffffa002ad40
ID2 0 4 ffffffffa002ad40
zzz SS-40000 IV-1 CS-20000 CC-2
zzz SS-40000 IV-1 CS-20000 CC-2
Flash ROM-[28F640J5], [16bit chip] * 2 * 1
Flash ROM-[28F640J5], [16bit chip] * 2 * 1
Block size-00040000  count-64
Block size-00040000  count-64
ROM adr ffffffffbd000000-ffffffffbe000000  mask-00fc0000
ROM adr ffffffffbd000000-ffffffffbe000000  mask-00fc0000
Send Srecord file sa=00000000 size=ffffffffffffffff
Send Srecord file sa=00000000 size=ffffffffffffffff
ra=fffffffffe000000
ra=fffffffffe000000
          
          
Now send the stub SREC data down to the board using the terminal
Now send the stub SREC data down to the board using the terminal
 emulator’s ‘send ASCII’ (or similar)
 emulator’s ‘send ASCII’ (or similar)
functionality. 
functionality. 
Red Hat has experienced some sensitivity to how fast the data
Red Hat has experienced some sensitivity to how fast the data
is written to the board. Under Windows you should configure Minicom
is written to the board. Under Windows you should configure Minicom
to use a line delay of 100 milliseconds. Under Linux, use the slow_cat.tcl
to use a line delay of 100 milliseconds. Under Linux, use the slow_cat.tcl
 script:
 script:
% cd BASE_DIR/packages/hal/mips/ref4955/&Version;/misc
% cd BASE_DIR/packages/hal/mips/ref4955/&Version;/misc
% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0
% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0
Power off the board, and change it to boot the GDB stubs in
Power off the board, and change it to boot the GDB stubs in
big-endian mode by setting the switches like this:
big-endian mode by setting the switches like this:
SW1: 00000000 (all levers down)
SW1: 00000000 (all levers down)
SW2: 10001010
SW2: 10001010
The GDB stubs allow communication with GDB using the serial
The GDB stubs allow communication with GDB using the serial
port at connector PJ7A (lower connector). The communication parameters
port at connector PJ7A (lower connector). The communication parameters
are  fixed at 38400 baud, 8 data bits, no parity bit and 1 stop
are  fixed at 38400 baud, 8 data bits, no parity bit and 1 stop
bit  (8-N-1). No flow control is employed. Connection to the host
bit  (8-N-1). No flow control is employed. Connection to the host
computer should be made using a straight through serial cable.
computer should be made using a straight through serial cable.
VR4300 Hardware Setup
VR4300 Hardware Setup
The eCos Developer’s Kit package comes with an EPROM
The eCos Developer’s Kit package comes with an EPROM
which provides GDB support for the NEC
which provides GDB support for the NEC
VRC4373 evaluation board. An image of this EPROM is also provided
VRC4373 evaluation board. An image of this EPROM is also provided
at loaders/vr4300-vrc4373/gdbload.bin under
at loaders/vr4300-vrc4373/gdbload.bin under
the root of your eCos installation.
the root of your eCos installation.
The EPROM is installed to socket U12 on the board. Attention
The EPROM is installed to socket U12 on the board. Attention
should be paid to the correct orientation of the EPROM during installation.
should be paid to the correct orientation of the EPROM during installation.
Only replace the board"s existing ROM using a proper PLCC
Only replace the board"s existing ROM using a proper PLCC
extraction tool, as the socket would otherwise risk getting damaged. 
extraction tool, as the socket would otherwise risk getting damaged. 
The GDB stub in the EPROM allows communication with GDB using
The GDB stub in the EPROM allows communication with GDB using
the serial port at connector J1. The communication parameters are
the serial port at connector J1. The communication parameters are
fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1).
fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1).
No flow control is employed. Connection to the host computer should
No flow control is employed. Connection to the host computer should
be made using a straight-through serial cable. 
be made using a straight-through serial cable. 
VRC4375 Hardware Setup
VRC4375 Hardware Setup
For information about setting up the VRC4375 to run with RedBoot,
For information about setting up the VRC4375 to run with RedBoot,
consult the RedBoot User"s Guide. If using serial debugging,
consult the RedBoot User"s Guide. If using serial debugging,
the serial line runs at 38400 baud 8-N-1 and should be connected
the serial line runs at 38400 baud 8-N-1 and should be connected
to the debug host using the cable supplied with the board.
to the debug host using the cable supplied with the board.
Atlas/Malta Hardware Setup
Atlas/Malta Hardware Setup
For information about setting up the Atlas and Malta boards to
For information about setting up the Atlas and Malta boards to
run with RedBoot, consult the RedBoot User"s Guide.
run with RedBoot, consult the RedBoot User"s Guide.
PowerPC Cogent Hardware Setup
PowerPC Cogent Hardware Setup
The eCos Developer’s Kit package comes with an EPROM
The eCos Developer’s Kit package comes with an EPROM
which provides GDB support for the Cogent
which provides GDB support for the Cogent
evaluation board. An image of this EPROM is also provided at
evaluation board. An image of this EPROM is also provided at
          loaders/powerpc-cogent/gdbload.bin under
          loaders/powerpc-cogent/gdbload.bin under
the root of your eCos installation. The same EPROM and image can
the root of your eCos installation. The same EPROM and image can
be used on all three supported daughterboards: CMA287-23 (MPC823),
be used on all three supported daughterboards: CMA287-23 (MPC823),
CMA287-50 (MPC850), and CMA286-60 (MPC860).
CMA287-50 (MPC850), and CMA286-60 (MPC860).
The EPROM is installed to socket U4 on the board. Attention
The EPROM is installed to socket U4 on the board. Attention
should be paid to the correct orientation of the EPROM during installation. 
should be paid to the correct orientation of the EPROM during installation. 
If you are going to burn a new EPROM using the binary image,
If you are going to burn a new EPROM using the binary image,
be careful to get the byte order correct. It needs to be big-endian.
be careful to get the byte order correct. It needs to be big-endian.
If the EPROM burner software has a hex-editor, check that the first
If the EPROM burner software has a hex-editor, check that the first
few bytes of the image look like: 
few bytes of the image look like: 
00000000: 3c60 fff0 6063 2000 7c68 03a6 4e80 0020 <`..`c.|h..N.. 
00000000: 3c60 fff0 6063 2000 7c68 03a6 4e80 0020 <`..`c.|h..N.. 
If the byte order is wrong you will see 603c instead of 3c60
If the byte order is wrong you will see 603c instead of 3c60
etc. Use the EPROM burner software to make a byte-swap before you
etc. Use the EPROM burner software to make a byte-swap before you
burn to image to the EPROM. 
burn to image to the EPROM. 
If the GDB stub EPROM you burn does not work, try reversing
If the GDB stub EPROM you burn does not work, try reversing
the byte-order, even if you think you have it the right way around.
the byte-order, even if you think you have it the right way around.
At least one DOS-based EPROM burner program is known to have the
At least one DOS-based EPROM burner program is known to have the
byte-order upside down.
byte-order upside down.
The GDB stub in the EPROM allows communication with GDB using
The GDB stub in the EPROM allows communication with GDB using
the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters
the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters
are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit
are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit
(8-N-1). No flow control is employed. Connection to the host computer
(8-N-1). No flow control is employed. Connection to the host computer
should be made using a dedicated serial cable as specified in the
should be made using a dedicated serial cable as specified in the
Cogent CMA manual.
Cogent CMA manual.
Installing the Stubs into ROM
Installing the Stubs into ROM
Preparing the Binaries
Preparing the Binaries
These two binary preparation steps are not strictly necessary
These two binary preparation steps are not strictly necessary
as the eCos distribution ships with pre-compiled binaries in the
as the eCos distribution ships with pre-compiled binaries in the
directory loaders/powerpc-cogent relative to the installation
directory loaders/powerpc-cogent relative to the installation
root.
root.
Building the ROM images with the eCos Configuration Tool
Building the ROM images with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the PowerPC    CMA28x hardware.
 menu item, and then select the PowerPC    CMA28x hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the “stubs” package template
 dialog box, select the “stubs” package template
to build a GDB stub. Click
to build a GDB stub. Click
OK.
OK.
Build eCos using
Build eCos using
Build->Library.
Build->Library.
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the  prefix “gdb_module”.
ROM images have the  prefix “gdb_module”.
Building the ROM images with ecosconfig
Building the ROM images with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new cma28x stubs 
$ ecosconfig new cma28x stubs 
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
 
 
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix “gdb_module”.
ROM images have the prefix “gdb_module”.
 Installing the Stubs into ROM or FLASH
 Installing the Stubs into ROM or FLASH
Program the binary image file gdb_module.bin
Program the binary image file gdb_module.bin
into ROM or FLASH referring to the instructions of your ROM programmer.
into ROM or FLASH referring to the instructions of your ROM programmer.
 Plug the ROM/FLASH into socket U4 as described
 Plug the ROM/FLASH into socket U4 as described
at the beginning of this Hardware Setup section.
at the beginning of this Hardware Setup section.
PowerPC MBX860 Hardware Setup
PowerPC MBX860 Hardware Setup
The eCos Developer’s Kit package comes with an EPROM
The eCos Developer’s Kit package comes with an EPROM
which provides GDB support for the Motorola
which provides GDB support for the Motorola
PowerPC MBX860 evaluation board. An image of this EPROM is also
PowerPC MBX860 evaluation board. An image of this EPROM is also
provided at loaders/powerpc-mbx/gdbload.bin under
provided at loaders/powerpc-mbx/gdbload.bin under
the root of your eCos installation.
the root of your eCos installation.
The EPROM is installed to socket XU1 on the board. Attention
The EPROM is installed to socket XU1 on the board. Attention
should be paid to the correct orientation of the EPROM during installation.
should be paid to the correct orientation of the EPROM during installation.
Only replace the board"s existing ROM using a proper PLCC
Only replace the board"s existing ROM using a proper PLCC
extraction tool, as the socket would otherwise risk getting damaged.
extraction tool, as the socket would otherwise risk getting damaged.
The GDB stub in the EPROM allows communication with GDB using
The GDB stub in the EPROM allows communication with GDB using
the serial port at connector SMC1/COM1. The communication
the serial port at connector SMC1/COM1. The communication
parameters are fixed at 38400 baud, 8 data bits, no parity bit and
parameters are fixed at 38400 baud, 8 data bits, no parity bit and
1 stop bit (8-N-1). No flow control is employed. Connection to the
1 stop bit (8-N-1). No flow control is employed. Connection to the
host computer should be made using a suitable serial cable.
host computer should be made using a suitable serial cable.
In order to make the board execute the EPROM that you just
In order to make the board execute the EPROM that you just
installed (rather than the on-board FLASH memory), it may be necessary
installed (rather than the on-board FLASH memory), it may be necessary
move some links on the board. Specifically, ensure that link J4
move some links on the board. Specifically, ensure that link J4
is in position 1-2. If in doubt, refer to the MBX documentation
is in position 1-2. If in doubt, refer to the MBX documentation
from Motorola, ensuring that Boot Port Size=8 Bits/ROM
from Motorola, ensuring that Boot Port Size=8 Bits/ROM
for BOOT (CS#7), in their terminology.
for BOOT (CS#7), in their terminology.
Installing the Stubs into FLASH
Installing the Stubs into FLASH
Preparing the Binaries
Preparing the Binaries
These two binary preparation steps are not strictly necessary
These two binary preparation steps are not strictly necessary
as the eCos distribution ships with pre-compiled binaries in the
as the eCos distribution ships with pre-compiled binaries in the
directory loaders/powerpc-mbx relative to the installation
directory loaders/powerpc-mbx relative to the installation
root.
root.
Building the ROM images with the eCos Configuration Tool
Building the ROM images with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the PowerPC    Motorola MBX860/821
 menu item, and then select the PowerPC    Motorola MBX860/821
hardware.
hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the “stubs” package template
 dialog box, select the “stubs” package template
to build a GDB stub. Click
to build a GDB stub. Click
OK.
OK.
Build eCos using
Build eCos using
Build->Library. 
Build->Library. 
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix “gdb_module”.
ROM images have the prefix “gdb_module”.
Building the ROM images with ecosconfig
Building the ROM images with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new mbx stubs 
$ ecosconfig new mbx stubs 
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make 
$ make 
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix “gdb_module”.
ROM images have the prefix “gdb_module”.
 Installing the Stubs into ROM
 Installing the Stubs into ROM
 Program the binary image file gdb_module.bin
 Program the binary image file gdb_module.bin
into ROM or FLASH referring to the instructions of your ROM programmer.
into ROM or FLASH referring to the instructions of your ROM programmer.
 Plug the ROM/FLASH into socket XU1 as described
 Plug the ROM/FLASH into socket XU1 as described
near the beginning of this Hardware Setup section.
near the beginning of this Hardware Setup section.
Installing the Stubs into FLASH
Installing the Stubs into FLASH
This assumes you have EPPC-Bug in the on-board FLASH. This
This assumes you have EPPC-Bug in the on-board FLASH. This
can be determined by setting up the board according to the below
can be determined by setting up the board according to the below
instructions and powering up the board. The EPPC-Bug prompt should
instructions and powering up the board. The EPPC-Bug prompt should
appear on the SMC1 connector at 9600 baud, 8N1.
appear on the SMC1 connector at 9600 baud, 8N1.
Set jumper 3 to 2-3     [allow XU2 FLASH to
Set jumper 3 to 2-3     [allow XU2 FLASH to
be programmed]
be programmed]
Set jumper 4 to 2-3     [boot EPPC-Bug]
Set jumper 4 to 2-3     [boot EPPC-Bug]
 Program FLASH
 Program FLASH
 Prepare EPPC-Bug for download:
 Prepare EPPC-Bug for download:
EPPC-Bug>lo 0
EPPC-Bug>lo 0
At this point the monitor is ready for input. It will not return
At this point the monitor is ready for input. It will not return
the prompt until the file has been downloaded.
the prompt until the file has been downloaded.
Use the terminal emulator’s ASCII download feature
Use the terminal emulator’s ASCII download feature
(or a simple clipboard     copy/paste operation) to download
(or a simple clipboard     copy/paste operation) to download
the gdb_module.srec data.
the gdb_module.srec data.
Note that on Linux, Minicom’s ASCII download feature seems
Note that on Linux, Minicom’s ASCII download feature seems
to be broken. A workaround is to load the file into Emacs (or another
to be broken. A workaround is to load the file into Emacs (or another
editor) and copy the full contents to the clipboard. Then press
editor) and copy the full contents to the clipboard. Then press
the mouse paste-button (usually the middle one) over the Minicom
the mouse paste-button (usually the middle one) over the Minicom
window.
window.
Program the FLASH with the downloaded data:
Program the FLASH with the downloaded data:
EPPC-Bug>pflash 40000 60000 fc000000
EPPC-Bug>pflash 40000 60000 fc000000
Switch off the power, and change jumper 4 to 1-2. Turn
Switch off the power, and change jumper 4 to 1-2. Turn
on the power again. The board should now boot using the newly programmed
on the power again. The board should now boot using the newly programmed
stubs.
stubs.
PowerPC Architectural Simulator Setup
PowerPC Architectural Simulator Setup
The PowerPC simulator is an architectural simulator which
The PowerPC simulator is an architectural simulator which
implements all the features of the PowerPC needed to run eCos. The
implements all the features of the PowerPC needed to run eCos. The
current implementation provides accurate simulation of the instruction
current implementation provides accurate simulation of the instruction
set and timers, as well as having generic support for diagnostic
set and timers, as well as having generic support for diagnostic
output  and exceptions.
output  and exceptions.
The simulator also allows devices to be simulated, but no
The simulator also allows devices to be simulated, but no
device simulation support has been defined for the serial device
device simulation support has been defined for the serial device
drivers in this release.
drivers in this release.
To simplify connection to the simulator, you are advised to
To simplify connection to the simulator, you are advised to
create a GDB macro by putting the following code in your personal
create a GDB macro by putting the following code in your personal
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
define psim
define psim
 target sim -o ’/iobus/pal@0xf0001000/reg 0xf0001000 32’
 target sim -o ’/iobus/pal@0xf0001000/reg 0xf0001000 32’
 rbreak cyg_test_exit
 rbreak cyg_test_exit
 rbreak cyg_assert_fail
 rbreak cyg_assert_fail
end
end
You can then connect to the simulator by invoking the command psim on
You can then connect to the simulator by invoking the command psim on
the command line:
the command line:
(gdb) psim
(gdb) psim
You can achieve the same effect by typing out the macro’s
You can achieve the same effect by typing out the macro’s
content on the command line if necessary.
content on the command line if necessary.
The PowerPC simulator cannot execute binaries built for any
The PowerPC simulator cannot execute binaries built for any
of the supported hardware targets. You must generate a configuration
of the supported hardware targets. You must generate a configuration
using the PowerPC simulator platform:
using the PowerPC simulator platform:
$ ecosconfig new psim
$ ecosconfig new psim
 or some such.
 or some such.
SPARClite Hardware Setup
SPARClite Hardware Setup
The eCos Developer’s Kit package comes with a ROM
The eCos Developer’s Kit package comes with a ROM
which provides GDB support for the Fujitsu SPARClite Evaluation
which provides GDB support for the Fujitsu SPARClite Evaluation
Board by way of CygMon. 
Board by way of CygMon. 
An image of this ROM is also provided at
An image of this ROM is also provided at
          BASE_DIR/loaders/sparclite-sleb/cygmon.bin. The
          BASE_DIR/loaders/sparclite-sleb/cygmon.bin. The
ROM is installed in socket IC9 on the evaluation board. Attention
ROM is installed in socket IC9 on the evaluation board. Attention
should be paid to the correct orientation of the ROM during installation.
should be paid to the correct orientation of the ROM during installation.
The GDB stub allows communication with GDB using a TCP channel
The GDB stub allows communication with GDB using a TCP channel
via the ethernet port at connector J5.
via the ethernet port at connector J5.
<!-- <index></index> --><!-- <xref> -->Ethernet Setup
<!-- <index></index> --><!-- <xref> -->Ethernet Setup
The ethernet setup is described in the board’s manual,
The ethernet setup is described in the board’s manual,
but here is a recapitulation.
but here is a recapitulation.
Set the board’s ethernet address using SW1 on the
Set the board’s ethernet address using SW1 on the
motherboard:
motherboard:
            SW1-4 SW1-3 SW1-2 SW1-1    Ethernet Address
            SW1-4 SW1-3 SW1-2 SW1-1    Ethernet Address
            ----- ----- ----- -----    ----------------
            ----- ----- ----- -----    ----------------
            OFF   OFF   OFF   OFF     No ethernet, use serial
            OFF   OFF   OFF   OFF     No ethernet, use serial
            OFF   OFF   OFF    ON     00:00:0E:31:00:01
            OFF   OFF   OFF    ON     00:00:0E:31:00:01
            OFF   OFF    ON   OFF     00:00:0E:31:00:02
            OFF   OFF    ON   OFF     00:00:0E:31:00:02
            OFF   OFF    ON    ON     00:00:0E:31:00:03
            OFF   OFF    ON    ON     00:00:0E:31:00:03
            OFF    ON   OFF   OFF     00:00:0E:31:00:04
            OFF    ON   OFF   OFF     00:00:0E:31:00:04
            OFF    ON   OFF    ON     00:00:0E:31:00:05
            OFF    ON   OFF    ON     00:00:0E:31:00:05
            OFF    ON    ON   OFF     00:00:0E:31:00:06
            OFF    ON    ON   OFF     00:00:0E:31:00:06
            OFF    ON    ON    ON     00:00:0E:31:00:07
            OFF    ON    ON    ON     00:00:0E:31:00:07
            ON    OFF   OFF   OFF     00:00:0E:31:00:08
            ON    OFF   OFF   OFF     00:00:0E:31:00:08
            ON    OFF   OFF    ON     00:00:0E:31:00:09
            ON    OFF   OFF    ON     00:00:0E:31:00:09
            ON    OFF    ON   OFF     00:00:0E:31:00:0A
            ON    OFF    ON   OFF     00:00:0E:31:00:0A
            ON    OFF    ON    ON     00:00:0E:31:00:0B
            ON    OFF    ON    ON     00:00:0E:31:00:0B
            ON     ON   OFF   OFF     00:00:0E:31:00:0C
            ON     ON   OFF   OFF     00:00:0E:31:00:0C
            ON     ON   OFF    ON     00:00:0E:31:00:0D
            ON     ON   OFF    ON     00:00:0E:31:00:0D
            ON     ON    ON   OFF     00:00:0E:31:00:0E
            ON     ON    ON   OFF     00:00:0E:31:00:0E
            ON     ON    ON    ON     00:00:0E:31:00:0F
            ON     ON    ON    ON     00:00:0E:31:00:0F
BOOTP/DHCP service on Linux
BOOTP/DHCP service on Linux
Configure the BOOTP or DHCP server on the network to recognize
Configure the BOOTP or DHCP server on the network to recognize
the evaluation board’s ethernet address so it can assign
the evaluation board’s ethernet address so it can assign
the board an IP address. Below is a sample DHCP server configuration
the board an IP address. Below is a sample DHCP server configuration
from a Linux system (/etc/dhcpd.conf).
from a Linux system (/etc/dhcpd.conf).
It shows a setup for three evaluation boards.
It shows a setup for three evaluation boards.
#
#
# DHCP server configuration.
# DHCP server configuration.
#
#
allow bootp;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {
subnet 192.168.1.0 netmask 255.255.255.0 {
  host mb831evb {
  host mb831evb {
    hardware ethernet 00:00:0e:31:00:01;
    hardware ethernet 00:00:0e:31:00:01;
    fixed-address mb831evb;
    fixed-address mb831evb;
  }
  }
  host mb832evb {
  host mb832evb {
    hardware ethernet 00:00:0e:31:00:02;
    hardware ethernet 00:00:0e:31:00:02;
    fixed-address mb832evb;
    fixed-address mb832evb;
  }
  }
  host mb833evb {
  host mb833evb {
    hardware ethernet 00:00:0e:31:00:03;
    hardware ethernet 00:00:0e:31:00:03;
    fixed-address mb833evb;
    fixed-address mb833evb;
  }
  }
} 
} 
BOOTP/DHCP boot process
BOOTP/DHCP boot process
Even when configured to use a TCP channel, CygMon will still
Even when configured to use a TCP channel, CygMon will still
print a boot message to the serial channel. If the BOOTP process
print a boot message to the serial channel. If the BOOTP process
was successful and an IP address was found, a message “BOOTP
was successful and an IP address was found, a message “BOOTP
found xxx.xxx.xxx.xxx” will be printed where xxx.xxx.xxx.xxx
found xxx.xxx.xxx.xxx” will be printed where xxx.xxx.xxx.xxx
is the IP address assigned by the BOOTP or DHCP server. If the BOOTP
is the IP address assigned by the BOOTP or DHCP server. If the BOOTP
process fails, a message indicating failure will be printed and
process fails, a message indicating failure will be printed and
the serial port will be used as the debug channel.
the serial port will be used as the debug channel.
Once the board finds an IP address it will respond to ICMP
Once the board finds an IP address it will respond to ICMP
echo request packets (ping). This gives a simple means to test the
echo request packets (ping). This gives a simple means to test the
health of the board.
health of the board.
As described in “Ethernet Setup” on page 72,
As described in “Ethernet Setup” on page 72,
it should now be possible to connect to the SPARClite board from
it should now be possible to connect to the SPARClite board from
within GDB by using the command:
within GDB by using the command:
(gdb) target remote <host>:1000
(gdb) target remote <host>:1000
Serial Setup
Serial Setup
The CygMon stubs also allow communication with GDB by way
The CygMon stubs also allow communication with GDB by way
of the serial port at connector CON1. The communication parameters
of the serial port at connector CON1. The communication parameters
are fixed at 19200 baud, 8 data bits, no parity bit and 1 stop bit
are fixed at 19200 baud, 8 data bits, no parity bit and 1 stop bit
(8-N-1). No flow control is employed. Connection to the host computer
(8-N-1). No flow control is employed. Connection to the host computer
should be made using a null modem cable. A gender changer may also
should be made using a null modem cable. A gender changer may also
be required.
be required.
SPARClite Architectural Simulator Setup
SPARClite Architectural Simulator Setup
The ESA SPARClite simulator is an architectural simulator
The ESA SPARClite simulator is an architectural simulator
which implements all the features of the SPARClite needed to run
which implements all the features of the SPARClite needed to run
eCos. The current implementation provides accurate simulation of
eCos. The current implementation provides accurate simulation of
the instruction set, interrupt controller, and timers, as well as
the instruction set, interrupt controller, and timers, as well as
having generic support for diagnostic output and exceptions.
having generic support for diagnostic output and exceptions.
Note that the ESA SPARClite simulator is unsupported, but
Note that the ESA SPARClite simulator is unsupported, but
is included in the release as a convenience.
is included in the release as a convenience.
To simplify connection to the simulator, you are advised to
To simplify connection to the simulator, you are advised to
create a GDB macro by putting the following code in your personal
create a GDB macro by putting the following code in your personal
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).
define ssim
define ssim
 target sim -nfp -sparclite -dumbio
 target sim -nfp -sparclite -dumbio
 rbreak cyg_test_exit
 rbreak cyg_test_exit
 rbreak cyg_assert_fail
 rbreak cyg_assert_fail
end
end
You can then connect to the simulator by invoking the command ssim on
You can then connect to the simulator by invoking the command ssim on
the command line:
the command line:
(gdb) ssim
(gdb) ssim
You can achieve the same effect by typing out the macro’s
You can achieve the same effect by typing out the macro’s
content on the command line if necessary.
content on the command line if necessary.
<!-- <index></index> --><!-- <xref> -->ARM PID Hardware Setup
<!-- <index></index> --><!-- <xref> -->ARM PID Hardware Setup
eCos comes with two ROM images that provide GDB support for
eCos comes with two ROM images that provide GDB support for
the ARM PID board. The first ROM image provides a port of the CygMon
the ARM PID board. The first ROM image provides a port of the CygMon
ROM monitor, which includes a command-line interface and a GDB remote
ROM monitor, which includes a command-line interface and a GDB remote
stub. The second ROM image provides a remote GDB stub only, which
stub. The second ROM image provides a remote GDB stub only, which
is a minimal environment for downloading and debugging eCos programs
is a minimal environment for downloading and debugging eCos programs
solely using GDB.
solely using GDB.
eCos, CygMon and the GDB stubs all support the PID fitted
eCos, CygMon and the GDB stubs all support the PID fitted
with both ARM7T and ARM9 daughterboards. CygMon and the stubs can
with both ARM7T and ARM9 daughterboards. CygMon and the stubs can
be programmed into either the programmable ROM (U12) or the FLASH
be programmed into either the programmable ROM (U12) or the FLASH
(U13). Pre-built forms of both ROM images are provided in the directory
(U13). Pre-built forms of both ROM images are provided in the directory
loaders/arm-pid under the root of your eCos installation,
loaders/arm-pid under the root of your eCos installation,
along with a tool that will program the stubs into the FLASH memory on
along with a tool that will program the stubs into the FLASH memory on
the board. CygMon images are prefixed with the name 'cygmon' and
the board. CygMon images are prefixed with the name 'cygmon' and
GDB stub ROM images are given the prefix 'gdb_module'.
GDB stub ROM images are given the prefix 'gdb_module'.
Images may be provided in a number of formats including ELF (.img
Images may be provided in a number of formats including ELF (.img
extension), binary (.bin extension) and SREC (.srec extension).
extension), binary (.bin extension) and SREC (.srec extension).
Note that some unreliability has been experienced in downloading
Note that some unreliability has been experienced in downloading
files using Angel 1.00. Angel 1.02 appears to be more robust in
files using Angel 1.00. Angel 1.02 appears to be more robust in
this application.
this application.
Installing the Stubs into FLASH
Installing the Stubs into FLASH
Preparing the Binaries
Preparing the Binaries
These two binary preparation steps are not strictly necessary
These two binary preparation steps are not strictly necessary
as the eCos distribution ships with pre-compiled binaries in the
as the eCos distribution ships with pre-compiled binaries in the
directory loaders/arm-pid relative to the installation
directory loaders/arm-pid relative to the installation
root.
root.
Building the ROM images with the eCos Configuration Tool
Building the ROM images with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build
Build
->
->
Templates
Templates
 menu item, and then select the ARM PID hardware.
 menu item, and then select the ARM PID hardware.
While still displaying the
While still displaying the
Build
Build
->
->
Templates
Templates
 dialog box, select either the "stubs" package template to build
 dialog box, select either the "stubs" package template to build
a GDB stub image, or the "cygmon" template to build the CygMon ROM
a GDB stub image, or the "cygmon" template to build the CygMon ROM
Monitor. Click
Monitor. Click
OK.
OK.
Build eCos using
Build eCos using
Build
Build
->
->
Library
Library
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix "gdb_module". CygMon images
ROM images have the prefix "gdb_module". CygMon images
have the prefix "cygmon".
have the prefix "cygmon".
Building the ROM images with ecosconfig
Building the ROM images with ecosconfig
                    Make an empty directory to contain the build tree,
                    Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new pid stubs
$ ecosconfig new pid stubs
or to build a CygMon ROM monitor image, enter the command:
or to build a CygMon ROM monitor image, enter the command:
$ ecosconfig new pid cygmon
$ ecosconfig new pid cygmon
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix "gdb_module". CygMon images
ROM images have the prefix "gdb_module". CygMon images
have the prefix "cygmon".
have the prefix "cygmon".
Building the FLASH Tool with the eCos Configuration Tool
Building the FLASH Tool with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the ARM PID hardware.
 menu item, and then select the ARM PID hardware.
Enable the "Build flash programming tool" option in the
Enable the "Build flash programming tool" option in the
ARM PID HAL (CYGBLD_BUILD_FLASH_TOOL)
ARM PID HAL (CYGBLD_BUILD_FLASH_TOOL)
and resolve any resulting configuration conflicts.
and resolve any resulting configuration conflicts.
Build eCos using
Build eCos using
Build
Build
->
->
Library
Library
When the build completes, the FLASH tool image file can
When the build completes, the FLASH tool image file can
be found in the bin/ subdirectory of the install tree,
be found in the bin/ subdirectory of the install tree,
with the prefix "prog_flash"
with the prefix "prog_flash"
Building the FLASH Tool with ecosconfig
Building the FLASH Tool with ecosconfig
                    Make an empty directory to contain the build tree,
                    Make an empty directory to contain the build tree,
and cd into it
and cd into it
                    
                    
Enter the command:
Enter the command:
$ ecosconfig new pid
$ ecosconfig new pid
Edit the file ecos.ecc and enable the option CYGBLD_BUILD_FLASH_TOOL
Edit the file ecos.ecc and enable the option CYGBLD_BUILD_FLASH_TOOL
by uncommenting its user_value property and setting it
by uncommenting its user_value property and setting it
to 1.
to 1.
Enter the commands:
Enter the commands:
$ ecosconfig resolve
$ ecosconfig resolve
[there will be some output]
[there will be some output]
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the FLASH tool image file can
When the build completes, the FLASH tool image file can
be found in the bin/ subdirectory of the install tree,
be found in the bin/ subdirectory of the install tree,
with the prefix "prog_flash"
with the prefix "prog_flash"
Prepare the Board for FLASH Programming
Prepare the Board for FLASH Programming
Each time a new image is to be programmed in the FLASH, the
Each time a new image is to be programmed in the FLASH, the
jumpers on the board must be set to allow Angel to run:
jumpers on the board must be set to allow Angel to run:
                    Set jumper 7-8 on LK6   [using the Angel code
                    Set jumper 7-8 on LK6   [using the Angel code
in the 16 bit EPROM]
in the 16 bit EPROM]
Set jumper 5-6 on LK6   [select 8bit ROM mode]
Set jumper 5-6 on LK6   [select 8bit ROM mode]
Set jumper LK18         [ROM remap - this is
Set jumper LK18         [ROM remap - this is
also required for eCos]
also required for eCos]
Set S1 to 0-0-1-1       [20MHz operation]
Set S1 to 0-0-1-1       [20MHz operation]
Open jumper LK4  [enable little-endian operation]
Open jumper LK4  [enable little-endian operation]
Attach a serial cable from Serial A on the PID board to connector
Attach a serial cable from Serial A on the PID board to connector
1 on the development system. This is the cable through which the
1 on the development system. This is the cable through which the
binaries will be downloaded. Attach a serial cable from Serial B
binaries will be downloaded. Attach a serial cable from Serial B
on the PID board to connector 2 on the development system (or any
on the PID board to connector 2 on the development system (or any
system that will work as a terminal). Through this cable, the FLASH
system that will work as a terminal). Through this cable, the FLASH
tool will write its instructions (at 38400 baud).
tool will write its instructions (at 38400 baud).
Program the FLASH
Program the FLASH
Download the FLASH ROM image onto the PID board. For
Download the FLASH ROM image onto the PID board. For
example. for the GDB stubs image:
example. for the GDB stubs image:
bash$ arm-elf-gdb -nw gdb_module.img
bash$ arm-elf-gdb -nw gdb_module.img
GNU gdb 4.18-DEVTOOLSVERSION
GNU gdb 4.18-DEVTOOLSVERSION
Copyright 1998 Free Software Foundation, Inc.
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License,
GDB is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies
and you are welcome to change it and/or distribute copies
of it under certain conditions. Type "show copying" to see the conditions.
of it under certain conditions. Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
(no debugging symbols found)...
(no debugging symbols found)...
(gdb) target rdi s=com1
(gdb) target rdi s=com1
Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
(Advanced RISC Machines SDT 2.10)
(Advanced RISC Machines SDT 2.10)
Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
Connected to ARM RDI target.
Connected to ARM RDI target.
(gdb) load
(gdb) load
Loading section .rom_vectors, size 0x44 lma 0x60000
Loading section .rom_vectors, size 0x44 lma 0x60000
Loading section .text, size 0x1f3c lma 0x60044
Loading section .text, size 0x1f3c lma 0x60044
Loading section .rodata, size 0x2c lma 0x61f80
Loading section .rodata, size 0x2c lma 0x61f80
Loading section .data, size 0x124 lma 0x61fac
Loading section .data, size 0x124 lma 0x61fac
Start address 0x60044 , load size 8400
Start address 0x60044 , load size 8400
Transfer rate: 5169 bits/sec.
Transfer rate: 5169 bits/sec.
(gdb) q
(gdb) q
The program is running.  Exit anyway? (y or n) y 
The program is running.  Exit anyway? (y or n) y 
 On a UNIX or Linux system, the serial port must be
 On a UNIX or Linux system, the serial port must be
 /dev/ttyS0 instead of COM1.
 /dev/ttyS0 instead of COM1.
 You need to make sure that the /dev/ttyS0 files
 You need to make sure that the /dev/ttyS0 files
have the right permissions:
have the right permissions:
$ su
$ su
 Password:
 Password:
 # chmod o+rw /dev/ttyS0*
 # chmod o+rw /dev/ttyS0*
 # exit
 # exit
                      
                      
If you are programming the GDB stub image, it will now be located
If you are programming the GDB stub image, it will now be located
at 0x60000..0x64000. If you are programming the Cygmon ROM Monitor,
at 0x60000..0x64000. If you are programming the Cygmon ROM Monitor,
it will be located at 0x60000..0x80000.
it will be located at 0x60000..0x80000.
Now download the FLASH programmer tool
Now download the FLASH programmer tool
bash$ arm-elf-gdb prog_flash.img
bash$ arm-elf-gdb prog_flash.img
GNU gdb 4.18-DEVTOOLSVERSION
GNU gdb 4.18-DEVTOOLSVERSION
Copyright 1998 Free Software Foundation, Inc.
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License,
GDB is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute
and you are welcome to change it and/or distribute
copies of it under certain conditions. Type "show copying" to see
copies of it under certain conditions. Type "show copying" to see
the conditions. There is absolutely no warranty for GDB.  Type "show
the conditions. There is absolutely no warranty for GDB.  Type "show
warranty" for details.
warranty" for details.
This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".
(gdb) target rdi s=com1
(gdb) target rdi s=com1
Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00
(Advanced RISC Machines SDT 2.10)
(Advanced RISC Machines SDT 2.10)
Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
Connected to ARM RDI target.
Connected to ARM RDI target.
(gdb) load
(gdb) load
Loading section .rom_vectors, size 0x44 lma 0x40000
Loading section .rom_vectors, size 0x44 lma 0x40000
Loading section .text, size 0x44a4 lma 0x40044
Loading section .text, size 0x44a4 lma 0x40044
Loading section .rodata, size 0x318 lma 0x444e8
Loading section .rodata, size 0x318 lma 0x444e8
Loading section .data, size 0x1c8 lma 0x44800
Loading section .data, size 0x1c8 lma 0x44800
Start address 0x40044 , load size 18888
Start address 0x40044 , load size 18888
Transfer rate: 5596 bits/sec.
Transfer rate: 5596 bits/sec.
(gdb) c
(gdb) c
The FLASH tool will output some text on the board serial
The FLASH tool will output some text on the board serial
port B at 38400 baud:
port B at 38400 baud:
ARM
ARM
eCos
eCos
FLASH here!
FLASH here!
manuf: 8, device: 40
manuf: 8, device: 40
Error: Wrong Manufaturer: 08
Error: Wrong Manufaturer: 08
... Please change FLASH jumper
... Please change FLASH jumper
This text is repeated until you remove the jumper 7-8
This text is repeated until you remove the jumper 7-8
on LK6. Then the output will be:
on LK6. Then the output will be:
manuf: 1F, device: A4
manuf: 1F, device: A4
AT29C040A recognised
AT29C040A recognised
About to program FLASH using data at 60000..64000
About to program FLASH using data at 60000..64000
*** Press RESET now to abort!
*** Press RESET now to abort!
 You have about 10 seconds to abort the operation by pressing
 You have about 10 seconds to abort the operation by pressing
reset. After this timeout, the FLASH programming happens:
reset. After this timeout, the FLASH programming happens:
...Programming FLASH
...Programming FLASH
All done!
All done!
Quit/kill the GDB process, which will hang.
Quit/kill the GDB process, which will hang.
Next time you reset the board, the stub will be in control,
Next time you reset the board, the stub will be in control,
communicating on Serial A at 38400 baud.
communicating on Serial A at 38400 baud.
If you do not have two serial ports available on your host
If you do not have two serial ports available on your host
computer, you may still verify the FLASH programming completed successfully
computer, you may still verify the FLASH programming completed successfully
by quitting/killing the GDB process after running "c" in
by quitting/killing the GDB process after running "c" in
step 2 above. Then switch the serial cable on the PID from Serial
step 2 above. Then switch the serial cable on the PID from Serial
A to Serial B and run a terminal emulator on the host computer.
A to Serial B and run a terminal emulator on the host computer.
In a few seconds you should see the the repeated text described
In a few seconds you should see the the repeated text described
in step 2 above and you may continue the remaining steps as normal.
in step 2 above and you may continue the remaining steps as normal.
Programming the FLASH for big-endian mode
Programming the FLASH for big-endian mode
The process is almost identical to the previous instructions
The process is almost identical to the previous instructions
which apply to a PID board running in little-endian mode only.
which apply to a PID board running in little-endian mode only.
The only adjustments to make are that if programming a GDB stub
The only adjustments to make are that if programming a GDB stub
ROM image (or CygMon ROM monitor image), you must enable the option "Use
ROM image (or CygMon ROM monitor image), you must enable the option "Use
Big-endian mode" in the eCos Configuration Tool (CYGHWR_HAL_ARM_BIGENDIAN
Big-endian mode" in the eCos Configuration Tool (CYGHWR_HAL_ARM_BIGENDIAN
if using ecosconfig and editing ecos.ecc).
if using ecosconfig and editing ecos.ecc).
When programming the FLASH there are two options:
When programming the FLASH there are two options:
Program FLASH using the little-endian FLASH tool. After
Program FLASH using the little-endian FLASH tool. After
powering off, replace the ROM controller with the special big-endian
powering off, replace the ROM controller with the special big-endian
version which can be acquired from ARM. (This has not been tested
version which can be acquired from ARM. (This has not been tested
by Red Hat).
by Red Hat).
Use a special big-endian version of the FLASH tool which
Use a special big-endian version of the FLASH tool which
byte-swaps all the words as they are written to the FLASH.
byte-swaps all the words as they are written to the FLASH.
Build this tool by enabling the "Build flash programming tool
Build this tool by enabling the "Build flash programming tool
for BE images on LE boards" option (CYGBLD_BUILD_FLASH_TOOL_BE),
for BE images on LE boards" option (CYGBLD_BUILD_FLASH_TOOL_BE),
resulting in a utility with the prefix "prog_flash_BE_image_LE_system"
resulting in a utility with the prefix "prog_flash_BE_image_LE_system"
which should be used instead of "prog_flash".
which should be used instead of "prog_flash".
Note that there is a limitation to this method: no sub-word
Note that there is a limitation to this method: no sub-word
data can be read from the ROM. To work around this, the .rodata
data can be read from the ROM. To work around this, the .rodata
section is folded into the .data section and thus copied to RAM
section is folded into the .data section and thus copied to RAM
before the system starts.
before the system starts.
Given that Thumb instructions are 16 bit, it is not possible
Given that Thumb instructions are 16 bit, it is not possible
to run ROM-startup Thumb binaries on the PID board using this method.
to run ROM-startup Thumb binaries on the PID board using this method.
When the image has been programmed, power off the board, and
When the image has been programmed, power off the board, and
set jumper LK4 to enable big-endian operation.
set jumper LK4 to enable big-endian operation.
Installing the Stubs into ROM
Installing the Stubs into ROM
Program the binary image file gdb_module.bin
Program the binary image file gdb_module.bin
into ROM referring to the instructions of your ROM programmer.
into ROM referring to the instructions of your ROM programmer.
Plug the ROM into socket U12 and install jumper LK6 pins
Plug the ROM into socket U12 and install jumper LK6 pins
7-8 to enable the ROM.
7-8 to enable the ROM.
<!-- <index></index> -->ARM AEB-1 Hardware Setup
<!-- <index></index> -->ARM AEB-1 Hardware Setup
Overview
Overview
The ARM AEB-1 comes with tools in ROM. These include a simple
The ARM AEB-1 comes with tools in ROM. These include a simple
FLASH management tool and the Angel® monitor. eCos for
FLASH management tool and the Angel® monitor. eCos for
the ARM AEB-1 comes with GDB stubs suitable for programming into
the ARM AEB-1 comes with GDB stubs suitable for programming into
the onboard FLASH. GDB is the preferred debug environment for GDB,
the onboard FLASH. GDB is the preferred debug environment for GDB,
and while Angel provides a subset of the features in the eCos GDB
and while Angel provides a subset of the features in the eCos GDB
stub, Angel is unsupported.
stub, Angel is unsupported.
Both eCos and the stubs support both Revision B and Revision
Both eCos and the stubs support both Revision B and Revision
C of the AEB-1 board. Stub ROM images for both types of board can
C of the AEB-1 board. Stub ROM images for both types of board can
be found in the loaders/arm-aeb directory under the root
be found in the loaders/arm-aeb directory under the root
of your eCos installation. You can select which board you are using
of your eCos installation. You can select which board you are using
by selecting either the aeb or aebC platform by selecting the appropriate
by selecting either the aeb or aebC platform by selecting the appropriate
platform HAL in the eCos Configuration Tool.
platform HAL in the eCos Configuration Tool.
The GDB stub can be downloaded to the board for programming
The GDB stub can be downloaded to the board for programming
in the FLASH using the board's on-board ROM monitor:
in the FLASH using the board's on-board ROM monitor:
talk to the AEB-1 board with a terminal emulator (or
talk to the AEB-1 board with a terminal emulator (or
a real terminal!)
a real terminal!)
use the board's rom menu to download a UU-encoded
use the board's rom menu to download a UU-encoded
version of the GDB stubs which will act as a ROM monitor
version of the GDB stubs which will act as a ROM monitor
tell the board to use this new monitor, and then hook
tell the board to use this new monitor, and then hook
GDB up to it for real debugging
GDB up to it for real debugging
Talking to the Board
Talking to the Board
Connect a terminal or computer's serial port to the
Connect a terminal or computer's serial port to the
ARM AEB-1. On a PC with a 9-pin serial port, you can use the cable
ARM AEB-1. On a PC with a 9-pin serial port, you can use the cable
shipped by ARM with no modification. 
shipped by ARM with no modification. 
Set the terminal or terminal emulator to 9600N1 (9600 baud,
Set the terminal or terminal emulator to 9600N1 (9600 baud,
no parity, 1 stop bit). 
no parity, 1 stop bit). 
Reset the board by pressing the little reset button on the
Reset the board by pressing the little reset button on the
top. You will see the following text: 
top. You will see the following text: 
        ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998)
        ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998)
        Press ENTER within 2 seconds to stop autoboot
        Press ENTER within 2 seconds to stop autoboot
Press ENTER quickly, and you will get the boot prompt: 
Press ENTER quickly, and you will get the boot prompt: 
        Boot:
        Boot:
Downloading the Stubs via the Rom Menu
Downloading the Stubs via the Rom Menu
Using the AEB-1 rom menu to download the GDB stubs from the
Using the AEB-1 rom menu to download the GDB stubs from the
provided ".UU" file.
provided ".UU" file.
This is an annotated 'terminal' session
This is an annotated 'terminal' session
with the AEB-1 monitor:
with the AEB-1 monitor:
+Boot: help
+Boot: help
Module is BootStrap       1.00 (14 Aug 1998)
Module is BootStrap       1.00 (14 Aug 1998)
Help is available on:
Help is available on:
Help          Modules       ROMModules    UnPlug        PlugIn
Help          Modules       ROMModules    UnPlug        PlugIn
Kill          SetEnv        UnSetEnv      PrintEnv      DownLoad
Kill          SetEnv        UnSetEnv      PrintEnv      DownLoad
Go            GoS           Boot          PC            FlashWrite
Go            GoS           Boot          PC            FlashWrite
FlashLoad     FlashErase
FlashLoad     FlashErase
Boot: download c000
Boot: download c000
Ready to download. Use 'transmit' option on terminal
Ready to download. Use 'transmit' option on terminal
emulator to download file.
emulator to download file.
... at this point, download the ASCII file "loaders/arm-aeb/
... at this point, download the ASCII file "loaders/arm-aeb/
    gdb_module.img.UU". The details of this operation differ
    gdb_module.img.UU". The details of this operation differ
    depending on which terminal emulator is used. It may be
    depending on which terminal emulator is used. It may be
    necessary to enter "^D" (control+D) when the download completes
    necessary to enter "^D" (control+D) when the download completes
   to get the monitor to return to command mode. 
   to get the monitor to return to command mode. 
Loaded file gdb_module.img.bin at address
Loaded file gdb_module.img.bin at address
0000c000, size = 19392 
0000c000, size = 19392 
Activating the GDB Stubs
Activating the GDB Stubs
Commit the GDB stubs module to FLASH: 
Commit the GDB stubs module to FLASH: 
        Boot: flashwrite 4018000 C000 8000
        Boot: flashwrite 4018000 C000 8000
    
    
Verify that the eCos/"GDB stubs" module is now added
Verify that the eCos/"GDB stubs" module is now added
in the list of modules in the board: 
in the list of modules in the board: 
        Boot: rommodules
        Boot: rommodules
    
    
You should see output similar to the following: 
You should see output similar to the following: 
        Header   Base     Limit
        Header   Base     Limit
        04000004 04000000 040034a8 BootStrap       1.00 (14 Aug 1998)
        04000004 04000000 040034a8 BootStrap       1.00 (14 Aug 1998)
        04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998)
        04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998)
        0400e4f4 04004000 0400e60f Angel           1.02 (12 MAY 1998)
        0400e4f4 04004000 0400e60f Angel           1.02 (12 MAY 1998)
        0401c810 04018000 0401cbc0 eCos              1.3  (27 Jan 2000)
        0401c810 04018000 0401cbc0 eCos              1.3  (27 Jan 2000)
GDB stubs
GDB stubs
    
    
Now make the eCos/"GDB stubs" module be the default
Now make the eCos/"GDB stubs" module be the default
monitor: 
monitor: 
        Boot: plugin eCos
        Boot: plugin eCos
    
    
Since the GDB stubs are always linked at the same address
Since the GDB stubs are always linked at the same address
(0x4018000), the operation of writing to the FLASH and selecting
(0x4018000), the operation of writing to the FLASH and selecting
the stubs as default monitor is an idempotent operation. You can
the stubs as default monitor is an idempotent operation. You can
download a new set of stubs following the same procedure - you do
download a new set of stubs following the same procedure - you do
not have to unregister or delete anything.
not have to unregister or delete anything.
Building the GDB Stub FLASH ROM Images
Building the GDB Stub FLASH ROM Images
Pre-built GDB stubs images are provided in the directory loaders/arm-aeb
Pre-built GDB stubs images are provided in the directory loaders/arm-aeb
relative to the root of your eCos installation, but here are instructions
relative to the root of your eCos installation, but here are instructions
on how to rebuild them if you should ever need to.
on how to rebuild them if you should ever need to.
Building the GDB Stubs with the eCos Configuration Tool
Building the GDB Stubs with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File
File
->
->
New
New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build
Build
->
->
Templates
Templates
 menu item, and then select the ARM AEB-1 hardware.
 menu item, and then select the ARM AEB-1 hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the "stubs" package template to build a GDB
 dialog box, select the "stubs" package template to build a GDB
stub image. Click
stub image. Click
OK.
OK.
If applicable, set the "AEB board revision" option to
If applicable, set the "AEB board revision" option to
"C" from "B" depending on the board revision being used.
"C" from "B" depending on the board revision being used.
Build eCos using
Build eCos using
Build
Build
->
->
Library.
Library.
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. The GDB stub
in the bin/ subdirectory of the install tree. The GDB stub
ROM images have the prefix "gdb_module".
ROM images have the prefix "gdb_module".
Building the GDB Stub ROMs with ecosconfig
Building the GDB Stub ROMs with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new aeb stubs
$ ecosconfig new aeb stubs
If applicable, edit ecos.ecc and set the AEB board revision. (CYGHWR_HAL_ARM_AEB_REVISION)
If applicable, edit ecos.ecc and set the AEB board revision. (CYGHWR_HAL_ARM_AEB_REVISION)
from the default "B" to "C" by uncommenting the user_value
from the default "B" to "C" by uncommenting the user_value
property and setting it to "C".
property and setting it to "C".
Enter the commands
Enter the commands
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. The GDB stub
in the bin/ subdirectory of the install tree. The GDB stub
ROM images have the prefix "gdb_module".
ROM images have the prefix "gdb_module".
<!-- <index></index> -->ARM Cogent CMA230 Hardware Setup
<!-- <index></index> -->ARM Cogent CMA230 Hardware Setup
The eCos Developer's Kit package comes with an EPROM
The eCos Developer's Kit package comes with an EPROM
which provides GDB support for the Cogent evaluation board. An image
which provides GDB support for the Cogent evaluation board. An image
of this EPROM is also provided at loaders/arm-cma230/gdbload.bin
of this EPROM is also provided at loaders/arm-cma230/gdbload.bin
under the root of your eCos installation. 
under the root of your eCos installation. 
The EPROM is installed to socket U3 on the board. Attention
The EPROM is installed to socket U3 on the board. Attention
should be paid to the correct orientation of the EPROM during installation.
should be paid to the correct orientation of the EPROM during installation.
If you are going to burn a new EPROM using the binary image,
If you are going to burn a new EPROM using the binary image,
be careful to get the byte order correct. It needs to be little-endian,
be careful to get the byte order correct. It needs to be little-endian,
which is usually the default in PC based programmer software.
which is usually the default in PC based programmer software.
If the GDB stub EPROM you burn does not work, try reversing
If the GDB stub EPROM you burn does not work, try reversing
the byte-order, even if you think you have it the right way around.
the byte-order, even if you think you have it the right way around.
At least one DOS-based EPROM burner program is known to have the
At least one DOS-based EPROM burner program is known to have the
byte-order upside down.
byte-order upside down.
The GDB stub in the EPROM allows communication with GDB using
The GDB stub in the EPROM allows communication with GDB using
the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters
the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters
are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit
are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit
(8-N-1).  No flow control is employed. Connection to the host computer
(8-N-1).  No flow control is employed. Connection to the host computer
should be made using a dedicated serial cable as specified in the
should be made using a dedicated serial cable as specified in the
Cogent CMA manual.
Cogent CMA manual.
Building the GDB Stub FLASH ROM images
Building the GDB Stub FLASH ROM images
Pre-built GDB stubs images are provided in the directory loaders/arm-cma230 relative
Pre-built GDB stubs images are provided in the directory loaders/arm-cma230 relative
to the root of your eCos installation, but here are instructions
to the root of your eCos installation, but here are instructions
on how to rebuild them if you should ever need to.
on how to rebuild them if you should ever need to.
CygMon images are prefixed with the name 'cygmon' and
CygMon images are prefixed with the name 'cygmon' and
GDB stub ROM images
GDB stub ROM images
are given the prefix 'gdb_module'.
are given the prefix 'gdb_module'.
Images may be provided in a number of formats including ELF (.img
Images may be provided in a number of formats including ELF (.img
extension), binary (.bin extension) and SREC (.srec extension). 
extension), binary (.bin extension) and SREC (.srec extension). 
Building the GDB Stubs with the eCos Configuration Tool
Building the GDB Stubs with the eCos Configuration Tool
1. Start with a new document - selecting the File->New
1. Start with a new document - selecting the File->New
menu item if necessary to do this.
menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the ARM CMA230 hardware.
 menu item, and then select the ARM CMA230 hardware.
While still displaying the
While still displaying the
Build
Build
->
->
Templates
Templates
 dialog box, select the "stubs" package template to build a GDB
 dialog box, select the "stubs" package template to build a GDB
stub image. Click
stub image. Click
OK.
OK.
Build eCos using
Build eCos using
Build
Build
->
->
Library
Library
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. The GDB stub
in the bin/ subdirectory of the install tree. The GDB stub
ROM images have the prefix "gdb_module".
ROM images have the prefix "gdb_module".
Building the GDB Stub ROMs with ecosconfig
Building the GDB Stub ROMs with ecosconfig
1. Make an empty directory to contain the build tree,
1. Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new cma230 stubs
$ ecosconfig new cma230 stubs
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. The GDB stub
in the bin/ subdirectory of the install tree. The GDB stub
ROM images have the prefix "gdb_module".
ROM images have the prefix "gdb_module".
<!-- <index></index> --><!-- <xref> -->Cirrus Logic ARM EP7211 Development</code></pre></td>
        <td class="diff"><pre><code><TITLE><!-- <index></index> --><!-- <xref> -->Cirrus Logic ARM EP7211 Development</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>Board Hardware Setup
Board Hardware Setup
eCos comes with two Flash ROM images that provide GDB support
eCos comes with two Flash ROM images that provide GDB support
for the Cirrus Logic EP7211 Development Board (also known as the
for the Cirrus Logic EP7211 Development Board (also known as the
EDB7211).. Note that on some board revisions, the board is silk-screened
EDB7211).. Note that on some board revisions, the board is silk-screened
as EDB7111-2. The first Flash ROM image provides a port of the CygMon
as EDB7111-2. The first Flash ROM image provides a port of the CygMon
ROM monitor, which includes a command-line interface and a GDB remote
ROM monitor, which includes a command-line interface and a GDB remote
stub. The second Flash ROM image provides a remote GDB stub only.
stub. The second Flash ROM image provides a remote GDB stub only.
Both ROM images are provided in the directory loaders/arm-edb7211
Both ROM images are provided in the directory loaders/arm-edb7211
under the root of your eCos installation. CygMon images are prefixed
under the root of your eCos installation. CygMon images are prefixed
with the name 'edb7211_cygmon' and are
with the name 'edb7211_cygmon' and are
provided in a number of formats including binary (.bin extension)
provided in a number of formats including binary (.bin extension)
and SREC (.srec) extension. GDB stub ROM images are given the prefix 'edb7211_gdb_module'. 
and SREC (.srec) extension. GDB stub ROM images are given the prefix 'edb7211_gdb_module'. 
The ROM images provided for the EP7211 Development Board must
The ROM images provided for the EP7211 Development Board must
be programmed into the FLASH. Please refer to the section titled
be programmed into the FLASH. Please refer to the section titled
"Loading the ROM image into On-Board flash" on how to program the
"Loading the ROM image into On-Board flash" on how to program the
ROM onto the board.
ROM onto the board.
Both Cygmon and GDB Stub ROMS allow communication with GDB
Both Cygmon and GDB Stub ROMS allow communication with GDB
via the serial connector labelled 'UART 1'. The
via the serial connector labelled 'UART 1'. The
communication parameters are fixed at 38400 baud, 8 data bits, no
communication parameters are fixed at 38400 baud, 8 data bits, no
parity bit and 1 stop bit (8-N-1). No flow control is employed.
parity bit and 1 stop bit (8-N-1). No flow control is employed.
Connection to the host computer should be made using a null modem cable.
Connection to the host computer should be made using a null modem cable.
A gender changer may also be required. Note that the GDB Configuration tool
A gender changer may also be required. Note that the GDB Configuration tool
uses the serial port identifiers 0 and 1 to identify the EB7211
uses the serial port identifiers 0 and 1 to identify the EB7211
serial ports UART1 and UART2 respectively.
serial ports UART1 and UART2 respectively.
Both eCos and the ROM images assume the core clock is generated
Both eCos and the ROM images assume the core clock is generated
with a 3.6864 MHz PLL input. The CPU will be configured to run at
with a 3.6864 MHz PLL input. The CPU will be configured to run at
73.728MHz.
73.728MHz.
Note: The EP7211 CPU needs a two step RESET process. After
Note: The EP7211 CPU needs a two step RESET process. After
pressing the `URESET' pushbutton, the `WAKEUP' pushbutton
pressing the `URESET' pushbutton, the `WAKEUP' pushbutton
must be pressed to complete the process.
must be pressed to complete the process.
When an eCos program is run on an EDB7211 board fitted with
When an eCos program is run on an EDB7211 board fitted with
either CygMon or a GDB stub ROM, then the code in ROM loses control.
either CygMon or a GDB stub ROM, then the code in ROM loses control.
This means that if you require the ability to remotely stop execution
This means that if you require the ability to remotely stop execution
on the target, or want thread debugging capabilities, you must include
on the target, or want thread debugging capabilities, you must include
GDB stub support when configuring eCos.
GDB stub support when configuring eCos.
Building programs for programming into FLASH
Building programs for programming into FLASH
If your application is to be run directly from FLASH, you
If your application is to be run directly from FLASH, you
must configure eCos appropriately for "ROM" startup. This can be
must configure eCos appropriately for "ROM" startup. This can be
done in the eCos Configuration Tool by setting
done in the eCos Configuration Tool by setting
the "Startup type" HAL option to "ROM". If using the ecosconfig utility,
the "Startup type" HAL option to "ROM". If using the ecosconfig utility,
set the user_value of the CYG_HAL_STARTUP
set the user_value of the CYG_HAL_STARTUP
option in ecos.ecc to "ROM".
option in ecos.ecc to "ROM".
When you have linked your application with eCos, you will
When you have linked your application with eCos, you will
then have an ELF executable. To convert this into a format appropriate
then have an ELF executable. To convert this into a format appropriate
for the Cirrus Logic FLASH download utility, or the dl_7xxx
for the Cirrus Logic FLASH download utility, or the dl_7xxx
utility on Linux, you can use the utility arm-elf-objcopy, as in
utility on Linux, you can use the utility arm-elf-objcopy, as in
the following example:
the following example:
$ arm-elf-objcopy -O binary helloworld.exe helloworld.bin
$ arm-elf-objcopy -O binary helloworld.exe helloworld.bin
This will produce a binary format image helloworld.bin which
This will produce a binary format image helloworld.bin which
can be downloaded into FLASH.
can be downloaded into FLASH.
Building the GDB Stub FLASH ROM images
Building the GDB Stub FLASH ROM images
Pre-built GDB stubs images are provided in the directory loaders/arm-edb7211 relative
Pre-built GDB stubs images are provided in the directory loaders/arm-edb7211 relative
to the root of your eCos installation, but here are instructions
to the root of your eCos installation, but here are instructions
on how to rebuild them if you should ever need to.
on how to rebuild them if you should ever need to.
CygMon images are prefixed with the name 'cygmon' and
CygMon images are prefixed with the name 'cygmon' and
GDB stub ROM images are given the prefix 'gdb_module'.
GDB stub ROM images are given the prefix 'gdb_module'.
Images may be provided in a number of formats including ELF (.img
Images may be provided in a number of formats including ELF (.img
extension), binary (.bin extension) and SREC (.srec extension). 
extension), binary (.bin extension) and SREC (.srec extension). 
Building the ROM images with the eCos Configuration Tool
Building the ROM images with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the "Cirrus Logic development board"
 menu item, and then select the "Cirrus Logic development board"
hardware.
hardware.
While still displaying the
While still displaying the
Build
Build
->
->
Templates
Templates
 dialog box, select either the "stubs" package template to build
 dialog box, select either the "stubs" package template to build
a GDB stub image, or the "cygmon" template to build the CygMon ROM
a GDB stub image, or the "cygmon" template to build the CygMon ROM
Monitor. Click
Monitor. Click
OK.
OK.
Build eCos using
Build eCos using
Build
Build
->
->
Library
Library
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix "gdb_module". CygMon images
ROM images have the prefix "gdb_module". CygMon images
have the prefix "cygmon".
have the prefix "cygmon".
Building the ROM images with ecosconfig
Building the ROM images with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new edb7xxx stubs
$ ecosconfig new edb7xxx stubs
or to build a CygMon ROM monitor image, enter the command:
or to build a CygMon ROM monitor image, enter the command:
$ ecosconfig new edb7xxx cygmon
$ ecosconfig new edb7xxx cygmon
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix "gdb_module". CygMon images
ROM images have the prefix "gdb_module". CygMon images
have the prefix "cygmon".
have the prefix "cygmon".
<!-- <xref> -->Loading the ROM Image into On-board Flash
<!-- <xref> -->Loading the ROM Image into On-board Flash
Program images can be written into Flash memory by means of
Program images can be written into Flash memory by means of
a bootstrap program which is built into the  EDB7211.  This program
a bootstrap program which is built into the  EDB7211.  This program
communicates with a support program on your host to download and
communicates with a support program on your host to download and
program an image into the Flash memory.
program an image into the Flash memory.
Cirrus Logic provides such a program for use with Windows/DOS.
Cirrus Logic provides such a program for use with Windows/DOS.
 eCos comes with a similar program which will run under Linux. The
 eCos comes with a similar program which will run under Linux. The
basic operation of both programs is the same.
basic operation of both programs is the same.
Connect a serial line to 'UART 1'.
Connect a serial line to 'UART 1'.
Power off the  EDB7211.
Power off the  EDB7211.
Install jumper 'PROGRAM ENABLE' which
Install jumper 'PROGRAM ENABLE' which
enables this special mode for downloading Flash images. Note that
enables this special mode for downloading Flash images. Note that
some board revisions have this jumper labelled “BOOT ENABLE”.
some board revisions have this jumper labelled “BOOT ENABLE”.
Power on the  EDB7211.
Power on the  EDB7211.
Execute the Flash writing program on your host.  On Linux,
Execute the Flash writing program on your host.  On Linux,
this would be:
this would be:
     # dl_edb7xxx <PATH>/gdb_module.bin
     # dl_edb7xxx <PATH>/gdb_module.bin
where '<PATH>' is the path to
where '<PATH>' is the path to
the binary format version of the ROM image you wish to load, either
the binary format version of the ROM image you wish to load, either
as built in the previous section or the "loaders/arm-edb7211/" subdirectory
as built in the previous section or the "loaders/arm-edb7211/" subdirectory
of your eCos installation. The download tool defaults to 38400 baud and
of your eCos installation. The download tool defaults to 38400 baud and
device /dev/ttyS1 for communication. To change
device /dev/ttyS1 for communication. To change
these, specify them as parameters, e.g.
these, specify them as parameters, e.g.
              
              
# dl_edb7xxx <PATH>/gdb_module.bin 9600 /dev/ttyS0
# dl_edb7xxx <PATH>/gdb_module.bin 9600 /dev/ttyS0
The download program will indicate that it is waiting
The download program will indicate that it is waiting
for the board to come alive.  At this point, press 'RESET' and
for the board to come alive.  At this point, press 'RESET' and
then 'WAKEUP' switches in order.  There should be
then 'WAKEUP' switches in order.  There should be
some indication of progress, first of the code being downloaded,
some indication of progress, first of the code being downloaded,
then of the programming process.
then of the programming process.
Upon completion of the programming, power off the  EDB7211.
Upon completion of the programming, power off the  EDB7211.
Remove the 'PROGRAM ENABLE/BOOT ENABLE' jumper.
Remove the 'PROGRAM ENABLE/BOOT ENABLE' jumper.
Power on the  EDB7211, press 'RESET' and 'WAKEUP'.
Power on the  EDB7211, press 'RESET' and 'WAKEUP'.
 The new ROM image should now be running on the board.
 The new ROM image should now be running on the board.
The GDB debugger will now be able to communicate with
The GDB debugger will now be able to communicate with
the board to download and debug RAM based programs.
the board to download and debug RAM based programs.
This procedure also applies for loading ROM-startup eCos programs
This procedure also applies for loading ROM-startup eCos programs
into the on-board FLASH memory, given a binary format image of the
into the on-board FLASH memory, given a binary format image of the
program from arm-elf-objcopy.  Loading a ROM-startup eCos program
program from arm-elf-objcopy.  Loading a ROM-startup eCos program
into Flash will overwrite the GDB Stub ROM/CygMon in Flash,
into Flash will overwrite the GDB Stub ROM/CygMon in Flash,
so you would have to reload the GDB Stub ROM/CygMon to
so you would have to reload the GDB Stub ROM/CygMon to
return to normal RAM-startup program development.
return to normal RAM-startup program development.
Building the Flash Downloader on Linux
Building the Flash Downloader on Linux
eCos provides a Flash download program suitable for use with
eCos provides a Flash download program suitable for use with
the  EP7211 Development Board which will run on Linux.  Follow these
the  EP7211 Development Board which will run on Linux.  Follow these
steps to build this program.  Note: at the time of the writing of
steps to build this program.  Note: at the time of the writing of
these instructions, the download program is built directly within
these instructions, the download program is built directly within
the eCos source repository since it is
the eCos source repository since it is
not configuration specific.
not configuration specific.
  # cd <eCos install dir>/packages/hal/arm/edb7xxx/&Version;/support
  # cd <eCos install dir>/packages/hal/arm/edb7xxx/&Version;/support
  # make
  # make
(where '# ' is your shell prompt)
(where '# ' is your shell prompt)
Note: this program was adapted from the Cirrus Logic original
Note: this program was adapted from the Cirrus Logic original
DOS program and still contains some vestiges of that environment.
DOS program and still contains some vestiges of that environment.
Developing eCos Programs with the ARM Multi-ICE
Developing eCos Programs with the ARM Multi-ICE
The EP7211 Development Board supports use of the ARM
The EP7211 Development Board supports use of the ARM
            Multi-processor EmbeddedICE(tm), also known as the
            Multi-processor EmbeddedICE(tm), also known as the
            Multi-ICE. Full instructions on how to install and use the
            Multi-ICE. Full instructions on how to install and use the
            Multi-ICE in conjunction with GDB are provided in the
            Multi-ICE in conjunction with GDB are provided in the
            "GNUPro Toolkit Reference for eCos
            "GNUPro Toolkit Reference for eCos
              ARM/Thumb" manual. However, the following
              ARM/Thumb" manual. However, the following
            platform-specific details should be noted.
            platform-specific details should be noted.
You will need an ARM Multi-ICE Server configuration
You will need an ARM Multi-ICE Server configuration
            file for the EP7211 Development Board. Here is a suggested
            file for the EP7211 Development Board. Here is a suggested
            configuration file to use:
            configuration file to use:
======== File "720T.cfg" ========
======== File "720T.cfg" ========
;Total IR length = 4
;Total IR length = 4
[TITLE]
[TITLE]
Multi-ICE configuration for EP7211
Multi-ICE configuration for EP7211
[TAP 0]
[TAP 0]
ARM720T
ARM720T
[TAPINFO]
[TAPINFO]
YES
YES
[Timing]
[Timing]
Low=0
Low=0
High=0
High=0
Adaptive=OFF
Adaptive=OFF
==================================
==================================
You must ensure that the board has the appropriate soldered
You must ensure that the board has the appropriate soldered
connections. For the EP7211 this involves connecting TEST0 and TEST1
connections. For the EP7211 this involves connecting TEST0 and TEST1
of the EP7211 to ground. To do this you must solder a wire from
of the EP7211 to ground. To do this you must solder a wire from
ground at JP33 to TP8 and TP9.
ground at JP33 to TP8 and TP9.
With respect to using multiple devices simultaneously, note
With respect to using multiple devices simultaneously, note
that the EP7211 is not ID sensitive.
that the EP7211 is not ID sensitive.
If you wish to view diagnostic output from your program that
If you wish to view diagnostic output from your program that
was downloaded via the Multi-ICE, you will note that by default
was downloaded via the Multi-ICE, you will note that by default
the output on the serial line (as viewed by a terminal such as Hyperterm
the output on the serial line (as viewed by a terminal such as Hyperterm
in Windows, or cu in Unix) is in the form of GDB packets.
in Windows, or cu in Unix) is in the form of GDB packets.
To get legible output, the solution is to set the "GDB Serial
To get legible output, the solution is to set the "GDB Serial
port" to a different device from the "Diagnostic serial port", and
port" to a different device from the "Diagnostic serial port", and
you should use the Diagnostic serial port to view the diagnostic
you should use the Diagnostic serial port to view the diagnostic
output.
output.
Warning: The multi-ice-gdb-server will fail on startup if
Warning: The multi-ice-gdb-server will fail on startup if
the board has not been both reset and awakened before running the
the board has not been both reset and awakened before running the
server. 
server. 
To resolve this, it is necessary to free up the connection
To resolve this, it is necessary to free up the connection
from within the ARM Multi-ICE server itself. However when this happens,
from within the ARM Multi-ICE server itself. However when this happens,
the next time you use GDB to load the program into the board, you
the next time you use GDB to load the program into the board, you
will see lots of "Readback did not match original data" messages
will see lots of "Readback did not match original data" messages
in the output of the multi-ice-gdb-server program. This indicates
in the output of the multi-ice-gdb-server program. This indicates
your program did not load correctly, and you should restart the
your program did not load correctly, and you should restart the
multi-ice-gdb-server program, taking care to reset the board correctly
multi-ice-gdb-server program, taking care to reset the board correctly
before reconnecting. 
before reconnecting. 
As a reminder, you must specify --config-dialog to the
As a reminder, you must specify --config-dialog to the
            multi-ice-gdb-server program to connect to the board
            multi-ice-gdb-server program to connect to the board
            correctly. If you do not, the multi-ice-gdb-server program
            correctly. If you do not, the multi-ice-gdb-server program
            will not be able to connect.
            will not be able to connect.
<!-- <conditionaltext> -->Cirrus Logic ARM EP7212 Development Board</code></pre></td>
        <td class="diff"><pre><code><TITLE><!-- <conditionaltext> -->Cirrus Logic ARM EP7212 Development Board</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>Hardware Setup
Hardware Setup
The Cirrus Logic EP7212 Development Board is almost identical
The Cirrus Logic EP7212 Development Board is almost identical
to the EP7211 Development Board from a hardware setup viewpoint,
to the EP7211 Development Board from a hardware setup viewpoint,
and is based on the same port of eCos. Therefore the earlier documentation
and is based on the same port of eCos. Therefore the earlier documentation
for the EP7211 Development Board can be considered equivalent, but
for the EP7211 Development Board can be considered equivalent, but
with the following changes:
with the following changes:
The first serial port is silk screened as "UART 1" on
The first serial port is silk screened as "UART 1" on
the EP7211 Development Board, but is silk screened as "Serial Port
the EP7211 Development Board, but is silk screened as "Serial Port
0" on the EP7212 Development Board. Similarly "UART 2" is silk screened
0" on the EP7212 Development Board. Similarly "UART 2" is silk screened
as "Serial Port 1" on the EP7212 Development Board.
as "Serial Port 1" on the EP7212 Development Board.
JP2 (used to control reprogramming of the FLASH) is not
JP2 (used to control reprogramming of the FLASH) is not
silkscreened with "Boot Enable".
silkscreened with "Boot Enable".
To setup the EP7212 Development Board for use with the
To setup the EP7212 Development Board for use with the
ARM Multi-ICE JTAG debugging interface unit, it is necessary to
ARM Multi-ICE JTAG debugging interface unit, it is necessary to
connect TEST0 and TEST1 of the EP7212 to ground.  On the Development
connect TEST0 and TEST1 of the EP7212 to ground.  On the Development
Board, this is accomplished by placing shorting blocks on JP47 and
Board, this is accomplished by placing shorting blocks on JP47 and
JP48. When the shorting blocks are fitted, the board can only be
JP48. When the shorting blocks are fitted, the board can only be
operated through the Multi-ICE - debugging over a serial line is
operated through the Multi-ICE - debugging over a serial line is
not possible.
not possible.
Pre-built GDB stubs are
Pre-built GDB stubs are
              provided in the directory
              provided in the directory
              loaders/arm-edb7212 relative to the
              loaders/arm-edb7212 relative to the
              root of your eCos installation
              root of your eCos installation
When rebuilding the GDB stub ROM image, change the "Cirrus
When rebuilding the GDB stub ROM image, change the "Cirrus
Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
from the EP7211 to the EP7212. This can be selected in the
from the EP7211 to the EP7212. This can be selected in the
eCos Configuration Tool
eCos Configuration Tool
, or if using ecosconfig, can be set by uncommenting the user_value
, or if using ecosconfig, can be set by uncommenting the user_value
property of this option in ecos.ecc and setting it to "EP7212".
property of this option in ecos.ecc and setting it to "EP7212".
<!-- <conditionaltext> -->Cirrus Logic ARM EP7312 Development Board</code></pre></td>
        <td class="diff"><pre><code><TITLE><!-- <conditionaltext> -->Cirrus Logic ARM EP7312 Development Board</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>Hardware Setup
Hardware Setup
The Cirrus Logic EP7312 Development Board is similar
The Cirrus Logic EP7312 Development Board is similar
to the EP7212 Development Board from a hardware setup viewpoint,
to the EP7212 Development Board from a hardware setup viewpoint,
and is based on the same port of eCos.
and is based on the same port of eCos.
When rebuilding the RedBoot ROM image or an eCos application,
When rebuilding the RedBoot ROM image or an eCos application,
change the "Cirrus Logic processor variant" option
change the "Cirrus Logic processor variant" option
(CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
(CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
from the EP7211 to the EP7312. This can be selected in the
from the EP7211 to the EP7312. This can be selected in the
eCos Configuration Tool
eCos Configuration Tool
, or if using ecosconfig, can be set by uncommenting the user_value
, or if using ecosconfig, can be set by uncommenting the user_value
property of this option in ecos.ecc and setting it to "EP7312".
property of this option in ecos.ecc and setting it to "EP7312".
See the RedBoot documentation for building and installing RedBoot for this
See the RedBoot documentation for building and installing RedBoot for this
target.  Only RedBoot is supported as a boot image; ROMRAM startup is
target.  Only RedBoot is supported as a boot image; ROMRAM startup is
recommended.
recommended.
90MHz Operation
90MHz Operation
The EP7xxx targets offer a choice of clock speeds, from 18MHz to a maximum,
The EP7xxx targets offer a choice of clock speeds, from 18MHz to a maximum,
normally, of 72MHz.  These are described as kHz values 18432 36864 49152
normally, of 72MHz.  These are described as kHz values 18432 36864 49152
and 73728 within the configuration tool.  If you have a release which
and 73728 within the configuration tool.  If you have a release which
supports it, you will also see 90317 as an available option here, for 90MHz
supports it, you will also see 90317 as an available option here, for 90MHz
operation.
operation.
This option only applies to certain EP7312 hardware, not all EP7312 boards
This option only applies to certain EP7312 hardware, not all EP7312 boards
support it.  Do not select 90MHz when building RedBoot or your eCos
support it.  Do not select 90MHz when building RedBoot or your eCos
application unless you are absolutely sure that your board supports it.
application unless you are absolutely sure that your board supports it.
If you do have a 90MHz board and wish to execute at 90MHz, it is in fact
If you do have a 90MHz board and wish to execute at 90MHz, it is in fact
not necessary to build RedBoot specially, if you build your eCos
not necessary to build RedBoot specially, if you build your eCos
application configured for 90MHz.  RedBoot will run at 72MHz and your
application configured for 90MHz.  RedBoot will run at 72MHz and your
application will run at 90MHz.  If you do install a 90MHz RedBoot, then you
application will run at 90MHz.  If you do install a 90MHz RedBoot, then you
must build eCos for 90MHz or timing and baud rates on serial I/O will be
must build eCos for 90MHz or timing and baud rates on serial I/O will be
wrong.
wrong.
In other words, code (either eCos app or RedBoot) built for 90MHz will
In other words, code (either eCos app or RedBoot) built for 90MHz will
“change up a gear” when it starts up; but code built for 72MHz,
“change up a gear” when it starts up; but code built for 72MHz,
because it needs to run correctly on boards without the
because it needs to run correctly on boards without the
“gearbox” does not change back down, so if you mix the two,
“gearbox” does not change back down, so if you mix the two,
unexpected timing can result.  To run a non-eCos application without any
unexpected timing can result.  To run a non-eCos application without any
hardware initialization code at 90MHz, you must install a specially-built
hardware initialization code at 90MHz, you must install a specially-built
RedBoot.
RedBoot.
Cirrus Logic ARM EP7209 Development Board Hardware Setup
Cirrus Logic ARM EP7209 Development Board Hardware Setup
Note: At time of writing, no EP7209 Development Board is available,
Note: At time of writing, no EP7209 Development Board is available,
and consequently eCos has not been verified for use with the EP7209
and consequently eCos has not been verified for use with the EP7209
Development Board.
Development Board.
The Cirrus Logic EP7209 Development Board is almost identical
The Cirrus Logic EP7209 Development Board is almost identical
to the EP7212 Board in all respects, except that it is not fitted
to the EP7212 Board in all respects, except that it is not fitted
with DRAM, nor has it a DRAM controller.
with DRAM, nor has it a DRAM controller.
The only valid configuration for the EDB7209 is ROM based.
The only valid configuration for the EDB7209 is ROM based.
The STUBS and RAM startup modes are not available as no DRAM is
The STUBS and RAM startup modes are not available as no DRAM is
fitted.
fitted.
<!-- <index></index> -->Cirrus Logic ARM CL-PS7111 Evaluation Board Hardware Setup
<!-- <index></index> -->Cirrus Logic ARM CL-PS7111 Evaluation Board Hardware Setup
The implementation of the port of eCos to the Cirrus Logic
The implementation of the port of eCos to the Cirrus Logic
ARM CL-PS7111 Evaluation Board (also known as EB7111) is based on
ARM CL-PS7111 Evaluation Board (also known as EB7111) is based on
the EP7211 Development Board port.
the EP7211 Development Board port.
For that reason, the setup required is identical to the  EP7211
For that reason, the setup required is identical to the  EP7211
Development Board as described above, with the following exceptions:
Development Board as described above, with the following exceptions:
The Cygmon ROM monitor is not supported
The Cygmon ROM monitor is not supported
The ARM Multi-ICE is not supported
The ARM Multi-ICE is not supported
Pre-built GDB stubs are provided in the
Pre-built GDB stubs are provided in the
directory loaders/arm-eb7111 relative to the root of your
directory loaders/arm-eb7111 relative to the root of your
eCos installation
eCos installation
If rebuilding the GDB stub ROM image, change the "Cirrus
If rebuilding the GDB stub ROM image, change the "Cirrus
Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)
from the EP7211 to the CL_PS7111. This can be selected
from the EP7211 to the CL_PS7111. This can be selected
in the
in the
eCos Configuration Tool
eCos Configuration Tool
, or if using ecosconfig, can be set by uncommenting the user_value
, or if using ecosconfig, can be set by uncommenting the user_value
property of this option in ecos.ecc and setting it to "CL_PS7111"
property of this option in ecos.ecc and setting it to "CL_PS7111"
All remote serial communication is done with the serial I/O
All remote serial communication is done with the serial I/O
connector
connector
/misc
/misc
% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0
% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0
Power off the board, and change it to boot the GDB stubs in
Power off the board, and change it to boot the GDB stubs in
big-endian mode by setting the switches like this:
big-endian mode by setting the switches like this:
SW1: 00000000 (all levers down)
SW1: 00000000 (all levers down)
SW2: 10001010
SW2: 10001010
The GDB stubs allow communication with GDB using the serial
The GDB stubs allow communication with GDB using the serial
port at connector PJ7A (lower connector). The communication parameters
port at connector PJ7A (lower connector). The communication parameters
are  fixed at 38400 baud, 8 data bits, no parity bit and 1 stop
are  fixed at 38400 baud, 8 data bits, no parity bit and 1 stop
bit  (8-N-1). No flow control is employed. Connection to the host
bit  (8-N-1). No flow control is employed. Connection to the host
computer should be made using a straight through serial cable.
computer should be made using a straight through serial cable.
StrongARM EBSA-285 Hardware Setup
StrongARM EBSA-285 Hardware Setup
The eCos Developer’s Kit package comes with a ROM
The eCos Developer’s Kit package comes with a ROM
image which provides GDB support for
image which provides GDB support for
the Intel® StrongARM® Evaluation Board EBSA-285.
the Intel® StrongARM® Evaluation Board EBSA-285.
 Both eCos and the Stub ROM image assume the clocks are: 3.6864
 Both eCos and the Stub ROM image assume the clocks are: 3.6864
MHz PLL input for generating the core clock, and 50MHz osc input
MHz PLL input for generating the core clock, and 50MHz osc input
for external clocks. An image of this ROM is also provided at loaders/arm-ebsa285/gdbload.bin under
for external clocks. An image of this ROM is also provided at loaders/arm-ebsa285/gdbload.bin under
the root of your eCos installation.
the root of your eCos installation.
The ROM monitor image (an eCos GDB
The ROM monitor image (an eCos GDB
stub) provided for the EBSA-285 board must be programmed into the
stub) provided for the EBSA-285 board must be programmed into the
flash, replacing the Angel monitor on the board. Please refer to
flash, replacing the Angel monitor on the board. Please refer to
the section titled "Loading the ROM Image into On-Board flash" on how
the section titled "Loading the ROM Image into On-Board flash" on how
to program the ROM onto the board.
to program the ROM onto the board.
The Stub ROM allows communication with GDB via the serial
The Stub ROM allows communication with GDB via the serial
connector on the bulkhead mounting bracket COM0.  The communication
connector on the bulkhead mounting bracket COM0.  The communication
parameters are fixed at 38400 baud, 8 data bits, no parity bit and
parameters are fixed at 38400 baud, 8 data bits, no parity bit and
1 stop bit (8-N-1).  No flow control is employed.
1 stop bit (8-N-1).  No flow control is employed.
Building the GDB Stub FLASH ROM images
Building the GDB Stub FLASH ROM images
Pre-built GDB stubs images are provided in the directory loaders/arm-ebsa285 relative
Pre-built GDB stubs images are provided in the directory loaders/arm-ebsa285 relative
to the root of your eCos installation, but here are instructions
to the root of your eCos installation, but here are instructions
on how to rebuild them if you should ever need to.
on how to rebuild them if you should ever need to.
Building the GDB Stubs with the eCos Configuration Tool
Building the GDB Stubs with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File
File
->
->
New
New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build
Build
->
->
Templates
Templates
 menu item, and then select the StrongARM EBSA285 hardware.
 menu item, and then select the StrongARM EBSA285 hardware.
While still displaying the
While still displaying the
Build
Build
->
->
Templates
Templates
 dialog box, select the "stubs" package template to build a GDB
 dialog box, select the "stubs" package template to build a GDB
stub image. Click
stub image. Click
OK.
OK.
Build eCos using
Build eCos using
Build
Build
->
->
Library
Library
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. The GDB stub
in the bin/ subdirectory of the install tree. The GDB stub
ROM images have the prefix "gdb_module".
ROM images have the prefix "gdb_module".
Building the GDB Stub ROMs with ecosconfig
Building the GDB Stub ROMs with ecosconfig
(See “Using ecosconfig on UNIX” on page 72)
(See “Using ecosconfig on UNIX” on page 72)
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new ebsa285 stubs
$ ecosconfig new ebsa285 stubs
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. The GDB stub
in the bin/ subdirectory of the install tree. The GDB stub
ROM images have the prefix "gdb_module".
ROM images have the prefix "gdb_module".
Loading the ROM Image into On-board Flash
Loading the ROM Image into On-board Flash
There are several ways to install the eCos gdb stub ROM image
There are several ways to install the eCos gdb stub ROM image
in the EBSA board’s flash memory. Once installed, the gdb
in the EBSA board’s flash memory. Once installed, the gdb
stub ROM provides standard eCos download and debug via the EBSA
stub ROM provides standard eCos download and debug via the EBSA
board"s serial port. The options available include the
board"s serial port. The options available include the
Linux based EBSA flash upgrade utility provided by Red Hat, direct writing
Linux based EBSA flash upgrade utility provided by Red Hat, direct writing
of the flash via MultiICE (JTAG) hardware debugger, and other flash management
of the flash via MultiICE (JTAG) hardware debugger, and other flash management
utilities from Intel (these only support DOS, and proprietary ARM tools
utilities from Intel (these only support DOS, and proprietary ARM tools
and image formats). Only the Red Hat flash upgrade tool is supported
and image formats). Only the Red Hat flash upgrade tool is supported
and tested in this release.
and tested in this release.
The flash upgrade tool requires the EBSA board to be configured
The flash upgrade tool requires the EBSA board to be configured
as a PCI slave (rather than a master, its normal operating mode)
as a PCI slave (rather than a master, its normal operating mode)
and plugged into a Linux host computer"s PCI bus.
and plugged into a Linux host computer"s PCI bus.
Configuring the board for flash loading: Follow the instructions
Configuring the board for flash loading: Follow the instructions
in the EBSA-285 Reference Manual, pages A-2 and A-3 to configure
in the EBSA-285 Reference Manual, pages A-2 and A-3 to configure
the board as an add-in card, and enable flash blank programming.
the board as an add-in card, and enable flash blank programming.
 Briefly: assuming the board was in the default setting to execute
 Briefly: assuming the board was in the default setting to execute
as a bus master ("Host Bridge") make jumper 9 (J9), move jumper
as a bus master ("Host Bridge") make jumper 9 (J9), move jumper
10 (J10) to external reset (PCI_RST), and move jumper 15
10 (J10) to external reset (PCI_RST), and move jumper 15
(J15) link 4-6-5 to connect 5-6 instead of 4-6.
(J15) link 4-6-5 to connect 5-6 instead of 4-6.
Configuring the board for execution of eCos programs: Follow
Configuring the board for execution of eCos programs: Follow
the instructions in the EBSA-285 Reference Manual, pages A-2 and
the instructions in the EBSA-285 Reference Manual, pages A-2 and
A-3 to configure the board as a "Host Bridge" with "Central Function".
A-3 to configure the board as a "Host Bridge" with "Central Function".
 Briefly: unset J9, move J10 to on-board reset (BRD_RST),
 Briefly: unset J9, move J10 to on-board reset (BRD_RST),
and set J15 to make 4-6 instead of 5-6 (see page A-8 also).  Plug
and set J15 to make 4-6 instead of 5-6 (see page A-8 also).  Plug
the card into its own PCI bus, not the Linux PC used for the flash-programming
the card into its own PCI bus, not the Linux PC used for the flash-programming
process.
process.
Building the Linux software: the Linux software sources are
Building the Linux software: the Linux software sources are
in directory
in directory
      <BASE_DIR>/packages/hal/arm/ebsa285/v1_3/support/linux/safl_util
      <BASE_DIR>/packages/hal/arm/ebsa285/v1_3/support/linux/safl_util
in the eCos source repository.  There are two parts to the
in the eCos source repository.  There are two parts to the
system: a loadable kernel module and the flash utility.  The loadable
system: a loadable kernel module and the flash utility.  The loadable
kernel module is safl.o and the utility is sa_flash.  To
kernel module is safl.o and the utility is sa_flash.  To
build:
build:
  cd to this directory, or a copy of it.
  cd to this directory, or a copy of it.
  make
  make
This builds safl.o and sa_flash. The kernel module
This builds safl.o and sa_flash. The kernel module
must be installed, and a device file created for it. Both of these
must be installed, and a device file created for it. Both of these
operations require root permissions.  Create the device file by: 
operations require root permissions.  Create the device file by: 
      % mknod /dev/safl c 10 178
      % mknod /dev/safl c 10 178
Programming the flash: switch off the EBSA-285, and remove
Programming the flash: switch off the EBSA-285, and remove
the EBSA-285 board from its PCI bus.  Take appropriate anti-static
the EBSA-285 board from its PCI bus.  Take appropriate anti-static
precautions. Configure it for flash loading as above, halt your
precautions. Configure it for flash loading as above, halt your
Linux system and turn it off.  Install the EBSA-285 board in the
Linux system and turn it off.  Install the EBSA-285 board in the
PCI bus of the Linux system and boot it up. (Single user is good enough,
PCI bus of the Linux system and boot it up. (Single user is good enough,
assuming your image and safl_util build dir are on a local
assuming your image and safl_util build dir are on a local
disc partition.)  Change directory to the safl_util directory,
disc partition.)  Change directory to the safl_util directory,
then, to load the kernel module and flash an image onto the eval
then, to load the kernel module and flash an image onto the eval
board (as root): 
board (as root): 
       % insmod safl.o
       % insmod safl.o
       % sa_flash <image_file>
       % sa_flash <image_file>
Halt and turn off the Linux machine and remove the EBSA-285
Halt and turn off the Linux machine and remove the EBSA-285
card.  Take appropriate anti-static precautions.  Configure it for
card.  Take appropriate anti-static precautions.  Configure it for
execution of eCos programs as above, and plug it into its own PCI
execution of eCos programs as above, and plug it into its own PCI
bus.  Restart the Linux machine however you wish.
bus.  Restart the Linux machine however you wish.
This information is replicated in the README file within the
This information is replicated in the README file within the
safl_util directory and its parents, and in the EBSA-285
safl_util directory and its parents, and in the EBSA-285
Reference Manual from Intel, appendix A "Configuration Guide".
Reference Manual from Intel, appendix A "Configuration Guide".
If in doubt, please refer to those documents also.
If in doubt, please refer to those documents also.
This procedure also applies for loading ROM-startup eCos programs
This procedure also applies for loading ROM-startup eCos programs
into the on-board flash memory, given a binary format image of the
into the on-board flash memory, given a binary format image of the
program from arm-elf-objcopy.  Loading a ROM-startup eCos program
program from arm-elf-objcopy.  Loading a ROM-startup eCos program
into flash will overwrite the StubROM in flash, so you would have
into flash will overwrite the StubROM in flash, so you would have
to reload the StubROM to return to normal RAM-startup program development.
to reload the StubROM to return to normal RAM-startup program development.
Running your eCos Program Using GDB and the StubROM
Running your eCos Program Using GDB and the StubROM
You must first load the StubROM image into the flash memory
You must first load the StubROM image into the flash memory
on the EBSA-285 board before doing this.  See “Loading
on the EBSA-285 board before doing this.  See “Loading
the ROM Image into On-board Flash”, page 93 for details.
the ROM Image into On-board Flash”, page 93 for details.
Connect to the StubROM in the board and run your eCos program <PROGRAM> as
Connect to the StubROM in the board and run your eCos program <PROGRAM> as
follows:
follows:
      $ arm-elf-gdb -nw <PROGRAM>
      $ arm-elf-gdb -nw <PROGRAM>
      (gdb) set remotebaud 38400
      (gdb) set remotebaud 38400
      (gdb) target remote <DEVICE>
      (gdb) target remote <DEVICE>
Where <DEVICE> is /dev/ttyS0
Where <DEVICE> is /dev/ttyS0
or COM1: or similar, depending on your environment and how you connected
or COM1: or similar, depending on your environment and how you connected
your serial line to the host computer. Expect some output here,
your serial line to the host computer. Expect some output here,
for example:
for example:
      Remote debugging using /dev/ttyS0
      Remote debugging using /dev/ttyS0
      0x410026a4 in ?? ()
      0x410026a4 in ?? ()
then, to load the program
then, to load the program
        (gdb) load
        (gdb) load
    
    
which will report locations and sizes of sections as they
which will report locations and sizes of sections as they
load, then begin execution using
load, then begin execution using
      (gdb) continue
      (gdb) continue
If you have no eCos program yet, but you want to connect to
If you have no eCos program yet, but you want to connect to
the board just to verify serial communications, tell gdb "set endian
the board just to verify serial communications, tell gdb "set endian
little" before anything else, so that it understands the board (GDB
little" before anything else, so that it understands the board (GDB
normally infers this from information within the eCos program).
normally infers this from information within the eCos program).
When an eCos program is run on the EBSA-285 board, the GDB
When an eCos program is run on the EBSA-285 board, the GDB
stub in ROM loses control. This means that if you require the ability
stub in ROM loses control. This means that if you require the ability
to stop execution on the target remotely, or want thread debugging
to stop execution on the target remotely, or want thread debugging
capabilities, you must include GDB stub support when configuring
capabilities, you must include GDB stub support when configuring
eCos.
eCos.
<!-- <conditionaltext> --> <!-- NOTE: could not find it --><!-- <index></index> -->Compaq iPAQ PocketPC Hardware Setup
<!-- <conditionaltext> --> <!-- NOTE: could not find it --><!-- <index></index> -->Compaq iPAQ PocketPC Hardware Setup
For setting up the iPAQ to run with RedBoot, see the the RedBoot
For setting up the iPAQ to run with RedBoot, see the the RedBoot
User's Guide. Connections may be made using
User's Guide. Connections may be made using
the Compact Flash Ethernet interface.  A serial cable may be connected
the Compact Flash Ethernet interface.  A serial cable may be connected
directly, or via the cradle. Serial communication uses the parameters
directly, or via the cradle. Serial communication uses the parameters
38400,8,N,1. The LCD/Touchscreen may also be used as an
38400,8,N,1. The LCD/Touchscreen may also be used as an
interface to RedBoot and eCos applications.
interface to RedBoot and eCos applications.
SH3/EDK7708 Hardware Setup
SH3/EDK7708 Hardware Setup
The eCos Developer’s Kit package comes with a ROM
The eCos Developer’s Kit package comes with a ROM
which provides GDB support for the Hitachi EDK7708 board (a big-endian
which provides GDB support for the Hitachi EDK7708 board (a big-endian
and a little-endian version). Images of these  ROMs are also provided
and a little-endian version). Images of these  ROMs are also provided
at loaders/sh-edk7708/gdbload.bin and
at loaders/sh-edk7708/gdbload.bin and
          loaders/sh-edk7708le/gdbload.bin under
          loaders/sh-edk7708le/gdbload.bin under
the root of your eCos installation.
the root of your eCos installation.
The ROM is installed to socket U6 on the board. When using
The ROM is installed to socket U6 on the board. When using
the big-endian ROM, jumper 9 must be set to 2-3. When using the
the big-endian ROM, jumper 9 must be set to 2-3. When using the
little-endian ROM, jumper 9 must be set to 1-2. Attention should
little-endian ROM, jumper 9 must be set to 1-2. Attention should
be paid to the correct orientation of the ROM during installation.
be paid to the correct orientation of the ROM during installation.
Only replace the board"s existing ROM using a proper PLCC extraction
Only replace the board"s existing ROM using a proper PLCC extraction
tool, as the socket would otherwise risk being damaged. 
tool, as the socket would otherwise risk being damaged. 
If you are going to program a new ROM or FLASH using the binary
If you are going to program a new ROM or FLASH using the binary
image, you may have to experiment to get the right byte-order in
image, you may have to experiment to get the right byte-order in
the device. Depending on the programming software you use, it might
the device. Depending on the programming software you use, it might
be necessary to enable byte-swapping.  If the GDB stub ROM/FLASH
be necessary to enable byte-swapping.  If the GDB stub ROM/FLASH
you program does not work, try reversing the byte-order.
you program does not work, try reversing the byte-order.
The GDB stub in the EPROM allows communication with GDB using
The GDB stub in the EPROM allows communication with GDB using
the serial port at connector J1. The communication parameters are
the serial port at connector J1. The communication parameters are
fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1).
fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1).
No flow control is employed. Connection to the host computer should
No flow control is employed. Connection to the host computer should
be made using the dedicated serial cable included in the EDK package. 
be made using the dedicated serial cable included in the EDK package. 
Installing the Stubs into FLASH
Installing the Stubs into FLASH
Preparing the Binaries
Preparing the Binaries
These two binary preparation steps are not strictly necessary
These two binary preparation steps are not strictly necessary
as the eCos distribution ships with pre-compiled binaries in the
as the eCos distribution ships with pre-compiled binaries in the
directory loaders/sh-edk7708 and loaders/sh-edk7708le
directory loaders/sh-edk7708 and loaders/sh-edk7708le
relative to the installation root.
relative to the installation root.
Building the ROM images with the eCos Configuration Tool
Building the ROM images with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the SH EDK7708 hardware.
 menu item, and then select the SH EDK7708 hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the “stubs” package template
 dialog box, select the “stubs” package template
to build a GDB stub. Click
to build a GDB stub. Click
OK.
OK.
If building a little-endian image, disable the “Use
If building a little-endian image, disable the “Use
big-endian mode” option in the SH EDK7708 HAL (CYGHWR_HAL_SH_BIGENDIAN).
big-endian mode” option in the SH EDK7708 HAL (CYGHWR_HAL_SH_BIGENDIAN).
Build eCos using
Build eCos using
Build->Library. 
Build->Library. 
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix “gdb_module”.
ROM images have the prefix “gdb_module”.
Building the ROM images with ecosconfig
Building the ROM images with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new edk7708 stubs
$ ecosconfig new edk7708 stubs
 
 
If building a little-endian image, uncomment the user
If building a little-endian image, uncomment the user
value in ecos.ecc for CYGHWR_HAL_SH_BIGENDIAN
value in ecos.ecc for CYGHWR_HAL_SH_BIGENDIAN
and change it to 0.   
and change it to 0.   
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make 
$ make 
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the  prefix “gdb_module”.
ROM images have the  prefix “gdb_module”.
 Installing the Stubs into ROM or FLASH
 Installing the Stubs into ROM or FLASH
Program the binary image file gdb_module.bin
Program the binary image file gdb_module.bin
into ROM or FLASH referring to the instructions of your ROM programmer.
into ROM or FLASH referring to the instructions of your ROM programmer.
Plug the ROM/FLASH into socket U6. If the image
Plug the ROM/FLASH into socket U6. If the image
is little-endian set jumper 9 to 1-2. If the image is big-endian
is little-endian set jumper 9 to 1-2. If the image is big-endian
set jumper 9 to 2-3.
set jumper 9 to 2-3.
SH3/CQ7708 Hardware Setup
SH3/CQ7708 Hardware Setup
Preparing the board
Preparing the board
Make sure the DIP switches on the board are set as follows:
Make sure the DIP switches on the board are set as follows:
  
  
SW1-1 ON
SW1-1 ON
SW1-2 OFF
SW1-2 OFF
SW1-3 ON
SW1-3 ON
SW1-4 OFF
SW1-4 OFF
SW2-1 ON
SW2-1 ON
SW2-2 ON
SW2-2 ON
SW2-3 OFF
SW2-3 OFF
SW2-4 OFF
SW2-4 OFF
If you are using a straight through serial cable which has
If you are using a straight through serial cable which has
flow control lines, you will also need to cut JP12 (5-6) as the
flow control lines, you will also need to cut JP12 (5-6) as the
flow control lines can cause NMIs.
flow control lines can cause NMIs.
eCos GDB Stubs
eCos GDB Stubs
The eCos installation CD contains a copy of the eCos GDB stubs
The eCos installation CD contains a copy of the eCos GDB stubs
in  binary format which must be programmed into an EPROM or FLASH
in  binary format which must be programmed into an EPROM or FLASH
and  installed on the board.
and  installed on the board.
 Preparing the GDB stubs
 Preparing the GDB stubs
These stub preparation steps are not strictly necessary as
These stub preparation steps are not strictly necessary as
the eCos distribution ships with pre-compiled stubs in the directory
the eCos distribution ships with pre-compiled stubs in the directory
loaders/sh3-cq7708 relative to the installation root.
loaders/sh3-cq7708 relative to the installation root.
Building the GDB stub image with the eCos Configuration Tool
Building the GDB stub image with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the SH3 cq7708 hardware.
 menu item, and then select the SH3 cq7708 hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the stubs package template to build a GDB stub.
 dialog box, select the stubs package template to build a GDB stub.
Click
Click
OK.
OK.
 Build eCos stubs using
 Build eCos stubs using
Build->Library.
Build->Library.
 When the build completes, the image files can be found
 When the build completes, the image files can be found
in the
in the
bin/
bin/
 subdirectory of the install tree. GDB stub images have the prefix
 subdirectory of the install tree. GDB stub images have the prefix
gdb_module.
gdb_module.
 Building the GDB stub image with ecosconfig
 Building the GDB stub image with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
 To build a GDB stub ROM image, enter the command:
 To build a GDB stub ROM image, enter the command:
$ ecosconfig new cq7708 stubs 
$ ecosconfig new cq7708 stubs 
 Enter the commands:
 Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the
in the
bin/
bin/
 subdirectory of the install tree. GDB stub images have the prefix
 subdirectory of the install tree. GDB stub images have the prefix
gdb_module.  
gdb_module.  
Programming the stubs in EPROM/FLASH
Programming the stubs in EPROM/FLASH
The board can use different sizes of ROMs. Use this table
The board can use different sizes of ROMs. Use this table
to adjust the board’s jumpers to the ROM sizes you are
to adjust the board’s jumpers to the ROM sizes you are
using.
using.
size(kbit)    JP7   JP9   JP10   JP11
size(kbit)    JP7   JP9   JP10   JP11
256           2-3   2-3   open   open
256           2-3   2-3   open   open
512           1-2   2-3   open   open
512           1-2   2-3   open   open
1000          1-2   open  open   2-3
1000          1-2   open  open   2-3
2000          1-2   1-2   open   2-3
2000          1-2   1-2   open   2-3
4000          1-2   1-2   short  2-3
4000          1-2   1-2   short  2-3
8000          1-2   1-2   short  1-2
8000          1-2   1-2   short  1-2
There are two ways to program the stubs. We advise you to
There are two ways to program the stubs. We advise you to
use method 1, since it is simpler. Method 2 is unsupported and requires
use method 1, since it is simpler. Method 2 is unsupported and requires
a bit of fiddling.
a bit of fiddling.
Method 1:  
Method 1:  
Program the binary stub image into two EPROMs, E and O. EPROM
Program the binary stub image into two EPROMs, E and O. EPROM
E should  contain the even bytes, and O the odd bytes (your EPROM
E should  contain the even bytes, and O the odd bytes (your EPROM
programmer should  have the ability to split the image).
programmer should  have the ability to split the image).
EPROM E should be installed in socket IC8, and EPROM O should
EPROM E should be installed in socket IC8, and EPROM O should
be  installed in socket IC4.
be  installed in socket IC4.
Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut)  Set SW1-4
Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut)  Set SW1-4
to ON and SW2-1 to OFF.
to ON and SW2-1 to OFF.
Method2:  
Method2:  
Assuming that the stub binary is smaller than 32 KB, you can
Assuming that the stub binary is smaller than 32 KB, you can
install it in a single EPROM.
install it in a single EPROM.
Compile the mkcqrom.c program
Compile the mkcqrom.c program
found in the misc directory.
found in the misc directory.
Use it to convert the binary image to the required format.
Use it to convert the binary image to the required format.
See the  mkcqrom.c source for a
See the  mkcqrom.c source for a
description of what is done, and why it is  necessary. 
description of what is done, and why it is  necessary. 
 % mkcqrom gdb_module.bin gdb_mangled.bin
 % mkcqrom gdb_module.bin gdb_mangled.bin
Program the gdb_mangled.bin file
Program the gdb_mangled.bin file
into an EPROM and install it in  socket IC4
into an EPROM and install it in  socket IC4
Set JP6 to 8 bit mode (cut 1-2, solder 2-3)
Set JP6 to 8 bit mode (cut 1-2, solder 2-3)
The GDB stubs allow communication with GDB using the serial
The GDB stubs allow communication with GDB using the serial
port at connector CN7. The communication parameters are fixed at
port at connector CN7. The communication parameters are fixed at
38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No
38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No
flow control is employed. Connection to the host computer should
flow control is employed. Connection to the host computer should
be made using a  straight through serial cable.
be made using a  straight through serial cable.
SH3/HS7729PCI Hardware Setup
SH3/HS7729PCI Hardware Setup
Please see the RedBoot manual for instructions on how to prepare
Please see the RedBoot manual for instructions on how to prepare
the board for use with eCos.
the board for use with eCos.
SH3/SE77x9 Hardware Setup
SH3/SE77x9 Hardware Setup
Please see the RedBoot manual for instructions on how to prepare
Please see the RedBoot manual for instructions on how to prepare
the board for use with eCos.
the board for use with eCos.
SH4/CQ7750 Hardware Setup
SH4/CQ7750 Hardware Setup
Preparing the board
Preparing the board
Make sure the DIP switches on the board are set as follows:
Make sure the DIP switches on the board are set as follows:
  
  
SW1-1 ON
SW1-1 ON
SW1-2 OFF
SW1-2 OFF
SW1-3 ON
SW1-3 ON
SW1-4 OFF
SW1-4 OFF
SW2-1 ON
SW2-1 ON
SW2-2 ON
SW2-2 ON
SW2-3 OFF
SW2-3 OFF
SW2-4 OFF
SW2-4 OFF
If you are using a straight through serial cable which has
If you are using a straight through serial cable which has
flow control lines, you will also need to cut JP12 (5-6) as the
flow control lines, you will also need to cut JP12 (5-6) as the
flow control lines can cause NMIs.
flow control lines can cause NMIs.
eCos GDB Stubs
eCos GDB Stubs
The eCos installation CD contains a copy of the eCos GDB stubs
The eCos installation CD contains a copy of the eCos GDB stubs
in  binary format which must be programmed into an EPROM or FLASH
in  binary format which must be programmed into an EPROM or FLASH
and  installed on the board.
and  installed on the board.
 Preparing the GDB stubs
 Preparing the GDB stubs
These stub preparation steps are not strictly necessary as
These stub preparation steps are not strictly necessary as
the eCos distribution ships with pre-compiled stubs in the directory
the eCos distribution ships with pre-compiled stubs in the directory
loaders/sh3-cq7708 relative to the installation root.
loaders/sh3-cq7708 relative to the installation root.
Building the GDB stub image with the eCos Configuration Tool
Building the GDB stub image with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the SH3 cq7708 hardware.
 menu item, and then select the SH3 cq7708 hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the stubs package template to build a GDB stub.
 dialog box, select the stubs package template to build a GDB stub.
Click
Click
OK.
OK.
 Build eCos stubs using
 Build eCos stubs using
Build->Library.
Build->Library.
 When the build completes, the image files can be found
 When the build completes, the image files can be found
in the
in the
bin/
bin/
 subdirectory of the install tree. GDB stub images have the prefix
 subdirectory of the install tree. GDB stub images have the prefix
gdb_module.
gdb_module.
 Building the GDB stub image with ecosconfig
 Building the GDB stub image with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it.
and cd into it.
 To build a GDB stub ROM image, enter the command:
 To build a GDB stub ROM image, enter the command:
$ ecosconfig new cq7708 stubs 
$ ecosconfig new cq7708 stubs 
 Enter the commands:
 Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
When the build completes, the image files can be found
When the build completes, the image files can be found
in the
in the
bin/
bin/
 subdirectory of the install tree. GDB stub images have the prefix
 subdirectory of the install tree. GDB stub images have the prefix
gdb_module.  
gdb_module.  
Programming the stubs in EPROM/FLASH
Programming the stubs in EPROM/FLASH
The board can use different sizes of ROMs. Use this table
The board can use different sizes of ROMs. Use this table
to adjust the board’s jumpers to the ROM sizes you are
to adjust the board’s jumpers to the ROM sizes you are
using.
using.
size(kbit)    JP7   JP9   JP10   JP11
size(kbit)    JP7   JP9   JP10   JP11
256           2-3   2-3   open   open
256           2-3   2-3   open   open
512           1-2   2-3   open   open
512           1-2   2-3   open   open
1000          1-2   open  open   2-3
1000          1-2   open  open   2-3
2000          1-2   1-2   open   2-3
2000          1-2   1-2   open   2-3
4000          1-2   1-2   short  2-3
4000          1-2   1-2   short  2-3
8000          1-2   1-2   short  1-2
8000          1-2   1-2   short  1-2
There are two ways to program the stubs. We advise you to
There are two ways to program the stubs. We advise you to
use method 1, since it is simpler. Method 2 is unsupported and requires
use method 1, since it is simpler. Method 2 is unsupported and requires
a bit of fiddling.
a bit of fiddling.
Method 1:  
Method 1:  
Program the binary stub image into two EPROMs, E and O. EPROM
Program the binary stub image into two EPROMs, E and O. EPROM
E should  contain the even bytes, and O the odd bytes (your EPROM
E should  contain the even bytes, and O the odd bytes (your EPROM
programmer should  have the ability to split the image).
programmer should  have the ability to split the image).
EPROM E should be installed in socket IC8, and EPROM O should
EPROM E should be installed in socket IC8, and EPROM O should
be  installed in socket IC4.
be  installed in socket IC4.
Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut)  Set SW1-4
Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut)  Set SW1-4
to ON and SW2-1 to OFF.
to ON and SW2-1 to OFF.
Method2:  
Method2:  
Assuming that the stub binary is smaller than 32 KB, you can
Assuming that the stub binary is smaller than 32 KB, you can
install it in a single EPROM.
install it in a single EPROM.
Compile the mkcqrom.c program
Compile the mkcqrom.c program
found in the misc directory.
found in the misc directory.
Use it to convert the binary image to the required format.
Use it to convert the binary image to the required format.
See the  mkcqrom.c source for a
See the  mkcqrom.c source for a
description of what is done, and why it is  necessary. 
description of what is done, and why it is  necessary. 
 % mkcqrom gdb_module.bin gdb_mangled.bin
 % mkcqrom gdb_module.bin gdb_mangled.bin
Program the gdb_mangled.bin file
Program the gdb_mangled.bin file
into an EPROM and install it in  socket IC4
into an EPROM and install it in  socket IC4
Set JP6 to 8 bit mode (cut 1-2, solder 2-3)
Set JP6 to 8 bit mode (cut 1-2, solder 2-3)
The GDB stubs allow communication with GDB using the serial
The GDB stubs allow communication with GDB using the serial
port at connector CN7. The communication parameters are fixed at
port at connector CN7. The communication parameters are fixed at
38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No
38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No
flow control is employed. Connection to the host computer should
flow control is employed. Connection to the host computer should
be made using a  straight through serial cable.
be made using a  straight through serial cable.
SH4/SE7751 Hardware Setup
SH4/SE7751 Hardware Setup
Please see the RedBoot manual for instructions on how to prepare
Please see the RedBoot manual for instructions on how to prepare
the board for use with eCos.
the board for use with eCos.
NEC CEB-V850/SA1 Hardware Setup
NEC CEB-V850/SA1 Hardware Setup
The CEB-V850 board is fitted with a socketed EPROM. The internal
The CEB-V850 board is fitted with a socketed EPROM. The internal
Flash of the V850 supplied with the CEB-V850 boards defaults to
Flash of the V850 supplied with the CEB-V850 boards defaults to
vectoring into this EPROM. A  GDB stub image should be programmed
vectoring into this EPROM. A  GDB stub image should be programmed
into an EPROM fitted to this board, and a pre-built image is provided
into an EPROM fitted to this board, and a pre-built image is provided
at loaders/v850-ceb_v850/v850sa1/gdb_module.bin under
at loaders/v850-ceb_v850/v850sa1/gdb_module.bin under
the root of your eCos installation.
the root of your eCos installation.
The EPROM is installed to the socket labelled U7 on the board.
The EPROM is installed to the socket labelled U7 on the board.
Attention should be paid to the correct orientation of the EPROM
Attention should be paid to the correct orientation of the EPROM
during installation. 
during installation. 
When programming an EPROM using the binary image, be careful
When programming an EPROM using the binary image, be careful
to get the byte order correct. It needs to be little-endian. If
to get the byte order correct. It needs to be little-endian. If
the EPROM burner software has a hex-editor, check that the first
the EPROM burner software has a hex-editor, check that the first
few bytes of the image look similar to: 
few bytes of the image look similar to: 
00000000: 0018 8007 5e02 0000 0000 0000 0000 0000
00000000: 0018 8007 5e02 0000 0000 0000 0000 0000
If the byte order is wrong you will see 1800 instead of 0018
If the byte order is wrong you will see 1800 instead of 0018
etc. Use the EPROM burner software to make a byte-swap before you
etc. Use the EPROM burner software to make a byte-swap before you
burn to image to the EPROM. 
burn to image to the EPROM. 
If the GDB stub EPROM you burn does not work, try reversing
If the GDB stub EPROM you burn does not work, try reversing
the byte-order, even if you think you have it the right way around.
the byte-order, even if you think you have it the right way around.
At least one DOS-based EPROM burner program is known to have the
At least one DOS-based EPROM burner program is known to have the
byte-order upside down.
byte-order upside down.
The GDB stub in the EPROM allows communication with GDB using
The GDB stub in the EPROM allows communication with GDB using
the serial port. The communication parameters are fixed at 38400
the serial port. The communication parameters are fixed at 38400
baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No flow
baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No flow
control is employed. Connection to the host computer should be made
control is employed. Connection to the host computer should be made
using a dedicated serial cable as specified in the CEB-V850/SA1
using a dedicated serial cable as specified in the CEB-V850/SA1
manual.
manual.
Installing the Stubs into ROM
Installing the Stubs into ROM
Preparing the Binaries
Preparing the Binaries
These two binary preparation steps are not strictly necessary
These two binary preparation steps are not strictly necessary
as the eCos distribution ships with pre-compiled binaries in the
as the eCos distribution ships with pre-compiled binaries in the
directory loaders/v850-ceb_v850 relative to the
directory loaders/v850-ceb_v850 relative to the
installation root.
installation root.
Building the ROM images with the eCos Configuration Tool
Building the ROM images with the eCos Configuration Tool
Start with a new document - selecting the
Start with a new document - selecting the
File->New
File->New
 menu item if necessary to do this.
 menu item if necessary to do this.
Choose the
Choose the
Build->Templates
Build->Templates
 menu item, and then select the NEC CEB-V850/SA1 hardware.
 menu item, and then select the NEC CEB-V850/SA1 hardware.
While still displaying the
While still displaying the
Build->Templates
Build->Templates
 dialog box, select the “stubs” package template
 dialog box, select the “stubs” package template
to build a GDB stub. Click
to build a GDB stub. Click
OK.
OK.
Build eCos using
Build eCos using
Build->Library. 
Build->Library. 
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the  prefix “gdb_module”.
ROM images have the  prefix “gdb_module”.
Building the ROM images with ecosconfig
Building the ROM images with ecosconfig
Make an empty directory to contain the build tree,
Make an empty directory to contain the build tree,
and cd into it. 
and cd into it. 
To build a GDB stub ROM image, enter the command:
To build a GDB stub ROM image, enter the command:
$ ecosconfig new ceb-v850 stubs 
$ ecosconfig new ceb-v850 stubs 
Enter the commands:
Enter the commands:
$ ecosconfig tree
$ ecosconfig tree
$ make
$ make
 
 
When the build completes, the image files can be found
When the build completes, the image files can be found
in the bin/ subdirectory of the install tree. GDB stub
in the bin/ subdirectory of the install tree. GDB stub
ROM images have the prefix “gdb_module”.
ROM images have the prefix “gdb_module”.
 Installing the Stubs into ROM or FLASH
 Installing the Stubs into ROM or FLASH
 Program the binary image file gdb_module.bin
 Program the binary image file gdb_module.bin
into ROM or FLASH referring to the instructions of your ROM
into ROM or FLASH referring to the instructions of your ROM
                  programmer. 
                  programmer. 
 Plug the ROM/FLASH into the socket as described
 Plug the ROM/FLASH into the socket as described
at the beginning of this section.
at the beginning of this section.
Debugging with the NEC V850 I.C.E.
Debugging with the NEC V850 I.C.E.
eCos applications may be debugged using the NEC V850 In Circuit
eCos applications may be debugged using the NEC V850 In Circuit
Emulator (I.C.E.) A PC running Microsoft Windows is required in
Emulator (I.C.E.) A PC running Microsoft Windows is required in
order to run the NEC ICE software and drivers. In addition Red Hat
order to run the NEC ICE software and drivers. In addition Red Hat
have developed a “libremote” server application
have developed a “libremote” server application
named v850ice.exe which is used on the PC connected to the I.C.E.
named v850ice.exe which is used on the PC connected to the I.C.E.
in order to allow connections from GDB.
in order to allow connections from GDB.
The I.C.E. must be physically connected to a Windows NT system
The I.C.E. must be physically connected to a Windows NT system
through NEC"s PCI or PC Card interface.  A driver, DLLs,
through NEC"s PCI or PC Card interface.  A driver, DLLs,
and application are provided by NEC to control the I.C.E.
and application are provided by NEC to control the I.C.E.
v850ice is a Cygwin based server that runs on the NT system
v850ice is a Cygwin based server that runs on the NT system
and provides an interface between the gdb client and the I.C.E.
and provides an interface between the gdb client and the I.C.E.
software. v850-elf-gdb may be run on the Windows NT system or on
software. v850-elf-gdb may be run on the Windows NT system or on
a remote system. v850-elf-gdb communicates with the libremote server
a remote system. v850-elf-gdb communicates with the libremote server
using the gdb remote protocol over a TCP/IP socket.  v850ice
using the gdb remote protocol over a TCP/IP socket.  v850ice
communicates with the I.C.E. by calling functions in the NECMSG.DLL provided
communicates with the I.C.E. by calling functions in the NECMSG.DLL provided
by NEC.
by NEC.
INITIAL SETUP
INITIAL SETUP
Configure the hardware including the I.C.E., SA1 or
Configure the hardware including the I.C.E., SA1 or
SB1 Option Module, and target board.  Install the interface card
SB1 Option Module, and target board.  Install the interface card
in the Windows NT system. Reference NEC"s documentation
in the Windows NT system. Reference NEC"s documentation
for interface installation, jumper settings, etc.
for interface installation, jumper settings, etc.
Install the Windows NT device driver provided by NEC.
Install the Windows NT device driver provided by NEC.
Copy the NEC DLLs, MDI application, and other support
Copy the NEC DLLs, MDI application, and other support
files to a directory on the Windows NT system. The standard location
files to a directory on the Windows NT system. The standard location
is C:\NecTools32. This directory will be referred to as
is C:\NecTools32. This directory will be referred to as
the "libremote server directory" in this document. v850ice.exe must
the "libremote server directory" in this document. v850ice.exe must
also be copied to this directory after being built. The required
also be copied to this directory after being built. The required
files are:  cpu.cfg, Nec.cfg, MDI.EXE, NECMSG.DLL, EX85032.DLL,
files are:  cpu.cfg, Nec.cfg, MDI.EXE, NECMSG.DLL, EX85032.DLL,
V850E.DLL, IE850.MON, IE850E.MON, and D3037A.800.
V850E.DLL, IE850.MON, IE850E.MON, and D3037A.800.
Make certain the file cpu.cfg contains the line:
Make certain the file cpu.cfg contains the line:
CpuOption=SA1
CpuOption=SA1
if using a V850/SA1 module, or:
if using a V850/SA1 module, or:
CpuOption=SB1
CpuOption=SB1
if using a V850/SB1 module.
if using a V850/SB1 module.
Set the environment variable IEPATH to point to the libremote
Set the environment variable IEPATH to point to the libremote
server
server
directory.
directory.
BUILD PROCEDURES
BUILD PROCEDURES
A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directory
A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directory
relative to the root of the eCos installation. However the following process
relative to the root of the eCos installation. However the following process
will allow the rebuilding of this executable if required:
will allow the rebuilding of this executable if required:
For this example assume the v850ice libremote tree has been
For this example assume the v850ice libremote tree has been
copied to a directory named "server".  The directory structure will
copied to a directory named "server".  The directory structure will
be similar to the following diagram:
be similar to the following diagram:
                server
                server
                   |
                   |
                 devo
                 devo
                 /  \
                 /  \
           config    libremote
           config    libremote
                      /     \
                      /     \
                   lib       v850ice
                   lib       v850ice
Build the v850ice source as follows.  Be sure to use the native
Build the v850ice source as follows.  Be sure to use the native
Cygwin compiler tools that were supplied alongside eCos.
Cygwin compiler tools that were supplied alongside eCos.
cd server
cd server
mkdir build
mkdir build
cd build
cd build
../devo/configure --target=v850-elf --host=i686-pc-cygwin
../devo/configure --target=v850-elf --host=i686-pc-cygwin
make
make
The resultant libremote server image (v850ice.exe) can be
The resultant libremote server image (v850ice.exe) can be
found in build/libremote/v850ice.  Copy v850ice.exe
found in build/libremote/v850ice.  Copy v850ice.exe
to the lib remote server directory.
to the lib remote server directory.
V850ICE.EXE EXECUTION
V850ICE.EXE EXECUTION
The v850ice command line syntax is:
The v850ice command line syntax is:
v850ice [-d] [-t addr] [port number]
v850ice [-d] [-t addr] [port number]
The optional -d option enables debug output.  The -t option
The optional -d option enables debug output.  The -t option
is associated with thread debugging - see the "eCos thread debugging"
is associated with thread debugging - see the "eCos thread debugging"
section below for details. By default v850ice listens on port 2345
section below for details. By default v850ice listens on port 2345
for an attach request from a gdb client.  A different port number
for an attach request from a gdb client.  A different port number
may be specified on the command line.
may be specified on the command line.
To run the libremote server:
To run the libremote server:
Power on the I.C.E. and target board.
Power on the I.C.E. and target board.
Open a Cygwin window.
Open a Cygwin window.
Run v850ice.
Run v850ice.
You will see the MDI interface window appear.  In this
You will see the MDI interface window appear.  In this
window you should see the "Connected to In-Circuit Emulator" message.
window you should see the "Connected to In-Circuit Emulator" message.
 In the Cygwin window, the libremote server will indicate it is
 In the Cygwin window, the libremote server will indicate it is
ready to accept a gdb client connection with the message "v850ice:
ready to accept a gdb client connection with the message "v850ice:
 listening on port 2345."
 listening on port 2345."
V850-ELF-GDB EXECUTION
V850-ELF-GDB EXECUTION
Run the v850-elf-gdb client to debug the V850 target.  It
Run the v850-elf-gdb client to debug the V850 target.  It
is necessary to issue certain configuration commands to the I.C.E.
is necessary to issue certain configuration commands to the I.C.E.
software.  These commands may be issued directly in the MDI window
software.  These commands may be issued directly in the MDI window
or they may be issued from the gdb client through the "monitor"
or they may be issued from the gdb client through the "monitor"
command.
command.
On the Cosmo CEB-V850 board, on-chip Flash is mapped at address
On the Cosmo CEB-V850 board, on-chip Flash is mapped at address
0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000.
0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000.
Since a stand alone V850 will start executing from address 0x0 on
Since a stand alone V850 will start executing from address 0x0 on
reset, it is normal to load either an application or a bootstrap
reset, it is normal to load either an application or a bootstrap
loader for Flash at this address. eCos programs may be built to
loader for Flash at this address. eCos programs may be built to
boot from Flash or the on-board EPROM. If building for the on-board
boot from Flash or the on-board EPROM. If building for the on-board
EPROM, it would be expected that the Flash will contain the default
EPROM, it would be expected that the Flash will contain the default
CEB-V850 flash contents. An ELF format version of the default contents
CEB-V850 flash contents. An ELF format version of the default contents
may be found in the eCos distribution with the name v850flash.img.
may be found in the eCos distribution with the name v850flash.img.
In stand alone operation, normally the code in this flash image
In stand alone operation, normally the code in this flash image
would have been programmed into the V850 on the Cosmo board, and
would have been programmed into the V850 on the Cosmo board, and
this would cause it to vector into the on-board EPROM to run the
this would cause it to vector into the on-board EPROM to run the
application located there. In the case of eCos, this application
application located there. In the case of eCos, this application
may be a GDB stub ROM application, allowing the further download
may be a GDB stub ROM application, allowing the further download
to RAM over serial of actual applications to debug.
to RAM over serial of actual applications to debug.
As an example, we shall demonstrate how to use the I.C.E.
As an example, we shall demonstrate how to use the I.C.E.
to download the v850flash.img and GDB stub EPROM image using I.C.E.
to download the v850flash.img and GDB stub EPROM image using I.C.E.
emulator memory only, and not requiring any actual programming of
emulator memory only, and not requiring any actual programming of
devices.
devices.
v850-elf-gdb -nw
v850-elf-gdb -nw
(gdb) file v850flash.img
(gdb) file v850flash.img
(gdb) target remote localhost:2345
(gdb) target remote localhost:2345
(gdb) monitor reset
(gdb) monitor reset
(gdb) monitor cpu r=256 a=16
(gdb) monitor cpu r=256 a=16
(gdb) monitor map r=0x100000-L 0x80000
(gdb) monitor map r=0x100000-L 0x80000
(gdb) monitor map u=0xfc0000-L 0x40000
(gdb) monitor map u=0xfc0000-L 0x40000
(gdb) monitor pinmask k
(gdb) monitor pinmask k
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) load
(gdb) load
(gdb) detach
(gdb) detach
(gdb) file gdb_module.img
(gdb) file gdb_module.img
(gdb) target remote localhost:2345
(gdb) target remote localhost:2345
(gdb) load
(gdb) load
(gdb) continue
(gdb) continue
NOTE: The four "monitor step" commands are only required the
NOTE: The four "monitor step" commands are only required the
first time the board is connected to the I.C.E., otherwise the program
first time the board is connected to the I.C.E., otherwise the program
will fail.
will fail.
This is because of a limitation of the I.C.E. hardware that
This is because of a limitation of the I.C.E. hardware that
means that the first time it is used, the "map" commands are not
means that the first time it is used, the "map" commands are not
acted on and the addresses "0x100000" and "0xfc0000" are not mapped.
acted on and the addresses "0x100000" and "0xfc0000" are not mapped.
This can be observed using the command "td e-20" in the MDI application"s
This can be observed using the command "td e-20" in the MDI application"s
console to display the trace buffer, which will show that the contents
console to display the trace buffer, which will show that the contents
of address 0x100000 are not valid. Subsequent runs do not require
of address 0x100000 are not valid. Subsequent runs do not require
the "monitor step" commands.
the "monitor step" commands.
It is unusual to load two executable images to a target through
It is unusual to load two executable images to a target through
gdb.  From the example above notice that this is accomplished by
gdb.  From the example above notice that this is accomplished by
attaching to the libremote server, loading the flash image, detaching,
attaching to the libremote server, loading the flash image, detaching,
reattaching, and loading the ROM/RAM image. It is more
reattaching, and loading the ROM/RAM image. It is more
normal to build an executable image that can be executed directly.
normal to build an executable image that can be executed directly.
In eCos this is achieved by selecting either the ROM or ROMRAM startup
In eCos this is achieved by selecting either the ROM or ROMRAM startup
type, and optionally enable building for the internal FLASH. The
type, and optionally enable building for the internal FLASH. The
I.C.E. emulator memory can emulate both the internal FLASH and the
I.C.E. emulator memory can emulate both the internal FLASH and the
EPROM, so real hardware programming is not required.
EPROM, so real hardware programming is not required.
Upon running this example you will notice that the libremote
Upon running this example you will notice that the libremote
server does not exit upon detecting a detach request, but simply
server does not exit upon detecting a detach request, but simply
begins listening for the next attach request.  To cause v850ice
begins listening for the next attach request.  To cause v850ice
to terminate, issue the "monitor quit" or "monitor exit" command
to terminate, issue the "monitor quit" or "monitor exit" command
from the gdb client.  v850ice will then terminate with the next
from the gdb client.  v850ice will then terminate with the next
detach request.  (You can also enter control-c in the Cygwin/DOS
detach request.  (You can also enter control-c in the Cygwin/DOS
window where v850ice is running.)
window where v850ice is running.)
MDI INTERFACE VS. GDB INTERFACE
MDI INTERFACE VS. GDB INTERFACE
If a filename is referenced in an MDI command, whether the
If a filename is referenced in an MDI command, whether the
command is entered in the MDI window or issued from the gdb client
command is entered in the MDI window or issued from the gdb client
with the monitor command, the file must reside on the Windows NT
with the monitor command, the file must reside on the Windows NT
libremote server system.  When specifying a filename when entering
libremote server system.  When specifying a filename when entering
a command in the MDI window it is obvious that a server local file
a command in the MDI window it is obvious that a server local file
is being referenced.  When issuing an MDI command from the gdb client, the
is being referenced.  When issuing an MDI command from the gdb client, the
user must remember that the command line is simply passed to the
user must remember that the command line is simply passed to the
I.C.E. software on the server system.  The command is executed by
I.C.E. software on the server system.  The command is executed by
the I.C.E. software as though it were entered locally.
the I.C.E. software as though it were entered locally.
Executable images may be loaded into the V850 target by entering
Executable images may be loaded into the V850 target by entering
the "load" command in the MDI window or with the gdb "load" command.
the "load" command in the MDI window or with the gdb "load" command.
 If the MDI load command is used, the executable image must be located
 If the MDI load command is used, the executable image must be located
on the server system and must be in S Record format.  If the gdb
on the server system and must be in S Record format.  If the gdb
load command is used, the executable image must be located on the
load command is used, the executable image must be located on the
client system and must be in ELF format.
client system and must be in ELF format.
Be aware that the gdb client is not aware of debugger commands
Be aware that the gdb client is not aware of debugger commands
issued from the MDI window.  It is possible to cause the gdb client
issued from the MDI window.  It is possible to cause the gdb client
and the I.C.E. software to get out of sync by issuing commands from
and the I.C.E. software to get out of sync by issuing commands from
both interfaces during the same debugging session.
both interfaces during the same debugging session.
eCos THREAD DEBUGGING
eCos THREAD DEBUGGING
eCos and the V850 I.C.E. libremote server have been written
eCos and the V850 I.C.E. libremote server have been written
to work together to allow debugging of eCos threads. This is an
to work together to allow debugging of eCos threads. This is an
optional feature, disabled by default because of the overheads trying
optional feature, disabled by default because of the overheads trying
to detect a threaded program involves.
to detect a threaded program involves.
Obviously thread debugging is not possible for programs with
Obviously thread debugging is not possible for programs with
"RAM" startup type, as they are expected to operate underneath a
"RAM" startup type, as they are expected to operate underneath a
separate ROM monitor (such as a GDB stub ROM), that itself would
separate ROM monitor (such as a GDB stub ROM), that itself would
provide its own thread debugging capabilities over the serial line.
provide its own thread debugging capabilities over the serial line.
Thread debugging is relevant only for programs built for Flash, ROM,
Thread debugging is relevant only for programs built for Flash, ROM,
or ROMRAM startup.
or ROMRAM startup.
To configure the libremote server to support thread debugging,
To configure the libremote server to support thread debugging,
use the command:
use the command:
(gdb) monitor syscallinfo ADDRESS
(gdb) monitor syscallinfo ADDRESS
at the GDB console prompt, where ADDRESS is the address of
at the GDB console prompt, where ADDRESS is the address of
the syscall information structure included in the applications.
the syscall information structure included in the applications.
In eCos this has been designed to be located at a consistent address
In eCos this has been designed to be located at a consistent address
for each CPU model (V850/SA1 or V850/SB1). It
for each CPU model (V850/SA1 or V850/SB1). It
may be determined from an eCos executable using the following command
may be determined from an eCos executable using the following command
at a cygwin bash prompt:
at a cygwin bash prompt:
v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info
v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info
At the current time, this address is 0xfc0400 for a Cosmo
At the current time, this address is 0xfc0400 for a Cosmo
board fitted with a V850/SA1, or 0xfc0540 for a Cosmo board
board fitted with a V850/SA1, or 0xfc0540 for a Cosmo board
fitted with a V850/SB1.
fitted with a V850/SB1.
So for example, the GDB command for the SB1 would be:
So for example, the GDB command for the SB1 would be:
(gdb) monitor syscallinfo 0xfc0540
(gdb) monitor syscallinfo 0xfc0540
Given that the syscallinfo address is fixed over all eCos
Given that the syscallinfo address is fixed over all eCos
executables for a given target, it is possible to define it on the
executables for a given target, it is possible to define it on the
libremote command line as well using the "-t" option, for example:
libremote command line as well using the "-t" option, for example:
bash$ v850ice -t 0xfc0400
bash$ v850ice -t 0xfc0400
v850ice: listening on port 2345
v850ice: listening on port 2345
NEC CEB-V850/SB1 Hardware Setup
NEC CEB-V850/SB1 Hardware Setup
The instructions for setting up the CEB-V850/SB1
The instructions for setting up the CEB-V850/SB1
are virtually identical to those of the CEB-V850/SA1 above.
are virtually identical to those of the CEB-V850/SA1 above.
The only significant differences are that pre-built loaders are available
The only significant differences are that pre-built loaders are available
at loaders/v850-ceb_v850/v850sb1 within
at loaders/v850-ceb_v850/v850sb1 within
the eCos installation. Binaries supporting boards with both 16MHz
the eCos installation. Binaries supporting boards with both 16MHz
and 8MHz clock speeds are supplied. Also when building applications,
and 8MHz clock speeds are supplied. Also when building applications,
or rebuilding the stubs for a V850/SB1 target, then the
or rebuilding the stubs for a V850/SB1 target, then the
V850 CPU variant must be changed in the CEB-V850 HAL to the SB1.
V850 CPU variant must be changed in the CEB-V850 HAL to the SB1.
i386 PC Hardware Setup
i386 PC Hardware Setup
eCos application on the PC can be run in three ways: via RedBoot,
eCos application on the PC can be run in three ways: via RedBoot,
loaded directly from a floppy disk, or loaded by the GRUB bootloader.
loaded directly from a floppy disk, or loaded by the GRUB bootloader.
RedBoot Support
RedBoot Support
For information about setting up the PC to run with RedBoot,
For information about setting up the PC to run with RedBoot,
consult the RedBoot User"s Guide. If using serial debugging,
consult the RedBoot User"s Guide. If using serial debugging,
the serial line runs at 38400 baud 8-N-1 and should be connected
the serial line runs at 38400 baud 8-N-1 and should be connected
to the debug host using a null modem cable. If ethernet debugging
to the debug host using a null modem cable. If ethernet debugging
is required, an i82559 compatible network interface card, such as
is required, an i82559 compatible network interface card, such as
an Intel EtherExpress Pro 10/100,  should be installed
an Intel EtherExpress Pro 10/100,  should be installed
on the target PC and connected to the development PC running GDB.
on the target PC and connected to the development PC running GDB.
When RedBoot is configured appropriately to have an IP address set,
When RedBoot is configured appropriately to have an IP address set,
then GDB will be able to debug directly over TCP/IP to the
then GDB will be able to debug directly over TCP/IP to the
target PC.
target PC.
Floppy Disk Support
Floppy Disk Support
If an application is built with a startup type of FLOPPY, then it is
If an application is built with a startup type of FLOPPY, then it is
configured to be a self-booting image that must be written onto a
configured to be a self-booting image that must be written onto a
formatted floppy disk. This will erase any existing file system or
formatted floppy disk. This will erase any existing file system or
data that is already on the disk, so proceed
data that is already on the disk, so proceed
with caution.
with caution.
To write an application to floppy disk, it must first be converted to
To write an application to floppy disk, it must first be converted to
a pure binary format. This is done with the following command:
a pure binary format. This is done with the following command:
$ i386-elf-objcopy -O binary app.elf app.bin
$ i386-elf-objcopy -O binary app.elf app.bin
Here app.elf is the final linked application
Here app.elf is the final linked application
executable, in ELF format (it may not have a .elf
executable, in ELF format (it may not have a .elf
extension). The file app.bin is the resulting
extension). The file app.bin is the resulting
pure binary file. This must be written to the floppy disk with the
pure binary file. This must be written to the floppy disk with the
following command:
following command:
$ dd conv=sync if=app.bin of=/dev/fd0
$ dd conv=sync if=app.bin of=/dev/fd0
For NT Cygwin users, this can be done by first ensuring that the raw
For NT Cygwin users, this can be done by first ensuring that the raw
floppy device is mounted as /dev/fd0. To check if this
floppy device is mounted as /dev/fd0. To check if this
is the case, type the command mount at the Cygwin bash
is the case, type the command mount at the Cygwin bash
prompt. If the floppy drive is already mounted, it will be listed as something
prompt. If the floppy drive is already mounted, it will be listed as something
similar to the following line:
similar to the following line:
  \\.\a: /dev/fd0 user binmode
  \\.\a: /dev/fd0 user binmode
If this line is not listed, then mount the floppy drive using the command:
If this line is not listed, then mount the floppy drive using the command:
$ mount -f -b //./a: /dev/fd0
$ mount -f -b //./a: /dev/fd0
To actually install the boot image on the floppy, use the command:
To actually install the boot image on the floppy, use the command:
$ dd conv=sync if=app.bin of=/dev/fd0
$ dd conv=sync if=app.bin of=/dev/fd0
Insert this floppy in the A: drive of the PC to be used as a target
Insert this floppy in the A: drive of the PC to be used as a target
and ensure that the BIOS is configured to boot from A: by default. On reset,
and ensure that the BIOS is configured to boot from A: by default. On reset,
the PC will boot from the floppy and the eCos application will load
the PC will boot from the floppy and the eCos application will load
itself and execute immediately.
itself and execute immediately.
NOTE
NOTE
Unreliable floppy media may cause the write to silently fail. This
Unreliable floppy media may cause the write to silently fail. This
can be determined if the RedBoot image does not correctly
can be determined if the RedBoot image does not correctly
boot. In such cases, the floppy should be (unconditionally) reformatted
boot. In such cases, the floppy should be (unconditionally) reformatted
using the fdformat command on Linux, or
using the fdformat command on Linux, or
format a: /u on DOS/Windows. If this fails, try a
format a: /u on DOS/Windows. If this fails, try a
different disk.
different disk.
GRUB Bootloader Support
GRUB Bootloader Support
If an application is built with the GRUB startup type, it is
If an application is built with the GRUB startup type, it is
configured to be loaded by the GRUB bootloader.
configured to be loaded by the GRUB bootloader.
GRUB is an open source boot loader that supports many different
GRUB is an open source boot loader that supports many different
operating systems. It is available from
operating systems. It is available from
url="http://www.gnu.org/software/grub">http://www.gnu.org/software/grub.
url="http://www.gnu.org/software/grub">http://www.gnu.org/software/grub.
The latest version of GRUB should be downloaded from there and installed.
The latest version of GRUB should be downloaded from there and installed.
In Red Hat Linux version 7.2 and later it is the default bootloader
In Red Hat Linux version 7.2 and later it is the default bootloader
for Linux and therefore is already installed.
for Linux and therefore is already installed.
To install GRUB on a floppy disk from Linux you need to execute the
To install GRUB on a floppy disk from Linux you need to execute the
following commands:
following commands:
$ mformat a:
$ mformat a:
$ mount /mnt/floppy
$ mount /mnt/floppy
$ grub-install --root-directory=/mnt/floppy '(fd0)'
$ grub-install --root-directory=/mnt/floppy '(fd0)'
Probing devices to guess BIOS drives. This may take a long time.
Probing devices to guess BIOS drives. This may take a long time.
Installation finished. No error reported.
Installation finished. No error reported.
This is the contents of the device map /mnt/floppy/boot/grub/device.map.
This is the contents of the device map /mnt/floppy/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
fix it and re-run the script `grub-install'.
(fd0)   /dev/fd0
(fd0)   /dev/fd0
$ cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub
$ cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub
$ umount /mnt/floppy
$ umount /mnt/floppy
The file menu.lst is an example GRUB menu
The file menu.lst is an example GRUB menu
configuration file. It contains menu items to load some of the
configuration file. It contains menu items to load some of the
standard eCos tests from floppy or from partition zero of the first
standard eCos tests from floppy or from partition zero of the first
hard disk. You should, of course, customize this file to load your own
hard disk. You should, of course, customize this file to load your own
application. Alternatively you can use the command-line interface of
application. Alternatively you can use the command-line interface of
GRUB to input commands yourself.
GRUB to input commands yourself.
Applications can be installed, or updated simply by copying them to
Applications can be installed, or updated simply by copying them to
the floppy disk at the location expected by the
the floppy disk at the location expected by the
menu.lst file. For booting from floppy disks it
menu.lst file. For booting from floppy disks it
is recommended that the executable be stripped of all debug and symbol
is recommended that the executable be stripped of all debug and symbol
table information before copying. This reduces the size of the file
table information before copying. This reduces the size of the file
and can make booting faster.
and can make booting faster.
To install GRUB on a hard disk, refer to the GRUB documentation. Be
To install GRUB on a hard disk, refer to the GRUB documentation. Be
warned, however, that if you get this wrong it may compromise any
warned, however, that if you get this wrong it may compromise any
existing bootloader that exists on the hard disk and may make any
existing bootloader that exists on the hard disk and may make any
other operating systems unbootable. Practice on floppy disks or
other operating systems unbootable. Practice on floppy disks or
sacrificial hard disks first. On machines running Red Hat Linux
sacrificial hard disks first. On machines running Red Hat Linux
version 7.2 and later, you can just add your own menu items to the
version 7.2 and later, you can just add your own menu items to the
/boot/grub/menu.lst file that already exists.
/boot/grub/menu.lst file that already exists.
Debugging FLOPPY and GRUB Applications
Debugging FLOPPY and GRUB Applications
When RedBoot loads an application it also provides debugging services
When RedBoot loads an application it also provides debugging services
in the form of GDB remote protocol stubs. When an application is
in the form of GDB remote protocol stubs. When an application is
loaded stand-alone from a floppy disk, or by GRUB, these services are
loaded stand-alone from a floppy disk, or by GRUB, these services are
not present. To allow these application to be debugged, it is possible
not present. To allow these application to be debugged, it is possible
to include GDB stubs into the application.
to include GDB stubs into the application.
To do this, set the "Support for GDB stubs"
To do this, set the "Support for GDB stubs"
(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) configuration
(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) configuration
option. Following this any application built will allow GDB to connect
option. Following this any application built will allow GDB to connect
to the debug serial port (by default serial device 0, also known as
to the debug serial port (by default serial device 0, also known as
COM1) whenever the application takes an exception, or if a Control-C
COM1) whenever the application takes an exception, or if a Control-C
is typed to the debug port. Ethernet debugging is not supported.
is typed to the debug port. Ethernet debugging is not supported.
The option "Enable initial breakpoint"
The option "Enable initial breakpoint"
(CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK) causes the HAL
(CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK) causes the HAL
to take a breakpoint immediately before calling cyg_start(). This
to take a breakpoint immediately before calling cyg_start(). This
gives the developer a chance to set any breakpoints or inspect the
gives the developer a chance to set any breakpoints or inspect the
system state before it proceeds. The configuration sets this option by
system state before it proceeds. The configuration sets this option by
default if GDB stubs are included, and this is not a RedBoot build. To
default if GDB stubs are included, and this is not a RedBoot build. To
make the application execute immediately either disable this option,
make the application execute immediately either disable this option,
or disable CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS.
or disable CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS.
<!-- <conditionaltext> --><!-- <index></index> -->i386/Linux Synthetic Target Setup
<!-- <conditionaltext> --><!-- <index></index> -->i386/Linux Synthetic Target Setup
When building for the synthetic Linux target, the resulting
When building for the synthetic Linux target, the resulting
binaries are native Linux applications with the HAL providing suitable
binaries are native Linux applications with the HAL providing suitable
bindings between the eCos kernel and the Linux kernel.
bindings between the eCos kernel and the Linux kernel.
Please be aware that the current implementation of the Linux
Please be aware that the current implementation of the Linux
synthetic target does not allow thread-aware debugging.
synthetic target does not allow thread-aware debugging.
These Linux applications cannot be run on a Windows system.
These Linux applications cannot be run on a Windows system.
However, it is possible to write a similar HAL emulation for the
However, it is possible to write a similar HAL emulation for the
Windows kernel if such a testing target is desired.
Windows kernel if such a testing target is desired.
Tools
Tools
For the synthetic target, eCos relies on features not available
For the synthetic target, eCos relies on features not available
in native compilers earlier than gcc-2.95.1. It also requires version
in native compilers earlier than gcc-2.95.1. It also requires version
2.9.5 or later of the GNU linker. If you have gcc-2.95.1 or later
2.9.5 or later of the GNU linker. If you have gcc-2.95.1 or later
and ld version 2.9.5 or later, then you do not need to build new
and ld version 2.9.5 or later, then you do not need to build new
tools. eCos does not support earlier versions. You can check the compiler
tools. eCos does not support earlier versions. You can check the compiler
version using gcc -v
version using gcc -v
and the linker version using ld
and the linker version using ld
-v.
-v.
If you have native tools that are sufficiently recent for
If you have native tools that are sufficiently recent for
use with eCos, you should be aware that by default eCos assumes
use with eCos, you should be aware that by default eCos assumes
that the tools i686-pc-linux-gnu-gcc, i686-pc-linux-gnu-ar,
that the tools i686-pc-linux-gnu-gcc, i686-pc-linux-gnu-ar,
 i686-pc-linux-gnu-ld, and i686-pc-linux-gnu-objcopy are
 i686-pc-linux-gnu-ld, and i686-pc-linux-gnu-objcopy are
on your system and are the correct versions for use with eCos. But
on your system and are the correct versions for use with eCos. But
instead, you can tell eCos to use your native tools by editing the
instead, you can tell eCos to use your native tools by editing the
configuration value "Global command prefix" (CYGBLD_GLOBAL_COMMAND_PREFIX)
configuration value "Global command prefix" (CYGBLD_GLOBAL_COMMAND_PREFIX)
in your eCos configuration. If left empty (i.e. set to the empty
in your eCos configuration. If left empty (i.e. set to the empty
string) eCos will use your native tools when building.
string) eCos will use your native tools when building.
If you have any difficulties, it is almost certainly easiest
If you have any difficulties, it is almost certainly easiest
overall to rebuild the tools as described on: http://sources.redhat.com/ecos/getstart.html
overall to rebuild the tools as described on: http://sources.redhat.com/ecos/getstart.html
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.