UM0844
User manual
Getting started with SPEAr
®
Linux support package (LSP2.3)
Introduction
This manual provides application developers with a first introduction to the Linux-based
reference software installed in the Flash memory of the SPEAr evaluation boards. It is not
intended to be a tutorial on Linux operating system or embedded software design. It only
covers topics that are specific to the implementation on SPEAr embedded MPUs and
boards.
The purpose of the evaluation board software is to quickly and easily evaluate the
capabilities of SPEAr embedded MPUs, as well as to provide a starting point for the
software development for your own applications.
Note:
For information on downloading the SPEAr Linux Support Package (LSP2.3) from
www.st.com, refer to
Section 3.5 on page 25
October 2010
Doc ID 16544 Rev 3
1/38
www.st.com
Contents
UM0844
Contents
1
About this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2
The pre-flashed software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1
Host PC requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.1
2.1.2
Windows PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Linux PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2
2.3
2.4
2.5
2.6
Overview of Flash contents and structure . . . . . . . . . . . . . . . . . . . . . . . . 10
Booting up to the Linux prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Using a USB pendrive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Using a MMC/SD Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Entering the U-Boot resident monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.6.1
2.6.2
2.6.3
Information commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Environment commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Advanced commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.7
2.8
Connecting the evaluation board to a LAN . . . . . . . . . . . . . . . . . . . . . . . . 16
Updating the pre-flashed software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.8.1
2.8.2
2.8.3
Installing the USB flasher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Installing the Flash images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Updating the Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3
The SPEAr Linux Support Package (LSP2.3) . . . . . . . . . . . . . . . . . . . . 23
3.1
3.2
3.3
3.4
3.5
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Host PC requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
The stmyum tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
How to install the SPEAr Linux Support Package (LSP2.3) . . . . . . . . . . . 25
3.5.1
3.5.2
First-time installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Keeping the distribution updated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4
Working at application level (userland) . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.1
Workflow models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.1.1
Remote mounting of the root filesystem (NFS) . . . . . . . . . . . . . . . . . . . 27
2/43
Doc ID 16544 Rev 3
UM0844
4.1.2
4.1.3
Contents
Incremental changes to Flash filesystem . . . . . . . . . . . . . . . . . . . . . . . . 28
Flash filesystem full replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.2
4.3
Command line cross-development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Using the graphical IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.3.1
4.3.2
4.3.3
Launching ST Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Testing a simple application example . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Building a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4
4.5
Userland packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Rebuilding the root filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5
Working with customized kernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.1
5.2
5.3
Reconfiguring the kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Rebuilding the kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Workflow models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.3.1
5.3.2
Booting the kernel on-demand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Updating the kernel on Flash memory by U-Boot . . . . . . . . . . . . . . . . . 34
6
Rebuilding the bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.1
6.2
XLoader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
U-Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Appendix A Software license agreement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
A.1
A.2
A.3
A.4
A.5
A.6
A.7
A.8
A.9
A.10
A.11
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Ownership and copyright. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
No warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Limitation of liabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Applicable law and jurisdiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Severability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Waiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Relationship of the parties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Doc ID 16544 Rev 3
3/43
List of tables
UM0844
List of tables
Table 1.
Table 2.
Table 3.
Table 4.
List of abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Main toolchain commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Kernel configuration files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4/43
Doc ID 16544 Rev 3
UM0844
List of figures
List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Step-by-step approach to using the manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Tera Term configuration for serial port (Windows PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Minicom serial port configuration (Linux PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Flash memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
TCL download page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
USB flasher first screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Partition configuration dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Doc ID 16544 Rev 3
5/43