Setup — Preparing the EA QuickStart Board for eCos Development
In a typical development environment, the EA QuickStart Board boots from internal flash into either the GDB stub ROM monitor or directly into the user application. In the case of microcontrollers with less than 64Kbytes of SRAM, the latter is recommended. eCos applications to be loaded and run from the GDB stub ROM monitor may be configured for RAM startup and then downloaded and run on the board via the debugger arm-eabi-gdb. Preparing the board therefore usually involves programming a suitable ROM image into Flash memory, either the GDB stub ROM or application images.
For serial communications, all versions run with 8 bits, no parity, and 1
stop bit at 38400 baud. This baud rate can be changed via the configuration
rebuilding the application, or if applicable, GDB stub ROM. A "straight
through" 9-pin RS232 serial cable, with Male<->Female connectors is
required. Using a "null modem" serial cable will not work.
Jumper settings must be checked and potentially changed on the board to ensure correct operation. This section describes jumper settings that are known to require attention. In general, any board-specific documentation from Embedded Artists takes precedence over the documentation here, as this may reflect hardware which has been modified since the time of writing of this documentation. Most QuickStart boards are very similar to each other, the only change of note being of course the choice of LPC2xxx microcontroller fitted. But if your board does not fit the description here (which has initially been based on the LPC2148 USB QuickStart) then you should consult the board documentation.
Firstly, there are two jumpers located close to the serial connector. In general, these jumpers should only be closed (i.e. jumper fitted and connecting the two pins) when wishing to reprogram the on-chip Flash via ISP. Otherwise they should remain open (jumper not connecting the two pins) so that any unplugging of the serial connector, movement of the serial connector, or use of flow control signals from the host PC, do not cause a spurious reset or interrupt (on the EINT1 line) of the board.
If the board is being powered directly by USB, then a jumper next to the USB connector should be closed. Otherwise it must be open. This also means the jumper must be open if the QuickStart board is mounted on the Prototype Board, and power is being provided by either the DC power connector or USB connector on the Prototype Board.
Note that if the Prototype Board is fitted, but the QuickStart board is being powered by its USB connector as opposed to the Prototype board's USB connector (thus meaning that the above jumper would be closed), then pin P0.23 is used as a USB power indication on LPC214x boards. This prevents its use as an SPI chip select line for the 7-segment LED on the Prototype Board.
If mounting the QuickStart LPC2xxx board on the QuickStart Prototype Board, then consult the EA documentation for the correct jumper settings and socket location appropriate to the fitted LPC2xxx model. This includes settings for the JTAG connector. In the case of the LPC213x/LPC214x, the jumper labelled "JTAG" must be closed, and the jumper labelled "DBGSEL" must be open.
It may also be useful to be aware that although eCos configures the PWM pin for the buzzer, it does not directly support it, and so it is probably useful to open the jumper labelled "P0.7" to disable the buzzer.
The jumpers adjacent to the LEDs may remain in their default state of closed, in order to get insight into system operation, and to allow use of the user-configurable LEDs, as described later.
This process assumes that a Microsoft Windows machine with the Flash Magic utility installed is available. Flash Magic is a tool for programming flash based microcontrollers from NXP using a protocol via the RS232 serial port to communicate with the In-System Programming (ISP) firmware on the LPC2xxx. The Flash Magic utility is sponsored by NXP and available from this website.
The first step is to connect the RS232 cable between the serial port of the QuickStart board and the host PC. Do not use the serial port on the Prototype board. Now close the two jumpers adjacent to the serial port on the QuickStart board. These allow the software on the PC to reset the LPC2xxx and enter the ISP firmware. Finally apply the power.
Start the Flash Magic utility on the host PC, and a window will be displayed allowing various parameters to be configured in a series of steps. For step 1, firstly choose the appropriate COM port that is being used on your PC and set the Baud Rate to 38400 baud. Next select the appropriate LPC2xxx device in use such as LPC2148. The "Interface" should be set to "None (ISP)". And finally for step 1 choose the appropriate Oscillator Frequency for the QuickStart board in use. This may be found in the board documentation, and is usually visibly readable on the surface of the oscillator on the board (in a metal package). For example for the LPC2148 USB QuickStart, the oscillator reads 12.000 indicating 12MHz.
For step 2, it is usually adequate to leave the option "Erase blocks used by hex file" checked,
and ignore the other settings. For step 3, you must select the program image to be
downloaded, in Intel HEX format. To program the pre-built GDB stub ROM image,
locate the file
gdb_module.hex in the
subdirectory of your release. To generate an Intel HEX format version of
an application you have built yourself run the following command at
a shell prompt:
$ arm-eabi-objcopy -O ihex app.elf app.hex
This converts the application image in ELF format (as output by the linker), to
Intel HEX format in the file
app.hex. Note that the arm-eabi
tools must be on your path at this point. If they are not, run the command below
before you run the above arm-eabi-objcopy command:
$ . /opt/ecos/ecosenv.sh
In step 4, it is recommended to set the option "Verify after programming". Finally it is possible to click on "Start" to program the image into the on-chip Flash.
If there is a problem communicating with the board, such as a report of a failure to autobaud, then this may imply that the Flash Magic tool was not able to control the serial lines properly. This can happen with some USB-Serial converters. For Prototype Board users, to workaround this issue, power the board off and remove (i.e. open) the two jumpers next to the serial port. Then simultaneously press the buttons marked 'Reset' and 'P0.14' on the prototype board (the latter corresponds to interrupt EINT1), then release the Reset button, and finally release the 'P0.14' button. This is an alternative mechanism of forcing the ISP firmware to be entered. Once this has been successfully performed, the programming operation may be retried from the Flash Magic utility.
When the process completes, remove (i.e. open) the two jumpers next to the serial port. If a GDB stub ROM image has been programmed, verify the programming has been successful by starting a terminal emulation application such as HyperTerminal on the host PC and set the serial communication parameters to 38400 baud, 8 data bits, no parity, 1 stop bit (8N1) and no flow control (handshaking). Reset the board and the stubrom should start. For boards programmed with GDB stubs the output should be similar to the following:
This is the stubrom attempting to communicate with GDB and indicates that it is functioning correctly.
Rebuilding the GDB Stub ROM
Should it prove necessary to rebuild the GDB Stub ROM binary, this is done
most conveniently at the command line. Your
ECOS_REPOSITORY environment variables must first be set correctly,
The following steps given an example of how to rebuild the stubs for a QuickStart board
$ mkdir stub_rom $ cd stub_rom $ ecosconfig new ea_quickstart_lpc2148 stubs $ ecosconfig resolve $ ecosconfig tree $ make
At the end of the build the
install/bin subdirectory should contain
gdb_module.img (ELF format),
gdb_module.srec (Motorola S-Record format),
gdb_module.bin (raw binary format), and
gdb_module.hex (Intel HEX format).
|eCosPro Non-Commercial Public License