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. 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 clicking the Start button, selecting Programs, then Cygnus eCos, then eCos Development Environment. If you are using the Sourceware release, you should set the environment variables as shown in the GNUPro Toolkit Reference booklet.

Change directory as follows for the MN10300:

$ cd BASE_DIR/prebuilt/v1_1/mn10300-stdeval1-ram/tests/kernel

or on the TX39:

$ cd BASE_DIR/prebuilt/v1_1/tx39-jmr3904-ram/tests/kernel

or on the PowerPC:

$ cd BASE_DIR/prebuilt/v1_1/powerpc-cogent-ram/tests/kernel

Note: The tests have been built in two versions; RAM startup for use on the evaluation board, and ROM startup 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:

$ gdb -nw thread_gdb

GDB will display a copyright banner and then display a prompt (gdb). To run the test case type the following commands at the prompt:

(gdb) set remotebaud 38400

(gdb) target remote com1

(gdb) load

(gdb) continue

The first two commands set up the serial connection: the target expects to communicate with the host at 38400 baud on the com1 serial port (this should be adjusted if a different port is used.) The third command will load the test case executable into the memory of the target board, and the last command will start the test case running. You should now see a number of text messages appear as below:

 

         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 type Control-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 we use continue to start executing on hardware and run to start executing in the simulator.