Name

Setup — Preparing the STM3210E-EVAL Board for eCos Development

Overview

In a typical development environment, the STM3210E-EVAL board boots from internal flash into either the GDB stubrom or RedBoot. eCos applications are configured for RAM startup and then downloaded and run on the board via the debugger arm-eabi-gdb.

RedBoot Installation

The following RedBoot configurations are supported:

ConfigurationDescriptionUseFile
ROMRedBoot running from internal FLASHredboot_ROM.ecmredboot_ROM.bin
RAMRedBoot running from external RAMredboot_RAM.ecmredboot_RAM.bin
JTAGRedBoot running from external RAM, loaded via JTAGredboot_JTAG.ecmredboot_JTAG.bin

For serial communications, all versions run with 8 bits, no parity, and 1 stop bit at 115200 baud. This rate can be changed using the RedBoot baud command.

Under normal circumstances, RedBoot runs in-place from the internal Flash. The RAM version is provided to allow for updating the resident RedBoot image in Flash. The JTAG version is only used if loading RedBoot into RAM via a JTAG debugger. It is similar to the RAM version, but loads at a lower address within RAM, and so can be used to load eCos applications, as if it is the normal resident boot monitor. The ELF format image of this JTAG version of RedBoot can also be loaded and executed from GDB using a JTAG device, to allow it to be debugged.

Programming RedBoot

To program RedBoot into the internal flash either a JTAG debugger that understands the STM32 flash may be used, such as a Ronetix PEEDI or an Abatron BDI3000, or the ST Flash Loader Demonstrator may be used. Configuration files for the PEEDI and BDI3000 are supplied in the STM3210E-EVAL HAL package, and brief instructions for downloading RedBoot are given in there. If no JTAG debugger is available, then RedBoot must be downloading using the Flash Loader Demonstrator which can be downloaded from the page for the STM32F101ZE CPU, in the Design Support->Demo SW section of ST's website at http://www.st.com/internet/mcu/product/164506.jsp

The documentation for this may be found at http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/CD00171488.pdf

The following are brief instructions for downloading RedBoot using the Flash Loader Demonstrator.

  1. Download the Flash Loader Demonstrator from the ST website and install it on a PC running Windows that has an available serial port.
  2. Copy the file redboot_ROM.bin from the loaders/stm3210e_eval sub-directory within your eCosPro installation to a suitable location on the Windows PC.
  3. Connect a null-modem serial cable between the USART1 serial port and a serial port on the Windows machine.
  4. Move the BOOT0/SW2 switch to the 1 position, ensure the BOOT1/SW2 switch remains in the 0 position, and press the reset button.
  5. Start the Flash Loader Demonstrator and in the first screen select the COM port connected to the board under Port Name. Ensure that the baud rate is also set at 115200, with Even parity and Echo disabled. Press Next. If you are succesfully connected to the board, you should see the message Target is readable. Please press "Next" to proceed . It should also note the size of the internal flash memory. Press Next and you will be prompted to select a target. Depending on the CPU model on your STM3210E-EVAL board and the size of its internal flash, either select the STM32_High-density_512K or STM32_XL-density_1024K, then Next to go to the Operation choice page. If any of these steps fail, follow the direction given by the loader to recover.
  6. On the operation choice page select "Download to device" and under "Download from file" either type the location of the redboot_ROM.bin file, or browse to it. Ensure that the "@" field is set to 8000000, the "Global Erase" radio button is selected and that all other options are clear except "Verify after download".
  7. Press "Next" and the loader should download and verify the binary file. The download or verify may fail if the flash has been previously locked, in which case you should select the "Enable/Disable Flash protection" radio button, "Disable" and "Write Protection" drop-down items, press Next and retry the download. Upon successful download press "Close" to exit the loader.
  8. Move the BOOT0/SW2 switch back to the 0 position and press the reset button.

The behaviour of the Flash Loader Demonstrator documented here is that of version 2.5. The actual behaviour of newer or older versions may vary slightly.

Whatever mechanism is used to program RedBoot, something similar to the following output should be seen on USART1 when the reset button is pressed:

RedBoot(tm) bootstrap and debug environment [ROM]
eCosCentric certified release, version v3_1_25 - built 15:36:19, May  8 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: ST STM3210E EVAL (Cortex-M3)
RAM: 0x68000000-0x68100000 [0x680036d0-0x680dd000 available]
     0x20000000-0x2000f000 [0x20000000-0x2000f000 available]
FLASH: 0x08000000-0x0807ffff, 256 x 0x800 blocks
FLASH: 0x64000000-0x64ffffff, 128 x 0x20000 blocks
RedBoot>

Initializing RedBoot Flash Configuration

While RedBoot is loaded into the on-chip flash, it manages the external flash for the storage of application programs and configuration data. The flash needs to be initialized with the following commands.

RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x64fe0000-0x64ffffff: .
... Program from 0x680e0000-0x68100000 to 0x64fe0000: .
RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: false
Console baud rate: 115200
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0x64fe0000-0x64ffffff: .
... Program from 0x680e0000-0x68100000 to 0x64fe0000: .
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 are:

$ mkdir redboot_stm3210e_rom
$ cd redboot_stm3210e_rom
$ ecosconfig new stm3210e redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/cortexm/stm32/stm3210e_eval/VERSION/misc/redboot_ROM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make

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

The other versions of RedBoot - RAM or JTAG - may be similarly built by choosing the appropriate alternative .ecm file.