Setup

Name

Setup -- Preparing the ADS512101 board for eCos Development

Overview

In a typical development environment, the ADS512101 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
ROMRAMRedBoot loaded from ROM into RAMredboot_ROMRAM.ecmredboot_ROMRAM.bin
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 ROMRAM RedBoot is used. The JTAG RedBoot is used to install the ROMRAM RedBoot on the board.

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 version of RedBoot on the board and use that to download and install 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.mpc5121ads.cfg file should be used to setup and configure the hardware.

  2. Connect a null modem serial cable between the ADS512101 board and a suitable host. Run a serial terminal emulator (Hyperterm 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/ads512101 sub-directory of your eCosPro installation, copy redboot_JTAG.srec and redboot_ROMRAM.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:

          mpc5121> reset stop
          ++ info: user reset
          mpc5121>
          ++ info: HRESET, SRESET and TRST asserted
          ++ info: TRST released
          ++ info: BYPASS check passed
          ++ info: 1 TAP controller(s) detected
          ++ info: TAP : IDCODE = 0x1540A01D, Freescale MPC5121
          ++ info: HRESET and SRESET released
          ++ info: CPU PVR is 0x80862010 (e300c4)
          ++ info: CPU SVR is 0x80180020
          ++ info: setting breakpoint at 0xFFF00100
          ++ info: core 0: initialized
         
  6. Now issue the following command, substituting your own TFTP server address:

          mpc5121>> mem load tftp://10.0.1.1/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://10.0.1.1/redboot_JTAG.srec
          ++ info: At absolute address: 0x00000000
          loading at 0x0
          loading at 0x3300
          loading at 0xB300
          loading at 0x13300
          loading at 0x1B300
          loading at 0x22080
    
          Successfully loaded 154KB (158408 bytes) in 1.2s
          mpc5121>>
         
  7. Now issue the go command:

          mpc5121> 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 08:00:3e:28:7a:ba
          IP: 10.0.2.5/255.0.0.0, Gateway: 10.0.0.3
          Default server: 0.0.0.0
          DNS server IP: 10.0.1.1, DNS domain name: <null>
    
          RedBoot(tm) bootstrap and debug environment [JTAG]
          Non-certified release, version UNKNOWN - built 15:05:36, Jun 20 2011
    
          Copyright (C) 2000-2009 Free Software Foundation, Inc.
          Copyright (C) 2003-2011 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: ADS512101 (PowerPC MPC5121e)
          RAM: 0x00000000-0x08000000 [0x0003e400-0x07fb1000 available]
          FLASH: 0xfc000000-0xffffffff, 256 x 0x40000 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 0xfffc0000-0xffffffff: .
          ... Erase from 0xfffc0000-0xffffffff: .
          ... Program from 0x07fc0000-0x08000000 to 0xfffc0000: .
          ... Locking from 0xfffc0000-0xffffffff: .
          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: 10.0.1.1
          Console baud rate: 115200
          DNS domain name: example.com
          DNS server IP address: 10.0.1.1
          Network hardware address [MAC]: 0x08:0x00:0x3E:0x28:0x7A:0xBA
          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 0xfffc0000-0xffffffff: .
          ... Erase from 0xfffc0000-0xffffffff: .
          ... Program from 0x07fc0000-0x08000000 to 0xfffc0000: .
          ... Locking from 0xfffc0000-0xffffffff: .
          RedBoot>
         

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

  9. Now we need to download and program a ROMRAM version of RedBoot. From RedBoot, issue the following command:

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

          RedBoot> fis cre RedBoot
          An image named 'RedBoot' exists - continue (y/n)? y
          ... Unlocking from 0xfff00000-0xfffbffff: ...
          ... Erase from 0xfff00000-0xfffbffff: ...
          ... Program from 0x0003e400-0x000682a8 to 0xfff00000: ...
          ... Locking from 0xfff00000-0xfffbffff: ...
          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 08:00:3e:28:7a:ba
          IP: 10.0.2.5/255.0.0.0, Gateway: 10.0.0.3
          Default server: 0.0.0.0
          DNS server IP: 10.0.1.1, DNS domain name: <null>
    
          RedBoot(tm) bootstrap and debug environment [ROMRAM]
          Non-certified release, version UNKNOWN - built 15:12:36, Jun 20 2011
    
          Copyright (C) 2000-2009 Free Software Foundation, Inc.
          Copyright (C) 2003-2011 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: ADS512101 (PowerPC MPC5121e)
          RAM: 0x00000000-0x08000000 [0x0003e400-0x07fb1000 available]
          FLASH: 0xfc000000-0xffffffff, 256 x 0x40000 blocks
          RedBoot>
         

To reinstall RedBoot, a new binary file can be installed and programmed into flash from the installed ROMRAM RedBoot, from step 9 above. It is not necessary to use JTAG for this unless the board is rendered unusable.

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 ADS512101 are:

    $ mkdir redboot_ads512101_romram
    $ cd redboot_ads512101_romram
    $ ecosconfig new ads512101 redboot
    $ ecosconfig import $ECOS_REPOSITORY/hal/powerpc/ads512101/VERSION/misc/ads512101_redboot_ROMRAM.ecm
    $ ecosconfig resolve
    $ ecosconfig tree
    $ make
   

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

2017-02-09
Documentation license for this page: eCosPro License