Name

Setup — Preparing the MPC8309KIT board for eCos Development

Overview

In a typical development environment, the MPC8309KIT board boots from flash into the RedBoot ROM monitor. eCos applications are configured for RAM startup and then downloaded and run on the board via the debugger powerpc-eabi-gdb. Preparing the board therefore usually involves programming a suitable RedBoot image into flash memory.

The following RedBoot configurations are supported:

ConfigurationDescriptionUseFile
ROMRedBoot running directly from flashredboot_ROM.ecmredboot_ROM.bin
RAMRedBoot running in external RAMredboot_RAM.ecmredboot_RAM.bin
JTAGRedBoot running in external RAM, loaded by JTAGredboot_JTAG.ecmredboot_JTAG.bin

Under normal circumstances the ROM RedBoot is used. The JTAG RedBoot is used to install the ROM RedBoot, and the RAM RedBoot may be used to update it.

For serial communications, all versions run with 8 bits, no parity, and 1 stop bit at 115200 baud. The baud rate can be changed using the flash configuration console baud rate option. RedBoot also supports flash management.

Initial Installation

The simplest approach to installing RedBoot is to make use of a JTAG device to run a JTAG version of RedBoot on the board and use that to download and install ROM RedBoot. The following is a simple step-by-step guide to installing RedBoot on the board using a Ronetix PEEDI JTAG emulator:

  1. Set up the PEEDI as described in the Ronetix documentation. The peedi.mpc8309kit.cfg file should be used to setup and configure the hardware.
  2. Connect a null modem serial cable between the MPC8309KIT board and a suitable host. Run a serial terminal emulator (Hyperterm, Teraterm or minicom) on the host, connecting to the serial device at 115200 baud with no flow control.
  3. Connect an Ethernet cable between the board and your local network.
  4. From the loaders/mpc8309kit sub-directory of your eCosPro installation, copy redboot_JTAG.srec and redboot_ROM.bin to the data area of a TFTP server the PEEDI can access.
  5. Connect a telnet session to the PEEDI and issue a reset command to the PEEDI to put the device into a known state:

          mpc8309> reset stop
          ++ info: user reset
          mpc8309>
          ++ info: HRESET, SRESET and TRST asserted
          ++ info: TRST released
          ++ info: BYPASS check passed
          ++ info: 1 TAP controller(s) detected
          ++ info: TAP : IDCODE = 0x16AC101D, MPC8308
          ++ info: overriding RCW (0xA0600000 0x44050008)
          ++ info: HRESET and SRESET released
          ++ info: CPU PVR is 0x80850020 (e300c3)
          ++ info: CPU SVR is 0x81100011
          ++ info: setting breakpoint at 0x00000100
          ++ info: core 0: initialized
  6. Now issue the following command, substituting your own TFTP server address:

          mpc8309> mem load tftp://192.168.7.22/redboot_JTAG.srec srec
          * warning: default file for this core not specified
          ** warning: use CORE_FILE parameter to specify default file
          ++ info: Loading image file:  tftp://192.168.7.22/redboot_JTAG.srec
          ++ info: At absolute address: 0x00000000
          loading at 0x0
          loading at 0x3500
          loading at 0xB500
          loading at 0x13500
          loading at 0x1B500
          loading at 0x22220
          loading at 0x2A220
          loading at 0x32220
          loading at 0x327E8
          loading at 0x3A7E8
    
          Successfully loaded 248KB (253956 bytes) in 1.7s
          mpc8309>
  7. Now issue the go command:

          mpc8309> go 0x100

    You should see something similar to the following output on the board serial line.

          +**Warning** FLASH configuration checksum error or invalid key
          Use 'fconfig -i' to [re]initialize database
          Ethernet eth0: MAC address 00:04:9f:ef:03:01
          IP: 192.168.7.171/255.255.255.0, Gateway: 192.168.7.1
          Default server: 0.0.0.0
          DNS server IP: 192.168.7.3, DNS domain name: <null>
    
          RedBoot(tm) bootstrap and debug environment [JTAG]
          Non-certified release, version UNKNOWN - built 13:34:41, Mar  2 2012
    
          Copyright (C) 2000-2009 Free Software Foundation, Inc.
          Copyright (C) 2003-2012 eCosCentric Limited
          RedBoot is free software, covered by the eCos license, derived from the
          GNU General Public License. You are welcome to change it and/or distribute
          copies of it under certain conditions. Under the license terms, RedBoot's
          source code and full license terms must have been made available to you.
          Redboot comes with ABSOLUTELY NO WARRANTY.
    
          Platform: MPC8309KIT (PowerPC MPC8309)
          RAM: 0x00000000-0x10000000 [0x00049bc0-0x0ffe1000 available]
          FLASH: 0xfe000000-0xfe7fffff, 127 x 0x10000 blocks, 8 x 0x2000 blocks
          RedBoot>
  8. RedBoot's flash management and configuration should be initialized as follows:

          RedBoot> fis init
          About to initialize [format] FLASH image system - continue (y/n)? y
          *** Initialize FLASH Image System
          ... Unlocking from 0xfe7f0000-0xfe7fffff: ........
          ... Erase from 0xfe7f0000-0xfe7fffff: ........
          ... Program from 0x0fff0000-0x10000000 to 0xfe7f0000: ........
          ... Locking from 0xfe7f0000-0xfe7fffff: ........
          RedBoot> fconfig -i
          Initialize non-volatile configuration - continue (y/n)? y
          Run script at boot: false
          Use BOOTP for network configuration: true
          Default server IP address: 192.168.7.22
          Console baud rate: 115200
          DNS domain name: example.com
          DNS server IP address: 192.168.7.3
          Network hardware address [MAC] for eth0: 0x00:0x04:0x9F:0xEF:0x03:0x073
          GDB connection port: 9000
          Force console for special debug messages: false
          Network debug at boot time: false
          Update RedBoot non-volatile configuration - continue (y/n)? y
          ... Unlocking from 0xfe7f0000-0xfe7fffff: ........
          ... Erase from 0xfe7f0000-0xfe7fffff: ........
          ... Program from 0x0fff0000-0x10000000 to 0xfe7f0000: ........
          ... Locking from 0xfe7f0000-0xfe7fffff: ........
          RedBoot>

    For the "Default server IP address", enter the IP address of the TFTP server on which the redboot_ROM.bin is to be found.

  9. Now we need to download and program a ROM version of RedBoot. From RedBoot, issue the following command, substituting the IP address of your TFTP server:

          RedBoot> load -r -b %{freememlo} -h 192.168.7.22 redboot_ROM.bin
          Using default protocol (TFTP)
          Raw file loaded 0x00049c00-0x00089cd7, assumed entry at 0x00049c00
          RedBoot>
  10. Program the RedBoot into the board:

          RedBoot> fis create RedBoot
          An image named 'RedBoot' exists - continue (y/n)? y
          ... Unlocking from 0xfe000000-0xfe0bffff: ............
          ... Erase from 0xfe000000-0xfe0bffff: ............
          ... Program from 0x00049c00-0x00089cd8 to 0xfe000000: .....
          ... Locking from 0xfe000000-0xfe0bffff: ............
          ... Unlocking from 0xfe7f0000-0xfe7fffff: ........
          ... Erase from 0xfe7f0000-0xfe7fffff: ........
          ... Program from 0x0fff0000-0x10000000 to 0xfe7f0000: ........
          ... Locking from 0xfe7f0000-0xfe7fffff: ........
          RedBoot>
  11. RedBoot is now programmed into the board. Detach the PEEDI and reset the board and you should see the following output:

          +Ethernet eth0: MAC address 00:04:9f:ef:03:73
          IP: 192.168.7.182/255.255.255.0, Gateway: 192.168.7.1
          Default server: 192.168.7.22
          DNS server IP: 192.168.7.3, DNS domain name: <null>
    
          RedBoot(tm) bootstrap and debug environment [ROM]
          Non-certified release, version UNKNOWN - built 10:42:26, Mar  2 2012
    
          Copyright (C) 2000-2009 Free Software Foundation, Inc.
          Copyright (C) 2003-2012 eCosCentric Limited
          RedBoot is free software, covered by the eCos license, derived from the
          GNU General Public License. You are welcome to change it and/or distribute
          copies of it under certain conditions. Under the license terms, RedBoot's
          source code and full license terms must have been made available to you.
          Redboot comes with ABSOLUTELY NO WARRANTY.
    
          Platform: MPC8309KIT (PowerPC MPC8309)
          RAM: 0x00000000-0x10000000 [0x0001a9b8-0x0ffe1000 available]
          FLASH: 0xfe000000-0xfe7fffff, 127 x 0x10000 blocks, 8 x 0x2000 blocks
          RedBoot>

To reinstall RedBoot, the above process can be repeated, or a RAM RedBoot can be loaded by the ROM RedBoot and used like the JTAG RedBoot to load and program a new ROM RedBoot.

Rebuilding RedBoot

Should it prove necessary to rebuild a RedBoot binary, this is done most conveniently at the command line. The steps needed to rebuild the the ROM version of RedBoot for the MPC8309KIT are:

    $ mkdir redboot_mpc8309kit_rom
    $ cd redboot_mpc8309kit_rom
    $ ecosconfig new mpc8309kit redboot
    $ ecosconfig import $ECOS_REPOSITORY/hal/powerpc/mpc8309kit/current/misc/mpc8309kit_redboot_ROM.ecm
    $ ecosconfig resolve
    $ ecosconfig tree
    $ make

At the end of the build the install/bin subdirectory should contain the file redboot.bin.