Name
Setup — Preparing the board for eCos Development
Overview
In a typical development environment, the board boots from the SPI NOR and runs the RedBoot ROM monitor from SDRAM. eCos applications are 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 RedBoot image into flash memory.
The following RedBoot configurations are supported:
Configuration | Description | Use | File |
---|---|---|---|
ROM | RedBoot loaded from SPI NOR flash to SDRAM | redboot_ROM.ecm | redboot_ROM.bin |
For serial communications, all versions run with 8 bits, no parity, and 1 stop bit at 115200 baud. RedBoot also supports Ethernet communication and flash management.
Note that the use of the term ROM for the initial RedBoot configuration is a historical accident. RedBoot actually runs from SDRAM after being loaded there from NOR flash by the on-chip boot loader. The use of ROM for this configuration is intended to indicate that it initializes the microprocessor and board peripherals, as opposed to the RAM configuration which assumes that this has already been done.
Initial Installation
The board comes with Windows CE installed by default. The booting mechanism is that the on-chip boot loader examines a set of switches and based on their settings, reads a header, initialization data and an application from the selected external device. It then executes the application at a given address. Possible boot devices include NAND flash, SPI NOR flash and an MMC/SD card. For eCos we use the SPI NOR flash.
To write RedBoot to the SPI NOR flash we need to run RedBoot and then use that to download and program an image to SPI flash. There are two ways to do this: use a JTAG debugger to load and run RedBoot under GDB, or use an MMC/SD card to load it.
Note | |
---|---|
The RedBoot image files referred to in the setup instructions below can
be found in the |
The following section describes this process using the Ronetix PEEDI; other JTAG emulators will have similar steps. The next section describes how to do this using an MMC/SD card. A third common section then describes how to use that RedBoot to initialize the SPI NOR flash and program RedBoot into it.
Programming RedBoot into NOR flash using the PEEDI
The following gives the steps needed load RedBoot using the PEEDI.
-
Set up the PEEDI as described in the Ronetix documentation. The
peedi.mcimx25x.cfg
file should be used to setup and configure the hardware. - Connect a null-modem serial cable between the serial port of the Debug board and a serial port on a convenient host. Run a terminal emulator (TeraTerm or minicom) at 115200 baud.
- Attach an Ethernet cable to the Personality board FEC socket, not the Debug board Ethernet socket. Make sure this is on the same network as the PEEDI and host.
-
Copy
redboot_ROM.img
to to a TFTP server on the same network as the PEEDI and MCIMX25WPDK board. - Apply power to the PEEDI.
Connect a telnet session to the PEEDI and power up the MCIMX25WPDK board. You should see something similar to the following output:
++ info: RESET and TRST asserted ++ info: TRST released ++ info: BYPASS check passed, 4 TAP controller(s) detected ++ info: TAP 0 : invalid IDCODE = 0x0 ++ info: TAP 1 : invalid IDCODE = 0x0 ++ info: TAP 2 : IDCODE = 0x07926041, ARM926E -> CORE0 ++ info: TAP 3 : IDCODE = 0x1B900F0F, ARM ETB ++ info: RESET released ++ info: core 0: initialized mx25>
Issue the following command, substituting your own TFTP server address:
mx25>>
mem load tftp://10.0.1.1/redboot_ROM.img bin 0x80000000
++ info: Loading image file: tftp://10.0.1.1/redboot_ROM.img ++ info: At absolute address: 0x80000000 loading at 0x80000000 loading at 0x80008000 loading at 0x80010000 loading at 0x80018000 loading at 0x80020000 ++ info: successfully loaded 149.00 KB in 0.59 sec mx25>Now set the CPSR to disable thumb mode (which the on-chip boot loader uses) and issue the go command:
mx25> set cpsr 0xd3 mx25> go 0x80008000
You should see output similar to the following on the board serial line:
+**Warning** FLASH configuration checksum error or invalid key Use 'fconfig -i' to [re]initialize database Ethernet eth0: MAC address 0e:00:00:ea:18:f0 IP: 10.0.2.4/255.0.0.0, Gateway: 10.0.0.3 Default server: 10.0.1.1 RedBoot(tm) bootstrap and debug environment [ROM] Non-certified release, version UNKNOWN - built 16:55:09, Apr 14 2014 Copyright (C) 2000-2009 Free Software Foundation, Inc. Copyright (C) 2003-2014 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: Freescale MCIMX25WPDK (ARM9) RAM: 0x80000000-0x84000000 [0x800318f8-0x83fed000 available] FLASH: 0x70000000-0x701fffff, 32 x 0x10000 blocks RedBoot>
Now go to this section to complete the installation.
Programming RedBoot into NOR flash using an MMC/SD card
The following gives the steps needed to load RedBoot using an MMC/SD card.
- Connect a null-modem serial cable between the serial port of the Debug board and a serial port on a convenient host. Run a terminal emulator (for example, TeraTerm or minicom) at 115200 baud.
- Attach an Ethernet cable to the Personality board FEC socket, not the Debug board Ethernet socket. Make sure this is on the same network as your TFTP server.
- Copy
redboot_ROM.img
to the TFTP server. - Locate an SD card whose existing content can be lost.
Using a suitable tool such as dd on Linux or an equivalent on Windows (e.g. dd for windows or win32 diskimager), write
redboot_ROM.img
into the first sectors of the SD card. For example, on Linux:$ sudo dd if=/path/to/redboot_ROM.img of=/dev/sdX
- Set the Personality board switches as follows: SW21 all off except switches 1 and 2; SW22 all off. On the Debug board SW5..SW10 should all be off and SW4 all off except 1 and 8 (these are the default settings).
Insert the SD card into the SD card socket on the Personality board and apply power to the board. You should see output similar to the following on the board serial line:
+**Warning** FLASH configuration checksum error or invalid key Use 'fconfig -i' to [re]initialize database Ethernet eth0: MAC address 0e:00:00:ea:18:f0 IP: 10.0.2.4/255.0.0.0, Gateway: 10.0.0.3 Default server: 10.0.1.1 RedBoot(tm) bootstrap and debug environment [ROM] Non-certified release, version UNKNOWN - built 16:55:09, Apr 14 2014 Copyright (C) 2000-2009 Free Software Foundation, Inc. Copyright (C) 2003-2014 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: Freescale MCIMX25WPDK (ARM9) RAM: 0x80000000-0x84000000 [0x800318f8-0x83fed000 available] FLASH: 0x70000000-0x701fffff, 32 x 0x10000 blocks RedBoot>
Now follow the instructions in the following section to complete the RedBoot installation.
Initialize and Install RedBoot
With a RedBoot now running on the board, the following steps are common between the two methods.
Run the following command to initialize RedBoot's flash file system and flash configuration:
RedBoot>
fis init
About to initialize [format] FLASH image system - continue (y/n)? y *** Initialize FLASH Image System ... Erase from 0x701f0000-0x701fffff: . ... Program from 0x83ff0000-0x84000000 to 0x701f0000: . 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.0.5 Network hardware address [MAC] for eth0: 0xec:0x05:0x00:0x00:0x02:0x24 GDB connection port: 9000 Force console for special debug messages: false Network debug at boot time: false Default network device: enet0_eth Update RedBoot non-volatile configuration - continue (y/n)? y ... Erase from 0x701f0000-0x701fffff: . ... Program from 0x83ff0000-0x84000000 to 0x701f0000: . RedBoot>Substitute your own IP addresses and domain name in place of those above. If multiple boards are to be run on the same network, also ensure that they have unique MAC addresses.
We now need to download a copy of RedBoot and program it into the flash. Give the following command to RedBoot, substituting in your tftp server's IP address:
RedBoot>
load -h 10.0.1.1 -r -b %{freememlo} redboot_ROM.img
Using default protocol (TFTP) Raw file loaded 0x80031c00-0x80056fff, assumed entry at 0x80031c00 RedBoot>Now program the RedBoot image to flash:
RedBoot>
fis create RedBoot
An image named 'RedBoot' exists - continue (y/n)? y ... Erase from 0x70000000-0x7003ffff: .... ... Program from 0x80031c00-0x80057000 to 0x70000000: ... ... Erase from 0x701f0000-0x701fffff: . ... Program from 0x83ff0000-0x84000000 to 0x701f0000: . RedBoot>- RedBoot installation is now complete. It is now necessary to set the board switches to select SPI NOR flash boot. Set the Personality board switches as follows: SW21 all off except switches 1, 2, 3, 4 and 7; SW22 all off. On the Debug board SW5..SW10 should all be off and SW4 all off except 1 and 8 (these are the default settings). If you have already booted via the MMC/SD card, you just need to move SW21 switches 3, 4 and 7 to on.
Disconnect the PEEDI or pop the SD card from the socket and power cycle the board. You should see output similar to the following on the serial line:
+Ethernet eth0: MAC address ec:05:00:00:02:24 IP: 10.0.2.9/255.0.0.0, Gateway: 10.0.0.3 Default server: 10.0.1.1 RedBoot(tm) bootstrap and debug environment [ROM] Non-certified release, version UNKNOWN - built 16:55:09, Apr 14 2014 Copyright (C) 2000-2009 Free Software Foundation, Inc. Copyright (C) 2003-2014 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: Freescale MCIMX25WPDK (ARM9) RAM: 0x80000000-0x84000000 [0x800318f8-0x83fed000 available] FLASH: 0x70000000-0x701fffff, 32 x 0x10000 blocks RedBoot>
If it proves necessary to re-install RedBoot, this may be achieved by repeating the load and fis create parts of the above process. It is not necessary to use a PEEDI, or an SD card, or to reinitialize the FIS and fconfig.
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 ROM version of RedBoot for the MCIMX25WPDK are:
$ mkdir redboot_mcimx25x_rom
$ cd redboot_mcimx25x_rom
$ ecosconfig new mcimx25x redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/arm9/mcimx25x/VERSION
/misc/redboot_ROM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make
At the end of the build the install/bin
subdirectory should
contain the files redboot.img
.
redboot.img
is a binary file that includes
the headers needed by the on-chip boot loader to load RedBoot
successfully.
Note | |
---|---|
The |
2024-12-10 | eCosPro Non-Commercial Public License |