The Matsushita AM33 STB System Reference Board may be used in two modes: via a JTAG debugger, or by means of a GDB stub ROM.
The eCos Developer’s Kit package comes with a ROM image which provides GDB support for the Matsushita(R) AM33 STB System Reference Board. To install the GDB stub ROM requires the use of the JTAG debugger and the Flash ROM programming code available from Matsushita. An image of this ROM is also provided at loaders/am33-stb/gdbload.bin under the root of your eCos installation.
Ensure that there is a Flash ROM card in MAIN MEMORY SLOT <0>. Follow the directions for programming a Flash ROM supplied with the programming software.
The final programming of the ROM will need to be done with a command similar to the following:
Once the ROM has been programmed, close down the JTAG debugger, turn the STB off, and disconnect the JTAG cable. Ensure that the hardware switches are in the following configuration:
U U D D D U D D D = lower part of rocker switch pushed in U = upper part of rocker switch pushed in
This is also the configuration required by the Flash programming code, so it should not be necessary to change these.
Restart the STB and the stub ROM will now be able to communicate with GDB. eCos programs should be built with RAM startup.
Programs can then be downloaded via a standard RS232 null modem serial cable connected to the SERIAL1 connector on the STB front panel (the AM33"s serial port 0). This line is programmed to run at 38400 baud, 8 data bits, no parity and 1 stop bit (8-N-1) with no flow control. A gender changer may also be required. Diagnostic output will be output to GDB using the same connection.
This procedure also applies for programming ROM startup eCos programs into ROM, given a binary format image of the program from
To use eCos from the JTAG debugger, executables must be built with ROM startup and then downloaded via the JTAG debugger. For this to work there must be an SDRAM memory card in SUB MEMORY SLOT <0> and the hardware switches on the front panel set to the following:
D U D D D U D D D = lower part of rocker switch pushed in U = upper part of rocker switch pushed in
Connect the JTAG unit and run the debugger as described in the documentation that comes with it.
eCos executables should be renamed to have a “.out” extension and may then be loaded using the debugger"s “l” or “lp” commands.
Diagnostic output generated by the program will be sent out of the AM33"s serial port 0 which is connected to the SERIAL1 connector on the STB front panel. This line is programmed to run at 38400 baud, 8 data bits, no parity, and one stop bit (8-N-1) with no flow control. Connection to the host computer should be using a standard RS232 null modem serial cable. A gender changer may also be required.
eCos comes with a pre-built GDB stub ROM image for the AM33-STB platform. This can be found at loaders/am33-stb/gdbload.bin relative to the eCos installation directory.
If necessary, the ROM image can be re-built as follows:
On Windows hosts, open a Bash session using Start->Programs->Red Hat eCos->eCos Development Environment
Create a build directory and cd into it
Run (all as one line):
tclsh BASE_DIR/packages/pkgconf.tcl \ --target=mn10300_am33 --platform stb --startup rom \ --disable-kernel --disable-uitron --disable-libc --disable-libm \ --disable-io --disable-io_serial --disable-wallclock --disable-watchdog
where BASE_DIR is the path to the eCos installation directory.
Edit the configuration file pkgconf/hal.h in the build directory tree by ensuring the following configuration options are set as follows:
#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS #define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT #undef CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT #define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT #define CYG_HAL_ROM_MONITOR
Run: make -C hal/common/current/current/src/stubrom
The file hal/common/current/src/stubrom will be an ELF format executable of the ROM image. Use mn10300-elf-objcopy to convert this to the appropriate format for loading into the Matsushita FLASH ROM programmer, mode “binary” in this case:
$ mn10300-elf-objcopy -O binary hal/common/current/src/stubrom/ \ stubrom stubrom.img