Getting Started with eCosTM
Prev | Chapter 10. Hardware setup | Next

# Verification

To verify that your board has been set up correctly you need to download and execute an application. The following example demonstrates how to use GDB to download an eCos kernel test case, execute it, and display its test output (to verify the setup of your synthetic i386/Linux target, seethe section called Verification for the i386/Linux synthetic target). You will need to change directory to the pre-built tests that are provided in the eCos installation.

On Windows you must have the bash command line interpreter running with some environment variables which are useful for eCos work. If you have purchased the eCos Developer’s Kit, you can select this by selecting Start -> Programs -> Cygnus eCos -> eCos Development Environment. If you are using the Sourceware release, you should set the environment variables as shown in the GNUPro Toolkit Reference manual.

Change directory as follows for the MN10300:

`$` `cd `BASE_DIR`/prebuilt/v1_2_1/mn10300-stdeval1-ram/tests/kernel`

or on the TX39:

`$` `cd `BASE_DIR`/prebuilt/v1_2_1/tx39-jmr3904-ram/tests/kernel`

or on the PowerPC:

`$` `cd `BASE_DIR`/prebuilt/v1_2_1/powerpc-cogent-ram/tests/kernel`

or on the SPARClite:

`$` `cd `BASE_DIR`/prebuilt/v1_2_1/sparclite-sleb-ram/tests/kernel`

or on the ARM7 PID:

`$` `cd `BASE_DIR`/prebuilt/v1_2_1/arm-pid-ram/tests/kernel`

or on the ARM7 AEB-1:

`$` `cd `BASE_DIR`/prebuilt/v1_2_1/arm-aeb-ram/tests/kernel`

> Note: The tests have been built in two versions; RAM start-up for use on the evaluation board, and ROM start-up for burning into a PROM, or for use on the simulator.

To execute the thread_gdb test case on the target hardware, run GDB in command line mode using the following command, remembering to substitute the appropriate name for your target’s gdb:

`$` `gdb -nw thread_gdb`

GDB will display a copyright banner and then display a prompt `(gdb)`. Connect to the TX39, MN10300, PowerPC, or ARM7 boards by typing the following commands at the prompt, which will set up the serial connection at 38400 baud on the COM1 serial port (this should be adjusted if a different port is used; for example, on UNIX this would be `/dev/ttyS0`):

`(gdb)` `set remotebaud 38400`
`(gdb)` `target remote com1`

Connect to the SPARClite board (using serial connection) by typing the following commands at the prompt, which will set up the serial connection at 19200 baud on the COM1 serial port (this should be adjusted if a different port is used; for example, on UNIX this would be `/dev/ttyS0`):

`(gdb)` `set remotebaud 19200`
`(gdb)` `target remote com1`

Connect to the SPARClite board via TCP by typing the following commands at the prompt:

`(gdb)` `target remote xxx:1000`

where xxx is the IP address or hostname assigned to the board.

Now download and run the test by typing these commands:

`(gdb)` `load`
`(gdb)` `continue`

The first command will load the test case executable into the memory of the target board, and the second command will start the test case running. You should now see a number of text messages appear, such as:

             PASS:<GDB Thread test OK>
             EXIT:<done>

> Note: eCos has no concept of the application exiting. All eCos test cases complete and then run in a continuous tight loop. To return control to GDB, you must use Ctrl-C.

The full functionality of GDB is now available to you, including breakpoints and watchpoints. Please consult the GNUPro GDB documentation for further information.

> Note: An idiosyncrasy in GDB’s handling of target boards as opposed to simulators means that you should use continue to start executing on hardware and run to start executing in the simulator.

## Verification for the i386/Linux synthetic target

As for the other targets, a prebuilt test is supplied for the synthetic i386/Linux target. This can be used to ensure that synthetic binaries will actually run on your machine configuration.

To execute this test, `thread_gdb`, either start it directly from the command line, or to test the debugging environment, run GDB in command line mode using the following command:

`$` `gdb -nw \ `BASE_DIR`/prebuilt/v1_2_1/i386-linux-ram/tests/kernel/thread_gdb`

GDB will display a copyright banner and then display a prompt `(gdb)`. You should now be able to run the test, which will print out some text:

             (gdb) run
             PASS:<GDB Thread test OK>
             EXIT:<done>

Prev | Home | Next
i386/Linux synthetic target setup | Up | Programming Tutorial