Target Setup

To Contents

To previous page

To next page

 




Target Setup

Connecting To A Target Via Serial

While eCos supports a variety of targets, communication with the targets happens in one of four ways. These are descibed in general below.

The descriptions are followed by descriptions of each target, providing specific details of how to set up the target (if hardware) and the necessary communication information (such as baud rate for hardware targets, or special connection options for simulator targets).

Most targets will have eCos GDB stubs or CygMon installed. These normally wait for GDB to connect at 38400 baud, using 8 data bit, no parity bit and 1 stop-bit (no hardware flow control). Check the section for your target to ensure it uses this speed. If not, adjust the following instructions accordingly.

The following instructions depend on you to select the appropriate serial port on the host - the serial port which connects to the target's (primary) serial port. On Linux this could be /dev/ttyS0, while the same port on Windows would be named COM1, or
/dev/ttya on Solaris. Substitute the proper serial port name in the below.

Connect to the target by issuing the following commands in GDB console mode:

 
(gdb) set remotebaud 38400    
(gdb) set mips-force-32bit-saved-gpregs
(gdb) target remote /dev/ttyS0

In Insight, connect by opening the File->Target Settings ... window and enter:

 
Target: Remote/Serial     
Baud Rate: 38400     
Port: /dev/ttyS0

You will also need to open the GDB console window with View->Console and enter "set mips-force-32bit-saved-gpregs" at the prompt

Set other options according to preference, close the window and select
Run->Connect to target .

Connecting To A Target Via Ethernet

Some targets allow GDB to connect via Ethernet - if so, it will be mentioned in the section describing the target. Substitute the target's assigned IP address or hostname for <hostname> in the following. The <port> is the TCP port which the eCos GDB stub or CygWin is listening on. It is also listed in the section describing the target.

Connect to the target by issuing the following command in GDB console mode:

 
(gdb) target remote <hostname>:<port>

In Insight, connect by opening the File->Target Settings ... window and enter:

 
Target: Remote/TCP     
Hostname: <hostname>     
Port: <port>

Set other options according to preference, close the window and select
Run->Connect to target .

Connecting To A Simulator Target

GDB connects to all simulator targets using the same basic command, although each simulator may require additional options. These are listed in the section describing the target, and should be used when connecting.

Connect to the target by issuing the following command in GDB console mode:

 
(gdb) target sim [target specific options]

In Insight, connect by opening the File->Target Settings ... window and enter:

 
Target: Simulator     
Options: [target specific options]

Set other options according to preference, close the window and select
Run->Connect to target .

Connecting To A Synthetic Target

Synthetic targets are special in that the built tests and applications actually run as native applications on the host. This means that there is no target to connect to - the test or application can be run directly from the GDB console using:

 
(gdb) run

or from Insight by pressing the Run icon. There is therefore no need to connect to the target or download the application, so you should ignore GDB "target" and "load" commands in any instructions found in other places in the documentation.

SPARClite Hardware Setup

The eCos Developer's Kit package comes with a ROM which provides GDB support for the Fujitsu SPARClite Evaluation Board by way of CygMon .

An image of this ROM is also provided at BASE_DIR/loaders/sparclite-sleb/cygmon.bin. The ROM is installed in socket IC9 on the evaluation board. Attention should be paid to the correct orientation of the ROM during installation.

The GDB stub allows communication with GDB using a TCP channel via the ethernet port at connector J5.

Ethernet Setup

The ethernet setup is described in the board's manual, but here is a recapitulation.

Set the board's ethernet address using SW1 on the motherboard:

 
	    SW1-4 SW1-3 SW1-2 SW1-1    Ethernet Address
	    ----- ----- ----- -----    ----------------
	    OFF   OFF   OFF   OFF     No ethernet, use serial
	    OFF   OFF   OFF    ON     00:00:0E:31:00:01
	    OFF   OFF    ON   OFF     00:00:0E:31:00:02
	    OFF   OFF    ON    ON     00:00:0E:31:00:03
	    OFF    ON   OFF   OFF     00:00:0E:31:00:04
	    OFF    ON   OFF    ON     00:00:0E:31:00:05
	    OFF    ON    ON   OFF     00:00:0E:31:00:06
	    OFF    ON    ON    ON     00:00:0E:31:00:07
	    ON    OFF   OFF   OFF     00:00:0E:31:00:08
	    ON    OFF   OFF    ON     00:00:0E:31:00:09
	    ON    OFF    ON   OFF     00:00:0E:31:00:0A
	    ON    OFF    ON    ON     00:00:0E:31:00:0B
	    ON     ON   OFF   OFF     00:00:0E:31:00:0C
	    ON     ON   OFF    ON     00:00:0E:31:00:0D
	    ON     ON    ON   OFF     00:00:0E:31:00:0E
	    ON     ON    ON    ON     00:00:0E:31:00:0F

BOOTP/DHCP service on Linux

Configure the BOOTP or DHCP server on the network to recognize the evaluation board's ethernet address so it can assign the board an IP address. Below is a sample DHCP server configuration from a Linux system ( /etc/dhcpd.conf ). It shows a setup for three evaluation boards.

 
#
# DHCP server configuration.
#
allow bootp;

subnet 192.168.1.0 netmask 255.255.255.0 {
  host mb831evb {
    hardware ethernet 00:00:0e:31:00:01;
    fixed-address mb831evb;
  }
  host mb832evb {
    hardware ethernet 00:00:0e:31:00:02;
    fixed-address mb832evb;
  }
  host mb833evb {
    hardware ethernet 00:00:0e:31:00:03;
    fixed-address mb833evb;
  }
} 

BOOTP/DHCP boot process

Even when configured to use a TCP channel, CygMon will still print a boot message to the serial channel. If the BOOTP process was successful and an IP address was found, a message "BOOTP 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 process fails, a message indicating failure will be printed and the serial port will be used as the debug channel.

Once the board finds an IP address it will respond to ICMP echo request packets (ping). This gives a simple means to test the health of the board.

As described in Ethernet Setup , it should now be possible to connect to the SPARCLite board from within GDB by using the command:

 
(gdb) target remote <host>:1000

Serial Setup

The CygMon stubs also allow communication with GDB by way 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 (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 be required.

SPARClite Architectural Simulator Setup

The ESA SPARClite simulator is an architectural simulator which implements all the features of the SPARClite needed to run eCos. The current implementation provides accurate simulation of the instruction set, interrupt controller, and timers, as well as having generic support for diagnostic output and exceptions.

Note that the ESA SPARClite simulator is unsupported, but is included in the release as a convenience.

To simplify connection to the simulator, you are advised to create a GDB macro by putting the following code in your personal GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).

 
define ssim   
 target sim -nfp -sparclite -dumbio   
 rbreak cyg_test_exit   
 rbreak cyg_assert_fail  
end

You can then connect to the simulator by invoking the command ssim on the command line:

 
 (gdb) ssim

You can achieve the same effect by typing out the macro's content on the command line if necessary.


i386/Linux Synthetic Target Setup

When building for the synthetic Linux target, the resulting binaries are native Linux applications with the HAL providing suitable bindings between the eCos kernel and the Linux kernel.

NOTE:

Please be aware that the current implementation of the Linux synthetic target does not allow thread-aware debugging.

These Linux applications cannot be run on a Windows system. However, it is possible to write a similar HAL emulation for the Windows kernel if such a testing target is desired.

Tools

For the synthetic target, eCos relies on features not available 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 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 version using gcc -v or egcs -v , and the linker version using ld -v .

If you have native tools that are sufficiently recent for 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, 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 instead, you can tell eCos to use your native tools by editting the configuration value "Global command prefix" (CYGBLD_GLOBAL_COMMAND_PREFIX) in your eCos configuration. If left empty (i.e. set to the empty string) eCos will use your native tools when building.

If you have any difficulties, it is almost certainly easiest overall to rebuild the tools as described on:

http://sourceware.cygnus.com/ecos/getstart.html


Target Setup

To Contents

To previous page

To next page