SH3/CQ7708 Hardware Setup

Preparing the board

Make sure the DIP switches on the board are set as follows:

SW1-1 ON
SW1-2 OFF   
SW1-3 ON   
SW1-4 OFF
SW2-1 ON   
SW2-2 ON   
SW2-3 OFF   
SW2-4 OFF

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 can cause NMIs.

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 and installed on the board.

Preparing the GDB stubs

These stub preparation steps are not strictly necessary as the eCos distribution ships with pre-compiled stubs in the directory loaders/sh3-cq7708 relative to the installation root.

Building the GDB stub image with the eCos Configuration Tool

  1. Start with a new document - selecting the File->New menu item if necessary to do this.

  2. Choose the Build->Templates menu item, and then select the SH3 cq7708 hardware.

  3. While still displaying the Build->Templates dialog box, select the stubs package template to build a GDB stub. Click OK.

  4. Build eCos stubs using Build->Library.

  5. When the build completes, the image files can be found in the bin/ subdirectory of the install tree. GDB stub images have the prefix gdb_module.

Building the GDB stub image with ecosconfig

  1. Make an empty directory to contain the build tree, and cd into it.

  2. To build a GDB stub ROM image, enter the command:

    $ ecosconfig new cq7708 stubs 

  3. Enter the commands:

    $ ecosconfig tree      
    $ make

  4. When the build completes, the image files can be found in the bin/ subdirectory of the install tree. GDB stub images have the prefix gdb_module.

Programming the stubs in EPROM/FLASH

The board can use different sizes of ROMs. Use this table to adjust the board’s jumpers to the ROM sizes you are using.

size(kbit)    JP7   JP9   JP10   JP11     
256           2-3   2-3   open   open     
512           1-2   2-3   open   open     
1000          1-2   open  open   2-3     
2000          1-2   1-2   open   2-3     
4000          1-2   1-2   short  2-3     
8000          1-2   1-2   short  1-2

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 a bit of fiddling.

Method 1:

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 programmer should have the ability to split the image).

EPROM E should be installed in socket IC8, and EPROM O should be installed in socket IC4.

Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut) Set SW1-4 to ON and SW2-1 to OFF.

Method2:

Assuming that the stub binary is smaller than 32 KB, you can install it in a single EPROM.

Compile the mkcqrom.c program found in the misc directory.

Use it to convert the binary image to the required format. See the mkcqrom.c source for a description of what is done, and why it is necessary.

 % mkcqrom gdb_module.bin gdb_mangled.bin

Program the gdb_mangled.bin file into an EPROM and install it in socket IC4

Set JP6 to 8 bit mode (cut 1-2, solder 2-3)

The GDB stubs allow communication with GDB using the serial 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 flow control is employed. Connection to the host computer should be made using a straight through serial cable.