St40 Stlinux: Distribution and Development Environment For St40 Platforms
St40 Stlinux: Distribution and Development Environment For St40 Platforms
Description Features
The ST40 STLinux distribution and development ■ Open source Linux operating system, tools and
environment provides everything required to build development environment based on Linux 2.6
Linux based systems for ST40-based platforms. kernel technology, ported and optimized for
ST40 based platforms.
The kernel can be ported to customer boards or
used directly on ST reference platforms. ■ Full set of drivers for basic system devices.
STLinux is compatible with higher level driver
STLinux is open source, delivered in both binary sets such as the STAPI drivers for A/V.
and source form, making it easy to extend and
enhance its capabilities for your specific platform. ■ Full C and C++ toolsets, based on GNU
compiler technology, for both native and cross
New kernel-space code (such as additional development from x86 Linux PCs.
device drivers) can be added. User-space
■ Full root file system with over 600 packages.
applications, written in ANSI C or C++, can take
advantage of the rich application level APIs ■ Das U-Boot boot loader for boot from Flash
provided by Linux. deployment.
A powerful set of cross development tools make ■ On-line network update management keeps
development easy. The tools include state-of-the- your installation up to date with the latest
art system analysis and trace tools. STLinux releases and updates.
■ On-line support and STLinux training courses
During development, STLinux supports a
available
convenient network based paradigm using ST
Micro Connect to download the kernel, and using ■ All STLinux software can be downloaded in
NFS to mount the root file system. binary and source form free of charge from the
STLinux web site www.stlinux.com
Application
User programs and applications
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Supported hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Supported targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 STLinux kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 STLinux tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 Code generation and object file tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Code analysis tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Other tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 STWorkbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6 STLinux support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7 Additional information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.1 System interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.2 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
8 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2/16 8153893
ST40 STLinux Introduction
1 Introduction
ST40 STLinux is the ST40 targeted variant of the STLinux range of Linux Distribution and
Development Environments (LDDE). These LDDE systems comprise:
● a Linux kernel based on the open source Linux 2.6 technology
– Board Support Packages for a wide range of ST40 reference platforms
– device drivers for on-chip and board level devices
● GNU code development tools for both cross development and native development
– hosted on x86 Linux PC or natively on target Linux platform
– GNU C and C++ compilers for ST40 Linux
– full glibc and reduced footprint uclibc C run-time libraries, with NPTL support
– GNU assembler, linker and other binary utilities
– GNU GDB user application debugger
– fully kernel aware GNU GDB cross-debugger interfaced to the target though ST
Micro Connect 1 or ST Micro Connect 2 using ST TargetPack technology
● dynamic kernel download tool
– ST Micro Connect 1 or ST Micro Connect 2 based JTAG kernel loader
– download and run STLinux, passing kernel boot-time parameters from host
– integrated with kernel-aware GDB debugger to debug downloaded kernel through
JTAG
● Das U-Boot boot loader
– download kernel and file system images to the target over either Ethernet or USB
– manage on-board NOR and NAND Flash resources for storing environmental
data, kernel images, file system images, and so forth
– boot from Flash, boot over network, and so forth
● advanced system analysis and trace tools
– based upon dynamic kernel probes inserted at run-time to trace kernel events
– low-overhead, capable of tracing an STB type system while it performs a normal
A/V decode without interfering with application function
● STWorkbench IDE
– based on the Eclipse IDE and compatible with STWorkbench products for other
ST toolsets.
– powerful source navigation and editing tools
– fully integrated with STLinux debug and trace tools
– ST40 STLinux specific plug-ins to customize the IDE for configuring, building,
downloading, debugging and managing STLinux systems
● Linux root file system
– populated with over 600 ST40 packages to provide a rich workstation like
development environment of tools, libraries, utilities and applications.
– hosted either over NFS or using a variety of file system types on IDE or SATA
HDD, USB mass storage, NOR or NAND Flash, and others
– provided in both glibc and uclibc based variants
– BusyBox based shell and basic utilities for low footprint deployment systems
8153893 3/16
Introduction ST40 STLinux
a. The first ST Micro Connect product was named the “ST Micro Connect”. It is now known as the “ST Micro
Connect 1” and the term “ST Micro Connect” is used to refer to the family of ST Micro Connect devices.
4/16 8153893
ST40 STLinux Introduction
(cross over) serial cable connects the serial port to one of the serial connections on the host
PC. Any host terminal emulation software (for example, Minicom) can then be used to
interact with the STLinux system console directly from the host PC.
Figure 1 shows how the various target connections are used in a system.
Network
Host-target interconnect
ST Micro Connect
Network
Serial connection
Connection
(System console)
(NFS)
Target system JTAG/LVDS cable
In addition to supporting the dynamic download of kernels and root file systems through the
ST Micro Connect, the STLinux distribution contains a version of Das U-Boot boot loader.
The boot loader itself can be downloaded to the target platform through the ST Micro
Connect and burnt into Flash memory on the board so that it runs automatically on platform
reset.
Das U-Boot supports the hardware bring-up of the board and can download other images
over the serial or ethernet target connections shown in Figure 1. Das U-Boot manages the
transfer of these images, such as STLinux kernels, root file system images, and so forth to
Flash and on reset can be configured to load the STLinux kernel image to RAM and pass
control to it with suitable parameters such that the entire system boots seamlessly and
automatically from a board level reset.
8153893 5/16
Introduction ST40 STLinux
6/16 8153893
ST40 STLinux STLinux kernel
2 STLinux kernel
The current STLinux kernel is a port of open source Linux kernel 2.6 to the ST40
architecture, with board support packages for a range of STMicroelectronics and customer
platforms. At the time of writing, the kernel is based on the kernel.org 2.6.23 release.
STMicroelectronics strives to track the evolution of the open source technology as closely as
is pragmatically possible, so the minor version number may change frequently.
STMicroelectronics maintains, enhances and optimizes the kernel from kernel.org
specifically for the ST40 processor and ST SoCs based upon it.
STMicroelectronics provides device drivers for generic IP on the ST40 SoCs and on the
target boards supported.
The kernel is delivered in multiple formats within the distribution.
● As a source RPM, which contains the original kernel.org tar-ball and a series of
patches containing the STMicroelectronics enhancements and optimizations for ST40
STLinux. This enables the relationship of ST40 STLinux to the baseline kernel.org tree
to be understood.
● As a binary RPM, which contains the fully patched kernel source tree in a form suitable
for immediate configuration and building for any supported platform. This enables users
to modify, configure and build the kernel themselves using the STLinux tree as their
baseline.
● As a series of binary RPMs, which contain pre-built kernels for all supported platforms.
These enable any of the supported platforms to be bootstrapped with STLinux OS
rapidly and reliably without requiring users to build their own kernels from scratch.
The kernel is supplied with a sophisticated kernel configuration system (Kconfig) and
kernel build system (Kbuild) to largely automate the process of specifying the kernel
configuration parameters (using tools such as menuconfig and Xconfig) and building the
configured resident kernel image (vmlinux) and any related modules specified in the kernel
configuration. The kernel build system can also be used to build any additional modules
implemented by the user against the appropriate kernel version and interfaces.
The kernel provides an abstract execution environment for application code, supporting
memory management, process management (processes, threads and interrupt
abstractions, synchronization primitives, and so forth), file systems, networking, abstractions
of character, block device control, interfacing, and so forth.
The Linux kernel supports a full virtual memory model in which user-space applications
operate in their own independent virtual address spaces, and presents an efficient, standard
kernel API to user-space applications.
STLinux has been optimized for ST40 and for use in embedded systems and supports fast
boot, power management, native POSIX threads, fast timers, and so forth.
The diagram on the front cover of this Data Brief shows the overall structure of the kernel in
abstract terms.
8153893 7/16
STLinux tools ST40 STLinux
3 STLinux tools
8/16 8153893
ST40 STLinux STLinux tools
STLinux supports the KPTrace kernel event tracing tools, which enables the user to
dynamically insert and monitor trace points within the kernel. Any arbitrary kernel symbol
can be monitored at low overhead and without rebuilding, or even stopping, the kernel. At
each event, information such as the time of occurrence and the stack back-trace can be
recorded and later analyzed graphically to examine the dynamic behavior of the complete
system. Trace points within an interrupt context are supported. Flight-recorder mode is
available, in which the most recent period of activity is stored in a circular buffer and can be
examined preceding an event of interest. This mode works even after a kernel crash since
the circular buffer is preserved and can be accessed using the JTAG port.
Additional system analysis tools are currently in development for STLinux.
The major tools components currently supported are:
sh4-linux-gdb GNU target debugger and front end to kernel
Kgdb GNU GDB front end to ST Micro Connect based kernel
debugger
st40load_gdb Kernel download and launch tool
sh4-linux-gcov GNU coverage tool
sh4-linux-gprof GNU profiling tool
oprofile System-wide profiler for Linux system
kptrace Kernel event tracing tool
System tools
● utilities to create file systems of various formats (mkfs.jffs2, mkfs.xfs, mkfs.ext2)
● utilities to manage Flash memory (flash_erase, flash_info, flash_lock, and others)
● configuration utilities (initdconfig, shellconfig, and others)
● specific interface utilities (i2cdetect, i2cset, and others)
● and many others
8153893 9/16
STLinux tools ST40 STLinux
3.4 STWorkbench
STWorkbench is built on the Eclipse IDE. The framework is extended using the CDT (C/C++
Development Tooling) and target specific plug-ins to enable the user to develop, execute
and debug STLinux applications interactively.
STWorkbench allows the user to import existing kernel build trees seamlessly into the
STWorkbench environment without disruption to the complex Linux KBuild system.
The STWorkbench environment uses the services of the running target directly to support
host based browsing and manipulation of the root file system, including the dynamic
installation and removal of kernel modules and user space applications built within
STWorkbench.
For development, STWorkbench supports the debug of the kernel itself, kernel modules and
user space applications using the appropriate debug tools through a common and powerful
GUI interface. STWorkbench also supports the profiling of the system with kptrace,
including powerful data visualization tools to help the user understand the trace data
captured.
See the STWorkbench Data Brief (ADCS 8063672) for more information.
10/16 8153893
ST40 STLinux STLinux root file system
The STLinux kernel is the executive core of the system, and responsible for process and
memory management, synchronization of concurrent activity, file systems, networking,
device abstraction, and so forth. However, most of what the user thinks of as an “operating
system” is not the kernel, but the many commands, utilities, libraries, shells, and other tools
that reside in the system root file system. As soon as the initialization of the kernel reaches
a point where it can run user-space code, control is passed to software within the root file
system.
The nature, extent and sophistication of the software in the root file system determines the
character of the final system. Consequently, to provide an efficient product, the developer
selects only the software that meets the specific needs of the system and discards the
remainder.
The opposite philosophy applies during development, when the developer benefits from
access to an extensive root file system. The STLinux approach is to provide a well
populated root file system for development, rich in tools and utilities. This enables the
developer to build and add additional software (including software acquired from the open
source community) and cross-build this software using the tools provided.
Using NFS to mount the root file system from the host gives the developer a rich
development environment on the target that is similar in scope to a full Linux workstation.
When the developed system is ready for deployment, the file system can be stripped down
to its bare essentials. At this stage, many standard utilities may be replaced with the low-
footprint BusyBox equivalent version; or glibc based utilities replaced with uclibc
equivalents. The file system can then be implemented as a RAM or Flash based file system
directly on the target.
8153893 11/16
Das U-Boot boot loader ST40 STLinux
The STLinux distribution includes a port of Das U-Boot, a standard open source universal
boot loader provided by Denx software. The purpose of Das U-Boot is to cold-boot an
STLinux based system from reset.
Like the kernel itself, Das U-Boot is delivered in several forms within the distribution.
● As a source RPM containing the original u-boot tar-ball and a series of patches
providing ST platform support.
● As a binary RPM containing the fully patched u-boot source tree in a form suitable for
immediate configuration and building on any supported platform, or porting to a new
platform as required.
● As a series of binary RPMs, which contain pre-built u-boot boot loaders for all
supported platforms.
Das U-Boot is copied onto Flash memory at the reset address of the CPU. When the board
is reset, the boot loader gains control and initializes the hardware, loads the kernel (and
optionally a file system) from Flash into RAM for execution. Das U-Boot can pass a user-
specified set of command line parameters to the kernel.
During development, Das U-Boot can be downloaded and run using the ST Micro Connect.
It can load kernels from serial, ethernet, HDD, USB mass storage or Flash. Das U-Boot
manages the platform Flash and can burn itself, the kernel and the kernel’s root file system
into Flash conveniently.
12/16 8153893
ST40 STLinux STLinux support
6 STLinux support
Support for the STLinux distribution is provided by the Bugzilla support database, hosted on
the bugzilla.stlinux.com website. Users can search the database of existing support
requests for relevant information, or send their own specific support request directly to the
STLinux development team. We aim to respond quickly and to resolve most requests in a
timely manner.
Before submitting a support request, please read the documentation and other information
provided on the main STLinux website at www.stlinux.com, as it is likely that the information
you require has already been provided.
8153893 13/16
Additional information ST40 STLinux
7 Additional information
7.2 Acknowledgements
Linux® is a registered trademark of Linus Torvalds.
Eclipse® is a registered trademark of the Eclipse Foundation
Red Hat® is a registered trademark and RPMTM and FedoraTM are trademarks of Red Hat
Software, Inc.
14/16 8153893
ST40 STLinux Revision history
8 Revision history
8153893 15/16
ST40 STLinux
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 AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT
RECOMMENDED, 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. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
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.
16/16 8153893