Академический Документы
Профессиональный Документы
Культура Документы
User Manual
Introduction
The SPEAr Plus Linux SDK (Software Development Kit) enables ST customers and third
parties to exploit a reference embedded software platform, based on Linux OS, on top of the
SPEAr Plus development board.
The SDK is application-neutral and may be used for:
● evaluating Linux-based software architectures and performances for both the Head600
and Plus600 SPEAr SoCs;
● custom software development before a final customer’s hardware platform is available.
Contents
1 Reference documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 SDK contents summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Default configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
7 Other tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.1 Defining system RAM usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.2 Enabling the FPGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.3 Flashing firmware by JTAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2/31
UM0478 Contents
8 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3/31
List of tables UM0478
List of tables
Table 1. Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Table 2. SDK contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Table 3. U-Boot - information commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 4. U-Boot - memory commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 5. U-Boot - environment commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 6. U-Boot - other commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 7. Toolchain commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 8. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4/31
UM0478 List of figures
List of figures
5/31
Reference documentation UM0478
1 Reference documentation
6/31
UM0478 Introduction
2 Introduction
The SPEAr Plus Linux SDK (software development kit, referred as just “SDK” in the
following) enables ST customers and third parties to exploit a reference embedded software
platform, based on Linux OS, on top of the SPEAr plus development board [5].
The SDK is application-neutral and may be used for:
● evaluating Linux-based software architectures and performances for both the Head600
[6] and Plus600 [7] SPEAr SoCs
● custom software development before a final customer’s hardware platform is available
This document provides an overview of the software provided with the SDK and an
operational guide assisting the end user in performing most common practical tasks.
Technical details about specific software components may be found in corresponding
documents [2,3].
2.1 Acronyms
Table 1. Acronyms
Acronym Explanation
7/31
Introduction UM0478
8/31
UM0478 Introduction
It should be remarked that the SDK does not directly contain any cross-build ARM toolchain.
In order to use SDK 1.1 for custom software development, the open source ELDK 4.1
package, by Denx Software Engineering [11] must be used. This package (ISO image file)
may be downloaded free-of-charge from Denx Web site at following URL:
ftp://ftp.denx.de/pub/eldk/4.1/arm-linux-x86/iso/arm-2007-01-21.iso
An overview of the tools provided by the ELDK toolchain can be found in the corresponding
section of this document.
In this entire document, interactive commands are shown in courier bold font. The “#”
prompt is assumed for the Linux shell on the target board. The “$” prompt is assumed for
the Linux shell on the PC host. The “spearplus>” prompt is assumed for interaction with
the resident monitor (U-Boot).
9/31
Introduction UM0478
10/31
UM0478 Using the dev. board with pre-flashed software
Using the SPEAr Plus development board with pre-flashed software may be initially useful to
get a first feeling about the target hardware platform and the embedded Linux environment.
This step does not actually require the installation of the toolchain and the SDK. Only
software documents need to be extracted from the SDK package.
Note: if, for any reason, the development board would have no pre-flashed Linux SDK 1.1 software
but there is at least a working U-Boot monitor available, then a Flash update is initially
required; see [2] and [3] to store on Flash the SDK 1.1 kernel and root filesystem
respectively; as a final step, XLoader and U-Boot must be updated as described later in this
document; U-Boot environment settings must also be configured and saved as reported in
Appendix A; if the development board would have no software at all, see Section 7.3 for the
JTAG-based flashing procedure.
Basic user interaction with the development board may be performed through a simple serial
host-target link. Either a Windows PC or a Linux PC may be used for this purpose. In case of
issues with the serial connection, the following aspects should be considered:
● Check that the PC-side serial port (real RS232 or USB adapter) is properly configured
as 115200 bps, 8-N-1 mode, no flow control.
● Try to change the double jumper J14, located close to UART 0 DB9 connector on the
development board, by a 90-degrees rotation
11/31
Using the dev. board with pre-flashed software UM0478
7 - OFF
8 - ON
5. Switch on the target board and wait until the Linux shell prompt (the # character) is
displayed on the terminal emulator console. The bootstrap with this pre-flashed
software configuration would take just few seconds.
6. At this point, Linux commands may be interactively issued. For the list of default
supported commands and the overall filesystem structure see [3].
12/31
UM0478 Installing the development package
Developing custom software requires a full installation of the ARM cross-build toolchain
(ELDK 4.1) and the SPEAr Plus Linux SDK package. The installation is a pure PC-side
process, no development board or host-target link is required at this stage.
13/31
Installing the development package UM0478
14/31
UM0478 Installing the development package
[uboot-1.2.0]
Makefile
[board]
[common]
...
[xloader]
Makefile
[ddr]
[include]
...
[tools]
[jtag]
erase_nor.cmm
flasher.elf
init_ram.cmm
init_ram.elf
The build.sh shell script has to be used everytime a total or partial software rebuild is
required.
The [doc] folder includes all software-related documents in PDF format.
The [flash] folder contains pre-built binary images corresponding to the original software
pre-stored by ST in NOR Flash partitions for SPEAr Plus evaluation boards.
It also contains single bootImage.bin for flashing xloader, uboot, kernel and rootfilesystem
using single Image.By default Single Image is build using xloader at 266 MHz, uboot.uimg,
linux_uncomp.uimg and rootfs_uncomp.uimg. Single Image size is of 8 MB.
The [rootfs] folder is a predefined expanded root filesystem that can be used for mounting
through NFS.
Under the [src] subtree, the source code for all the main target components is found.
The [linux-2.16.9.2] source code tree contains the Linux kernel, including SPEAr Plus
specific extensions (e.g. device drivers) and adaptations.
The [rootfs-1.1.A] subtree provides all the required elements to configure and rebuild a root
filesystem, for both a flashed target (ext2) and the expanded version for NFS mounting.
The [uboot-1.2.0] source code tree contains the U-Boot loader and resident monitor,
including SPEAr Plus specific extensions and adaptations.
The [xloader] source code tree contains the ST-proprietary 1st-level boot loader called
XLoader.
The xloader can be build for DDR frequency 166 MHz as well as for 266 MHz.
The [tools] directory is intended to provide any other support tool. In SDK 1.1, a [jtag]
subtree is available containing scripts and ARM programs to support the flashing of boot
loaders using JTAG and the Lauterbach TRACE-32 toolset.
15/31
Installing the development package UM0478
16/31
UM0478 Flash memory and boot loaders
Booting the Linux environment on SPEAr Plus development boards is performed through
multiple steps, each one carried out by a different software component. After the execution
of an on-chip firmware known as BootROM, control is given to the XLoader software.
XLoader is a very small program assumed to be stored in the first sector (zero) of the serial
NOR Flash. XLoader is mainly in charge of initializing internal clocks and RAM controller
settings. After this tasks, it loads a more sophisticated component (U-Boot) that will act as
real resident monitor as well as the final boot loader for the Linux environment. Like
XLoader, U-Boot is actually OS-agnostic. However, the SDK documentation will mainly refer
to U-Boot features and configurations that are relevant to Linux.
On the NOR Flash, sector range 1-4 is reserved to the U-Boot partition. Since each sector is
64 KB, the maximum size of the resident monitor is 256 KB. This size also takes into
account a storage area for saving U-Boot settings (the so-called environment variables) in a
persistent way.
It is very important to assure that the XLoader and the U-Boot partitions are restored to
write-protected mode after any Flash update. Any unexpected writing access to such Flash
partitions will usually led to a system bootstrap failure. In fact, besides software updates,
there is no other case where writing to this partition is required. Write-protection, anyway, is
already performed by ST-provided scripts as discussed in the next sections.
17/31
Flash memory and boot loaders UM0478
8 MB NOR Flash
The default map has been designed to accommodate most common requirements. Of
course, such map may be modified according to different needs. However, this goal would
require a number of changes to various aspects of the entire solution:
● the linux-2.6.19.2\drivers\mtd\devices\spr_mtd_nor_partition.h
header file, where the partition table is statically defined (stwsf_par_info_primary
structure)
● the pre-defined U-Boot scripts that support flashing, for partitions where offset has
been modified (partition size is automatically managed)
Anyway, XLoader is basically fixed inside the single-sector 0. U-Boot size may be also
usually kept unmodified. Most likely changes will be related to enlarging or shrinking the
kernel and the root filesystem partitions, depending on specific applications and objectives.
Finally, the R/W partition could be removed at all, in case alternative solutions to writable
persistent storage (e.g. the on-board I2C EEPROM) are adopted.
Consult Appendix A of this document to fully restore default U-Boot settings in case of any
damage to them.
18/31
UM0478 Flash memory and boot loaders
1. Connect the target board to a PC using both a null-modem serial cable (the UART0
DB9 connector must be used) and an Ethernet cross cable or an Ethernet hub/switch.
2. Assure that the TFTP server is running on the PC and copy the xloader.uimg file to
the default TFTP server directory.
3. Launch a terminal emulator (HyperTerminal, minicom, etc.) on the PC. The PC serial
port must be set to 115200 bps, 8-N-1 mode, no flow control.
4. Check that dip switch SW3 on the board is configured as follows:
1 – OFF
2 – ON
3 – OFF
4 - OFF
Then switch on or just reset the target board.
5. From U-Boot prompt, execute the following command:
spearplus> run flash_xloader_eth
This will first start transfer the file from PC to the board over Ethernet. After the transfer,
the command will automatically proceed by completing all required steps for flashing
and verification.
An alternative to Ethernet for Flash updating is the use of a serial link and the Kermit
protocol. This approach is slower but still useful when an Ethernet link is not available. In
fact, the XLoader image is very small (maximum 64 KB), so a serial transfer may be still
convenient. A predefined U-Boot script (flash_xloader_uart) has been made available
as predefined on the development boards to minimize manual steps. In order to update the
XLoader partition with a new binary image using the serial link, the following procedure has
to be performed:
1. Connect the target board to a PC using both a null-modem serial cable (the UART0
DB9 connector must be used).
2. Launch a terminal emulator with Kermit support (HyperTerminal, minicom, etc.) on the
PC. The PC serial port must be set to 115200 bps, 8-N-1 mode, no flow control.
3. Check that dip switch SW3 on the board is configured as follows:
1 – OFF
2 – ON
3 – OFF
4 - OFF
Then switch on or just reset the target board.
4. From U-Boot prompt, execute the following command:
spearplus> run flash_xloader_uart
U-Boot is now waiting for a Kermit file transfer from the PC terminal. The
xloader.uimg file must be selected from a PC directory.
After the transfer is started on the PC, the command will proceed by transferring (using
Kermit) the file over serial cable and completing all required steps for flashing and
verification.
19/31
Flash memory and boot loaders UM0478
1. Connect the target board to a PC using both a null-modem serial cable (the UART0
DB9 connector must be used) and an Ethernet cross cable or an Ethernet hub/switch.
2. Assure that the TFTP server is running on the PC and copy the uboot.uimg file to the
default TFTP server directory.
3. Launch a terminal emulator (HyperTerminal, minicom, etc.) on the PC. The PC serial
port must be set to 115200 bps, 8-N-1 mode, no flow control.
4. Check that dip switch SW3 on the board is configured as follows:
1 – OFF
2 – ON
3 – OFF
4 - OFF
Then switch on or just reset the target board.
5. From U-Boot prompt, execute the following command:
spearplus> run flash_uboot_eth
This will first start transfer the file from PC to the board over Ethernet. After the transfer,
the command will automatically proceed by completing all required steps for flashing
and verification.
A predefined U-Boot script (flash_uboot_uart) has been made available as predefined
on the development boards to minimize manual steps. In order to update the U-Boot
partition with a new binary image using the serial link, the following procedure has to be
performed:
1. Connect the target board to a PC using both a null-modem serial cable (the UART0
DB9 connector must be used).
2. Launch a terminal emulator with Kermit support (HyperTerminal, minicom, etc.) on the
PC. The PC serial port must be set to 115200 bps, 8-N-1 mode, no flow control.
3. Check that dip switch SW3 on the board is configured as follows:
1 – OFF
2 – ON
3 – OFF
4 - OFF
Then switch on or just reset the target board.
4. From U-Boot prompt, execute the following command:
spearplus> run flash_uboot_uart
U-Boot is now waiting for a Kermit file transfer from the PC terminal. The uboot.uimg file
must be selected from a PC directory.
After the transfer is started on the PC, the command will proceed by transferring (using
Kermit) the file over serial cable and completing all required steps for flashing and
verification.
20/31
UM0478 Flash memory and boot loaders
Memory areas (including memory-mapped registers) may be read and written using the
following set of commands:
The most commonly used commands are md and mw, enabling manual access to hardware
register banks for testing purposes.
A specific subgroup of commands, very often invoked by end users, is related to the
management of environment variables. Such variables are string-type fields that may be
read and written, and may be also stored on Flash to guarantee their persistence across
system reboots. Some of these variables have a predefined purpose, but users may also
add their own custom variables.
Other frequently used commands are finally listed in the following table.
21/31
Flash memory and boot loaders UM0478
A detailed documentation about the described commands, as well as additional ones, may
be found in U-Boot specific documents.
22/31
UM0478 The cross-building toolchain
Knowing the details about the ARM cross-building toolchain is not strictly required in case of
software development limited to changes of XLoader, U-Boot or Linux kernel components
(e.g. device drivers). In fact, the rebuild procedure predefined by the SDK (build.sh)
performs all required tasks (by internally invoking toolchain commands) in a transparent
way.
On the other hand, at least a base knowledge of cross-building tools is needed by
application developers. The ARM toolchain is a set of programs, running on the PC host but
targeting ARM-related output, with support for:
● cross-compilation of source code to generate native object code for the ARM CPU
core(s) provided by the SPEAr Plus SoC
● cross-linking of ARM object code to generate executable programs, shared libraries
and binary images
● managing object code archives, incremental rebuilding and other auxiliary tasks
23/31
The cross-building toolchain UM0478
Only a few commands are frequently used by application software developers. The most
important of them are the C cross-compiler and linker (gcc), the archiver (ar) and utilities like
make, strip and readelf.
After a correct toolchain installation as explained in Section 4.2, the search path for
executable will be properly set so that such commands may be directly invoked with the
arm-linux- or the ${CROSS_COMPILE} or prefix.
The following example compiles a single C-language source file (example.c) to an ARM
object file (example.o):
$ arm-linux-gcc –c example.c
Usually an optimization flag is also added as shown in the following:
$ arm-linux-gcc –O2 –c example.c
In order to generate an ARM executable program called “myprog” (in standard ELF
format), starting from one or more object files, a command like the following may be used:
$ arm-linux-gcc –o myprog file1.o file2.o ... fileN.o
If a shared library is needed instead of an executable program, then the command is
modified as follows:
$ arm-linux-gcc –o mylib.so –shared file1.o file2.o ... fileN.o
If a static library is needed instead of an executable program, then a command like the
following is used:
$ arm-linux-ar rcs mylib.a file1.o file2.o ... fileN.o
The strip command may be used to reduce the size of an executable program by
removing the symbol table:
$ arm-linux-strip –s myprog
The readelf command is sometimes useful to check the header information of an ARM
file, for instance:
$ arm-linux-readelf –h myprog
24/31
UM0478 Other tasks
7 Other tasks
25/31
Other tasks UM0478
26/31
UM0478 Other tasks
27/31
Default U-Boot environment UM0478
For the sake of convenience, the full list of commands to be invoked from U-Boot in order to
restore the original default environment is reported in the following.
This is particularly useful when flashing the contents the first time for new development
boards, as well as when upgrading the U-Boot partition on Flash (since environment
variables will be lost on rewriting).
This listing takes into account all settings and scripts documented in software user manuals
[1], [2] and [3].
Each setenv assignment must correspond to a single text line to be entered.
setenv bootcmd bootm 0xF8050000
setenv bootargs console=ttyS0 quiet mem=64M root=/dev/mtdblock3
setenv fboot'setenv bootargs console=ttyS0 quiet mem=64M
root=/dev/mtdblock3 rootfstype=ext2;saveenv'
setenv nboot'setenv bootargs console=ttyS0 quiet mem=64M
root=/dev/nfs
nfsroot=192.168.1.1:/opt/splus_linux_sdk_1_1/rootfs;saveenv'
setenv flash_xloader_eth 'tftp 0x800000 xloader.uimg;protect off
1:0;erase 1:0;cp.b 0x800000 0xF8000000 ${filesize};protect on
1:0;imi 0xF8000000;saveenv'
setenv flash_xloader_uart 'loadb 0x800000;protect off 1:0;erase
1:0;cp.b 0x800000 0xF8000000 ${filesize};protect on 1:0;imi
0xF8000000;saveenv'
setenv flash_uboot_eth 'tftp 0x800000 uboot.uimg;protect off 1:1-
4;erase 1:1-4;cp.b 0x800000 0xF8010000 ${filesize};protect on
1:1-4;imi 0xF8010000;saveenv'
setenv flash_uboot_uart 'loadb 0x800000;protect off 1:1-4;erase
1:1-4;cp.b 0x800000 0xF8010000 ${filesize};protect on 1:1-4;imi
0xF8010000;saveenv'
setenv flash_linux_eth 'tftp 0x800000 linux${dbg}.uimg;protect off
1:5-47;erase 1:5-47;cp.b 0x800000 0xF8050000
${filesize};protect on 1:5-47;imi 0xF8050000'
setenv flash_linux_uart 'loadb 0x800000;protect off 1:5-47;erase
1:5-47;cp.b 0x800000 0xF8050000 ${filesize};protect on 1:5-
47;imi 0xF8050000'
setenv flash_root_eth 'tftp 0x800000 rootfs.cram;protect off 1:48-
126;erase 1:48-126;cp.b 0x800000 0xF81d0000 ${filesize};protect
on 1:48-126;cmp.b 0xF81d0000 0x800000 ${filesize}'
setenv flash_root_uart 'loadb 0x800000;protect off 1:48-126;erase
1:48-126;cp.b 0x800000 0xF81d0000 ${filesize};protect on 1:48-
126;cmp.b 0xF81d0000 0x800000 ${filesize}'
setenv init1 'mw fca80054 06100612;mw fca80050 06100012;mw fca80054
06102613;mw fca80050 06100013'
28/31
UM0478 Default U-Boot environment
29/31
Revision history UM0478
8 Revision history
30/31
UM0478
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZE REPRESENTATIVE OF ST, ST PRODUCTS ARE NOT DESIGNED,
AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS,
NOR IN PRODUCTS OR SYSTEMS, WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR
SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
31/31