SH3/EDK7708 Hardware Setup

The eCos Developer’s Kit package comes with a ROM which provides GDB support for the Hitachi EDK7708 board (a big-endian and a little-endian version). Images of these ROMs are also provided at loaders/sh-edk7708/gdbload.bin and loaders/sh-edk7708le/gdbload.bin under the root of your eCos installation.

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 little-endian ROM, jumper 9 must be set to 1-2. Attention should be paid to the correct orientation of the ROM during installation. Only replace the board"s existing ROM using a proper PLCC extraction tool, as the socket would otherwise risk being damaged.

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 the device. Depending on the programming software you use, it might be necessary to enable byte-swapping. If the GDB stub ROM/FLASH you program does not work, try reversing the byte-order.

The GDB stub in the EPROM allows communication with GDB using 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). No flow control is employed. Connection to the host computer should be made using the dedicated serial cable included in the EDK package.

Installing the Stubs into FLASH

Preparing the Binaries

These two binary preparation steps are not strictly necessary as the eCos distribution ships with pre-compiled binaries in the directory loaders/sh-edk7708 and loaders/sh-edk7708le relative to the installation root.

Building the ROM images 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 SH EDK7708 hardware.

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

  4. If building a little-endian image, disable the “Use big-endian mode” option in the SH EDK7708 HAL (CYGHWR_HAL_SH_BIGENDIAN).

  5. Build eCos using Build->Library.

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

Building the ROM images 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 edk7708 stubs

  3. If building a little-endian image, uncomment the user value in ecos.ecc for CYGHWR_HAL_SH_BIGENDIAN and change it to 0.

  4. Enter the commands:

    $ ecosconfig tree      
    $ make 

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

Installing the Stubs into ROM or FLASH

  1. Program the binary image file gdb_module.bin into ROM or FLASH referring to the instructions of your ROM programmer.

  2. 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 set jumper 9 to 2-3.