In a typical development environment, the STM3210C-EVAL board boots from internal flash into the GDB Stubrom. eCos applications are configured for RAM startup and then downloaded and run on the board via the debugger arm-eabi-gdb.
For serial communications, the Stubrom runs with 8 bits, no parity, and 1 stop bit at 38400 baud. This rate can be changed in the platform HAL configuration. Under normal circumstances, the Stubrom runs in-place from the internal Flash.
Programming The Stubrom
To program the Stubrom 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 STM3210C-EVAL HAL package, and brief instructions for downloading the Stubrom are given in there. If no JTAG debugger is available, then the Stubrom 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 the Stubrom using the Flash Loader Demonstrator.
Download the Flash Loader Demonstrator from the ST website and install it on a PC running Windows that has an available serial port.
Copy the file stubrom.bin from the loaders/stm3210c_eval/gdbstub/ROM sub-directory within your eCosPro installation to a suitable location on the Windows PC.
Connect a null-modem serial cable between the USART1 serial port and a serial port on the Windows machine.
Move the BOOT0/SW2 switch to the 1 position, ensure the BOOT1/SW1 switch remains in the 0 position, and press the reset button.
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 . Press Next and you will be prompted to select a target. Select STM32_Connectivity-line_256K, then Next to go to the Operation choice page. If any of these steps fail, follow the direction given by the loader to recover.
On the operation choice page select "Download to device" and under "Download from file" either type the location of the stubrom.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".
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.
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.2.0. The actual behaviour of newer or older versions may vary slightly.
Whatever mechanism is used to program the Stubrom, something similar to the following output should be seen on USART1 when the reset button is pressed:
Rebuilding the Stubrom
Should it prove necessary to rebuild a Stubrom binary, this is done most conveniently at the command line. The steps needed to rebuild the the ROM version of the Stubrom are:
$ mkdir stubrom_stm3210c_rom $ cd stubrom_stm3210c_rom $ ecosconfig new stm3210c stubs $ ecosconfig import $ECOS_REPOSITORY/hal/cortexm/stm32/stm3210c_eval/VERSION/misc/stubs_ROM.ecm $ ecosconfig resolve $ ecosconfig tree $ make
At the end of the build the install/bin subdirectory should contain the file stubrom.bin.