Sunteți pe pagina 1din 192

STMicroelectronics

STAPI SDK
User Manual

8214357 Rev C

May 2010

www.st.com
BLANK
User manual

STAPI SDK
Preliminary Data

Overview

The STAPI SDK provides a unified software development platform for a range of set-top box
(STB) devices and operating systems. In brief, the software stack consists of a set of low-
level STAPI drivers and an application layer. The application layer supports an in-built
diagnostic tool, testtool, that provides a wide range of testing and debugging functions.
This document provides a description of components of the STAPI SDK and information on
how to use the SDK to create applications for set-top boxes.
For more information about STAPI SDK, please contact your local STMicroelectronics FAE.

May 2010 8214357 Rev C 1/190


This is preliminary information on a product now in development or undergoing evaluation. Details are subject to change www.st.com
without notice.
Contents STAPI SDK

Contents

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Document identification and control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
License information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Conventions used in this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Acknowledgements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1 Hardware setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.1 Serial port connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.1.2 Configuring the ST Micro Connect 2 for serial data out . . . . . . . . . . . . . 10
1.2 Toolsets and other software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 Apilib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5 Patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.1 OS21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.2 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.6 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.7 Reporting issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2 Compiling and running STAPI SDK (OS21) . . . . . . . . . . . . . . . . . . . . . 14


2.1 Board configuration for MS Windows machine . . . . . . . . . . . . . . . . . . . . . 14
2.2 Board configuration for Linux/UNIX machine . . . . . . . . . . . . . . . . . . . . . . 15
2.3 Customized configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 Compiling STAPI SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5 Compiling the STAPI libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5.1 Object directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6 Compiling and linking the STAPI application . . . . . . . . . . . . . . . . . . . . . . 22
2.7 Running the STAPI application on the target . . . . . . . . . . . . . . . . . . . . . . 23
2.7.1 Configure the ST Micro Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.7.2 Running the software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2/190 8214357 Rev C


STAPI SDK Contents

2.7.3 Debugging the software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24


2.8 Compiling STAPI SDK for DUAL CPU (STi7108 SoC) . . . . . . . . . . . . . . . 25
2.8.1 Compiling for the real time processor (RT) . . . . . . . . . . . . . . . . . . . . . . 25
2.8.2 Compiling for the host processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.9 Running the software for dual CPUs (STi7108 SoC) . . . . . . . . . . . . . . . . 25
2.9.1 Single boot command mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.9.2 Individual boot sequence for host and real time processors . . . . . . . . . 26

3 Compiling and running STAPI SDK (STLinux) . . . . . . . . . . . . . . . . . . . 27


3.1 Clean current STLinux distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2 Installing STLinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2.1 Installation of STLinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2.2 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3 Applying the patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.4 Installation of Multicom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.5 Board configuration for STLinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.5.1 Customized configuration for STLinux . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.6 STAPI SDK makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.7 Building the kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.8 Compiling the STAPI SDK tree for Linux . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.8.1 Compiling the STAPI SDK tree for Linux with uclibc . . . . . . . . . . . . . . . 35
3.9 Running STAPI SDK for STLinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.10 Frame buffer and directfb support on Linux . . . . . . . . . . . . . . . . . . . . . . . 37

4 How to boot from Flash memory (STBlower) . . . . . . . . . . . . . . . . . . . . 38


4.1 Create the Apilib libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.2 Create a ROM image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.3 Burning the image to the board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.3.1 Creating the blower tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.3.2 Running the blower tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5 How to boot from Flash memory (U-Boot) . . . . . . . . . . . . . . . . . . . . . . 42


5.1 Compile and configure U-Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.2 Configure the kernel for “boot from Flash” . . . . . . . . . . . . . . . . . . . . . . . . 43

8214357 Rev C 3/190


Contents STAPI SDK

5.3 Build the root file system image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44


5.4 Burn the images onto Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

6 Create or modify a platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47


6.1 Creating a new platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

7 How to customize STAPI SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49


7.1 Video and audio firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.2 Multimedia playback support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

8 Testtool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8.1 Testtool scripting language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8.2 Common testtool commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.3 STAPI SDK testtool commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
8.3.1 Hard Disk Driver access commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
8.3.2 Audio based commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
8.3.3 Remote control commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.3.4 Blitter engine based commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
8.3.5 Close Caption commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
8.3.6 Clock recovery based commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
8.3.7 Cryptography commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
8.3.8 Cursor commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8.3.9 Demux commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.3.10 Digital Encoder (DENC) commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.3.11 Direct Memory Access (DMA) commands . . . . . . . . . . . . . . . . . . . . . . . 96
8.3.12 FLASH commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.3.13 File system commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8.3.14 FSK commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
8.3.15 Graphics based commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
8.3.16 Graphical User Interface (GUI) control commands . . . . . . . . . . . . . . . 112
8.3.17 High-Definition Multimedia Interface (HDMI) commands . . . . . . . . . . . 114
8.3.18 I2C interface commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
8.3.19 Internet Protocol (IP) commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
8.3.20 Keyscan based commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
8.3.21 PIO commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
8.3.22 Picture in Picture use case commands . . . . . . . . . . . . . . . . . . . . . . . . 127

4/190 8214357 Rev C


STAPI SDK Contents

8.3.23 Play commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129


8.3.24 Power management commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
8.3.25 POD commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
8.3.26 Pulse Width Modulated (PWM) signal commands . . . . . . . . . . . . . . . . 137
8.3.27 Recording commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
8.3.28 Rack commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8.3.29 SCART commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8.3.30 Smartcard commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
8.3.31 SPI commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
8.3.32 Subtitling commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
8.3.33 System commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
8.3.34 Table commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
8.3.35 Text commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
8.3.36 Trace commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
8.3.37 Teletext commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
8.3.38 Tuner commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
8.3.39 USB commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
8.3.40 Video commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
8.3.41 Video capture commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
8.3.42 Video mixer commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
8.3.43 Video out commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
8.3.44 Video timing generator (VTG) commands . . . . . . . . . . . . . . . . . . . . . . 169
8.4 Testtool examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
8.4.1 Displaying the denc colorbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
8.4.2 Displaying a graphic plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
8.4.3 Decoding a video stream from memory . . . . . . . . . . . . . . . . . . . . . . . . 173
8.4.4 Decoding an audio stream from memory . . . . . . . . . . . . . . . . . . . . . . . 173
8.4.5 Transcoding support in STAPI SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
8.4.6 Tuning the demodulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
8.4.7 Getting the classical DVB-SI information . . . . . . . . . . . . . . . . . . . . . . . 175
8.4.8 Decoding a live channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
8.4.9 Decoding a transport stream file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
8.4.10 Decoding and recording a live IP unicast/multicast stream . . . . . . . . . 176
8.4.11 Broadcasting a live or file transport stream over IP (unicast only) . . . . 177
8.4.12 Decoding a DirecTV stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
8.4.13 Decoding an A3 stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
8.4.14 Decoding teletext data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

8214357 Rev C 5/190


Contents STAPI SDK

8.4.15 Decoding subtitle data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179


8.4.16 Using the HD/SD capture features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.4.17 Using low power mode operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

9 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

Index of Testtool commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

6/190 8214357 Rev C


STAPI SDK Preface

Preface

Comments on this manual should be made by contacting your local STMicroelectronics


sales office or distributor.

Document identification and control


Each book carries a unique identifier of the form:
nnnnnnn Rev x
where nnnnnnn is the document number, and x is the revision.
Whenever making comments on this document, quote the complete identification
nnnnnnn Rev x.

License information
<To be supplied>

Conventions used in this guide


General notation
The notation in this document uses the following conventions:
● sample code, keyboard input and file names
● variables, code variables and code comments
● equations and math
● screens, windows, dialog boxes and tool names
● instructions

Hardware notation
The following conventions are used for hardware notation:
● REGISTER NAMES and FIELD NAMES
● PIN NAMES and SIGNAL NAMES

8214357 Rev C 7/190


Preface STAPI SDK

Software notation
Syntax definitions are presented in a modified Backus-Naur Form (BNF) unless otherwise
specified.
● Terminal strings of the language, that is those not built up by rules of the language, are
printed in teletype font. For example, void.
● Non-terminal strings of the language, that is those built up by rules of the language, are
printed in italic teletype font. For example, name.
● If a non-terminal string of the language is prefixed with a non-italicized part, it is
equivalent to the same non-terminal string without that non-italicized part. For example,
vspace-name.
● Each phrase definition is built up using a double colon and an equals sign to separate
the two sides (‘::=’).
● Alternatives are separated by vertical bars (‘|’).
● Optional sequences are enclosed in square brackets (‘[’ and ‘]’).
● Items which may be repeated appear in braces (‘{’ and ‘}’).

Terminology
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. The “ST Micro Connect 2” replaces the “ST Micro Connect 1”.
These names are abbreviated to “STMC”, “STMC1” and “STMC2”.

Acknowledgements
Microsoft®, MS-DOS® and Windows® are registered trademarks of Microsoft Corporation in
the United States and other countries.
Linux® is a registered trademark of Linus Torvalds.
Red Hat® is a registered trademark and RPMTM and FedoraTM are trademarks of Red Hat
Software, Inc.

8/190 8214357 Rev C


STAPI SDK Introduction

1 Introduction

The purpose of this manual is to provide comprehensive instructions on how to install,


compile and run the STAPI SDK libraries and application. It also contains instructions on
how to use the testtool diagnostic tool.

1.1 Hardware setup


The hardware required for a STAPI SDK development environment is as follows:
● a host PC (for compiling STAPI SDK)
● a development board (for testing and debugging the compiled STAPI SDK application)
● an ST Micro Connect 2(a) (which provides the physical interface between the host PC
and the development board)
● a USB cable or Ethernet cable (to connect the ST Micro Connect 2 to the host PC
directly or through a network)(b)
● an LVDS target board connection cable (to connect the development board to the ST
Micro Connect 2)(b)
Figure 1 gives an overview of the development environment.

Figure 1. STAPI SDK development environment

Toolset running on
Red Hat Linux
Enterprise or MS
Windows

Serial connection between


ST Micro Connect 2 and target

Host-target interconnect
Target System ST Micro Connect 2

a. The original ST Micro Connect product was named the ST Micro Connect. With the introduction of the ST Micro
Connect 2, the original product is now also known as the ST Micro Connect 1, and the generic term ST Micro
Connect refers to the family of ST Micro Connect devices. In this document, the names are often abbreviated to
STMC, STMC1 and STMC2. Both models of ST Micro Connect are supported by STAPI SDK, however, only
the ST Micro Connect 2 is currently supplied by STMicroelectronics.

b. Supplied with the ST Micro Connect 2.

8214357 Rev C 9/190


Introduction STAPI SDK

Both the development board and the ST Micro Connect 2 can be supplied by
STMicroelectronics. For further information, contact your local STMicroelectronics sales
office.

1.1.1 Serial port connection


To receive the debug output on a serial port (UART interface), connect the target board’s
serial output to the ST Micro Connect 2’s serial connector. Please refer to Table 1 for SoC
based mapping to different serial ports available on the target platforms.

Table 1. Ports to be used for serial output


Target board Port number
MB680 (7105) COM0 (Lower connector)
SDK7105_7105 (7105) COM0 (Only one connector)
MB411 (7109) UART0 (Lower connector)
MB618 (7111) UART0 (CN2 connector, closest to Smartcard)
MB704 (5197) UART1 (Upper connector)

1.1.2 Configuring the ST Micro Connect 2 for serial data out


To configure the ST Micro Connect 2 to receive the serial data output from the target board:
1. For Windows, check that the PATH variable includes the correct STMC bin path. (For
example: C:\STM\STMCR1.4.0\bin.)
2. At command prompt, enter the following command:
stmcconfig --ip <microconnect-ip> --serial-relay
The command returns a response similar to the following:
Starting serial relay : ip: <microconnect-ip> port: 5331
3. Run Telnet to receive serial output from the target board. Use the following command
syntax to specify the port number from the response at step 2. In this example, the port
number is 5331.
telnet <microconnect-ip> 5331
Note: Occasionally the Telnet command may result in an error message “connection refused”. In
this case, repeat the commands from step 2.

1.2 Toolsets and other software


To compile the STAPI SDK for a given core, make sure that the appropriate toolset for that
core is installed on the host PC. For example, the ST40 Micro Toolset is required to compile
STAPI for an ST40 core running OS21, and the ST200 Micro Toolset is required to compile
STAPI for an ST200 core. See the documentation provided by the toolset for information on
installing and using the toolset.
Note: The instructions in this user manual assume that a suitable toolset (or toolsets, in the case
of multicore SoCs) has been installed on the host PC and is running correctly. To obtain the
latest version of any STMicroelectronics toolset, please contact your local
STMicroelectronics FAE.

10/190 8214357 Rev C


STAPI SDK Introduction

The ST Micro Connect is supplied with the ST Micro Connection Package, which provides
software utilities and firmware for operating the ST Micro Connect.

1.3 Installation
STAPI is supplied as a compressed archive file. This is a ZIP file for MS Windows users, and
a gzip-compressed tar file for Linux users. The release notes for each version of STAPI
provides information on how to obtain the release, including the names of the archive files.
To install STAPI, uncompress the contents of the archive in a suitable location, using the
archive utility that is appropriate to the host operating system.
In this User manual, the root directory of the STAPI SDK installation is <SDK_ROOT> in
pathnames. This directory contains the following directories:
apilib/ This directory contains the source code of all the STAPI drivers. See
Section 1.4 for details.
bin/ The directory contains the configuration file (setenv.bat or
setenv.sh) and various other tools. It also contains the makefile for
compiling the STAPI SDK tree.
docs/ This directory contains the user documentation for STAPI SDK,
including this user manual.
stapp/ This directory contains all the initialization and set up files for the STAPI
drivers. The built STAPI executables are also located here.
stdebug/ This directory contains all the source files that define the testtool
commands.

The STAPI SDK is available for two different host operating systems: MS Windows or a
standard Linux distribution, such as Red Hat Enterprise Linux, or Fedora. The STAPI SDK
can be compiled to run on target platforms running either OS21 (with OSPlus) or STLinux.
● On a Linux host environment, STAPI SDK can be built for both OS21 and STLinux
targets.
● On an MS Windows host environment, STAPI SDK can be built for OS21 targets only.

Figure 2. Schematic representation of the STAPI SDK

testtool

stdebug/

stapp/ (STAPI application)

apilib/ (low-level drivers)

8214357 Rev C 11/190


Introduction STAPI SDK

1.4 Apilib
The apilib/ directory contains the low level drivers that provide an interface with specific
devices. The library consists of a number of different modules. A full list of the modules is
given in the release notes. Each module has its own API, which is documented separately.
Note: Not all drivers are applicable for all platforms. When using make to build the API libraries,
the makefile only builds those drivers that are applicable to the target platform that has
been specified.
The make apilib command generates a separate library (*.a file) for each of the
apilib/ modules. These are located in a sub directory of <SDK_ROOT>/apilib/lib
which is named for the target board, SoC type and operating system for which it has been
compiled. (See Section 2.5.1: Object directory on page 22 for details.)

1.5 Patches
For older versions of operating systems, toolsets or both, it may be necessary to apply
patches before compiling STAPI SDK. The release notes provide details of the patches that
are required for any given release of operating system or toolset.
Each STAPI SDK distribution includes the patches required for that distribution. The very
latest patch files can also be provided by your local FAE.

1.5.1 OS21
The patches for OS21 are provided as zip files, and are found in the
<SDK_ROOT>\bin\patches\os21\ directory. If a patch exists for a given version of
toolset, then it should be applied to that toolset before building the SDK.
There may be patches for specific SoCs. Patches only need to be installed for the SoCs that
you intend to use. See the release notes for more information.

1.5.2 Linux
STAPI_SDK is compatible with STLinux-2.3. However, the kernels of both versions of
STLinux must be patched with the appropriate patches included with the STAPI-SDK
distribution before being compiled. The patches for STLinux are provided as .tgz tarballs
and located in the <SDK_ROOT>/bin/patches/linux/ directory.
The release notes accompanying the STAPI SDK distribution provides full details of the
various versions of toolset and operating system that require patching. This is likely to
change for different revisions of STAPI SDK and different versions of each toolset and
operating systems.

1.6 Compilation
The STAPI SDK is provided in the form of source files that must be compiled for the required
target using the toolset that is appropriate for the platform. There are slight differences in the
compilation procedure, depending on whether STAPI SDK is being compiled on an MS
Windows or Linux host. The two compilation procedures are described in Chapter 2:
Compiling and running STAPI SDK (OS21) on page 14 and Chapter 3: Compiling and
running STAPI SDK (STLinux) on page 27.

12/190 8214357 Rev C


STAPI SDK Introduction

1.7 Reporting issues


This section will be provided in a later version of this user manual.

8214357 Rev C 13/190


Compiling and running STAPI SDK (OS21) STAPI SDK

2 Compiling and running STAPI SDK (OS21)

Following installation of the STAPI SDK package, the next step is to configure the
compilation environment for a specific target and then compile the libraries and the STAPI
application. This chapter describes these operations for a host running MS Windows
operating system.

2.1 Board configuration for MS Windows machine


Before compilation, the STAPI SDK environment must first be configured for a specific target
platform. The STAPI SDK installation includes a batch file for windows machine that
performs the required configuration. The batch file for MS Windows is called
<SDK_ROOT>\bin\setenv.bat.
Several of the environment variables in setenv.bat reference the paths of specific
directories on the host. Although the version of setenv.bat included in the STAPI SDK
distribution contains default values for the standard STAPI SDK and toolset installation, it
may be necessary to modify some of the environment variables to suit your particular
installation. In particular, the variable STSDKROOT must be set to <SDK_ROOT>, the root
directory of the STAPI SDK installation. Before running the batch file, check that the SET
commands listed in Figure 3 do correspond with the filepaths of the various toolsets and
other resources that are installed on the host system, and modify them if required.

Figure 3. Extract from setenv.bat


SET STSDKROOT=C:\STAPI_SDK
SET STPPROOT=C:\STM\STMCR1.4.0
SET ST40ROOT=C:\STM\ST40R4.4.0
SET ST200ROOT=C:\STM\ST200R5.1.0
SET OSPLUSROOT=C:\STM\OSPLUSR3.1.1
SET WORKBENCHROOT=C:\STM\STWORKBENCHR4.0.1

Note: If setenv.bat is run with incorrect file paths, the user must close the current DOS window
and open a new one before running the updated setenv.bat again.
Although environment variables are defined for the full range of toolsets, only the toolsets
required for the platforms you are working with need to be installed.
Note: 1 In most cases, OSPlus is mandatory if compiling for OS21.
2 Before running setenv.bat, either make sure that the <SDK_ROOT>/bin/ directory is in the
PATH, or run setenv directly from the bin directory.
To configure the STAPI SDK environment for a specific platform, run the configuration file as
follows:
setenv <platform>_<SoC>
where <platform> is the name of the board and <SoC> is the name of the backend SoC
that is mounted on that board. For example, to configure the environment for an MB680
board with an STb7105 SoC, enter the following:
setenv MB680_7105

14/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (OS21)

The batch file responds with the following message:


MB680_7105 Configuration selected!
Run setenv without any arguments to display a list of all the platform and SoC combinations
that it currently supports.
Note: The arguments passed to setenv.bat are case sensitive. Enter the arguments with
exactly the same capitalization as in the list generated by the setenv.bat script.
If a platform and SoC are specified, but setenv.bat outputs a list of all the platform and
SoC combinations it supports instead of giving the Configuration selected!
message, then either the configuration is not supported, or the platform and SoC names
were entered wrongly.

2.2 Board configuration for Linux/UNIX machine


Before compilation, the STAPI SDK environment must first be configured for a specific target
platform. The STAPI SDK installation includes a shell script file for UNIX or Linux machine
that performs the required configuration. The shell script for UNIX or Linux machine is called
<SDK_ROOT>\bin\setenv.sh
Several of the environment variables in setenv.sh reference the paths of specific
directories on the host. Before running the batch file, edit the export commands listed in
Figure 4 so that they correspond with the filepaths of the various toolsets and other
resources that are installed on the host system.

Figure 4. Extract from setenv.bat


export STSDKROOT=/opt/STM/STAPI_SDK
export STPPROOT=/opt/STM/STMCR1.4.0
export ST40ROOT=/opt/STM/ST40R4.4.0
export ST200ROOT=/opt/STM/ST200R5.1.0
export OSPLUSROOT=/opt/STM/OSPlusR3.1.1
export WORKBENCHROOT=/opt/STM/STWORKBENCHR4.0.1

Although environment variables are defined for the full range of toolsets, only the toolsets
required for the platforms you are working with need to be installed.
Note: 1 In most cases, OSPlus is mandatory if compiling for OS21.
2 Before running setenv.sh, either make sure that the <SDK_ROOT>/bin/ directory is in the
PATH, or run setenv directly from the bin directory.
To configure the STAPI SDK environment for a specific platform, run the configuration file as
follows:
source setenv.sh <platform>_<SoC>
where <platform> is the name of the board and <SoC> is the name of the backend SoC
that is mounted on that board. For example, to configure the environment for an MB680
board with an STb7105 SoC, enter the following:
source setenv.sh MB680_7105
The shell scripts responds with the following message:
MB680_7105 Configuration selected!

8214357 Rev C 15/190


Compiling and running STAPI SDK (OS21) STAPI SDK

Run setenv without any arguments to display a list of all the platform and SoC combinations
that it currently supports.
Note: The arguments passed to setenv.sh are case sensitive. Enter the arguments with exactly
the same capitalization as in the list generated by the setenv.sh script.
To compile STAPI_SDK for OS21 on Linux or Unix Machine, ensure that all the required
versions of tools as listed in Figure 4 are properly installed on the appropriate machine.
If a platform and SoC are specified, but setenv.sh outputs a list of all the platform and
SoC combinations it supports instead of giving the Configuration selected!
message, then either the configuration is not supported, or the platform and SoC names
were entered wrongly.

2.3 Customized configuration


The configuration file setenv.bat (or its equivalent in Linux and UNIX, setenv.sh) sets a
number of environment variables. It is possible to create a customized environment by
editing the values of these environment variables. This may be necessary, for example,
when using STAPI SDK for a platform not listed in the default configuration file.
Table 2 gives a list of the environment variables in setenv.bat and setenv.sh that are
common to all operating systems (OS21 and ST Linux) and which may be edited in order to
customize the configuration.

Table 2. Environment variables in setenv.bat and setenv.sh


Reference values
Variable (Refer to setenv.bat for Comments
complete list)

Always set this variable to 1 when compiling the


complete STAPI SDK tree.
STSDK 1 To get an apilib library without any dependencies with
<SDK_ROOT>/stapp/ or <SDK_ROOT>/stdebug/,
set this flag to 0.
This variable defines the path to the <SDK_ROOT>
STSDKROOT C:\STM\STAPI_SDK
directory.
This variable defines the path to the
STB5197ROOT %STSDKROOT%/apilib
<SDK_ROOT>/apilib directory.
This variable defines the path to the
DVD_MAKE %STB5197ROOT%/make
<SDK_ROOT>/apilib/make directory.
This variable defines the path to the
DVD_ROOT %STB5197ROOT%/src
<SDK_ROOT>/apilib/src directory.
This variable defines the path to the
DVD_EXPORTS %STB5197ROOT%/lib
<SDK_ROOT>/apilib/lib directory.
This variable defines the path to the
DVD_INCLUDE %STB5197ROOT%/include
<SDK_ROOT>/apilib/include directory.
This variable defines the path to the
DVD_CONFIG %STB5197ROOT%/config
<SDK_ROOT>/apilib/config directory.
stpti4 This variable defines the hardware transport interface.
DVD_TRANSPORT
stpti5 This is always set to either stpti4. or stpti5

16/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (OS21)

Table 2. Environment variables in setenv.bat and setenv.sh (continued)


Reference values
Variable (Refer to setenv.bat for Comments
complete list)

This variable defines the name of the hardware platform.


DVD_PLATFORM HDK7111 Refer to <SDK_ROOT>/bin/setenv.bat for the
complete list of the possible values
This variable defines the name of the backend chipset
used. Permitted values include: 7100, 7109,7105,
DVD_BACKEND 7105 7111, 7141,5197 or 5289. This list will be extended
as more backend SoCs are supported (see the release
notes for the most up to date list).
This variable defines the name of the SOC. This is used
DVD_BACKEND_SOCNAME 5189
when we have different SOC sharing the configuration
This variable gives the name of the front-end hardwares
used on the platform.
Permitted values include: STEM_299, NIM_299_6000,
NIM_288_6000, NIM_288_6110, NIM_899_6100,
NIM_399, NIM_900_6100,
NIM_900_6110,NIM_903_6100,NIM_903_6110,
NIM_360, NIM_361, NIM_362,NIM_370,
NIM_370_DTT7600,NIM_371,NIM_372,NIM_373,N
DVD_FRONTEND_TUNER NIM_900_6100 IM_297,NIM_297_MT2060, NIM_297E,NIM_297,
NIM_TS, or CUSTOM. This list will be extended as more
front-end tuners are supported (see the Release Notes
for the most up to date list).
Define a comma delimited list of tuners if there is more
than one tuner on the board.
Select NIM_TS for injecting the stream from packet
injector.
This variable defines the broadcast service used.
DVD_SERVICE DVB
Permitted values are DVB, DTV, A3, or NDS
This variable is set to either D_PAL or D_NTSC to set the
DVD_DISPLAY_SD D_PAL
SD output format of the decoder.
Set this variable to the appropriate format needed for HD
output. Permitted values are: NONE, D_1080I50HZ,
DVD_DISPLAY_HD NONE D_720P50HZ, D_576P50HZ, D_1080I60HZ,
D_720P60HZ, or D_480P60HZ.
To work in SD only mode, set this variable to NONE.
MODULES 0 Set this variable to 1 to use the modules/ services.
Set this variable to 1 to run the STAPI SDK tree with the
GUI 0
STGUI application.
Set this variable to 1 to enable DVR functionalities.
DVR 1 Note that you must recompile the whole tree (including
<SDK_ROOT>/apilib/) after changing the value of
this flag.
Set this variable to 1 if you have the OSPlus stack
OSPLUS 1 installed for the OS20 or OS21 operating systems.
Note that OSPlus is mandatory if DVR is set to 1.

8214357 Rev C 17/190


Compiling and running STAPI SDK (OS21) STAPI SDK

Table 2. Environment variables in setenv.bat and setenv.sh (continued)


Reference values
Variable (Refer to setenv.bat for Comments
complete list)

Set this variable to 1 to enable the USB interface.


For OS20 or OS21, OSPLUS must be set to 1 and the
USB 0
usblink libraries provided by OSPlus must be installed.
These libraries are not free of charge for OS20/OS21.
Set this variable to 1 to enable TCPIP support.
For OS20 or OS21, OSPLUS must be set to 1 and the
TCPIP 0
nexgen libraries provided by OSPlus must be installed.
These libraries are not free of charge.
Set this variable to 1 to compile STSDK in debug
mode.This Flag can also be used to activate and
deactivate the OS optimization level. If DEBUG=1, the
DEBUG 1
build will be performed with -O0 optimization level,
however if DEBUG=0, the Optimization level will be set
to -O2.
RUN_FROM_FLASH 0 Set this variable to 1 when compiling the ROM image.
This variable contains the name of the ST Micro
Connect target to be used. Otherwise enter the IP
address of the STMC, or the name by which the STMC
TARGET 10.199.44.83 is registered.
If the STMC1 is connected using USB, set this variable
to usb. (Not supported in case of STMC2)
This variable defines the architecture of the backend
ARCHITECTURE ST40
chipset. It can be ST40 or ST200.
Use this variable to define a different (that is, non-
standard) directory for platform definitions. When
DVD_PLATFORM_ROOT DVD_PLATFORM_ROOT is not defined, the path to the
platform directory is always
<SDK_ROOT>/stapp/platform/ by default.

18/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (OS21)

Table 3 lists those environment variables that are not part of setenv.bat(or setenv.sh
for Linux or UNIX), but are available to further customize STAPI SDK.

Table 3. Other environment variables


Reference values
Variable (Refer to setenv.bat Comments
for complete list)

Set this variable to 1 to link the SDK application with an


external main symbol. In this case, the SDK can be used as a
reference of driver initializations and an external application
STSDK_EXTERNAL_MAIN (such as HDI, for example).
This variable is not set by default in the standard SDK tree
release.
Use this variable to add a script to be loaded when running
the application on the target. The “filename” provided in this
variable is then loaded dynamically when uploading the code
DVD_START_SCRIPT to the ST Micro Connect. You can customize your debug
_EXTENDED script commands.
This variable is not set by default in the standard SDK tree
release.
Note: this works for the ST40 toolset only.
This variable applies to the ST40 toolset and OS21 only.
The value of this variable is the name of a file that has been
generated by compiling the OS21 libraries. The file is located
in:
%ST40ROOT%/sh-superh-elf/src/os21/lib/st40/
When linking the SDK application for the ST40 toolset and
OS21, the makefile checks this directory for a file with the
given name. If it does not exist, the makefile links the
OS_MODE application with the default libraries provided in the toolset
release. If the path exists, the makefile links the application
with the libraries identified by the file name.
A typical use for this variable is to define either
OS_MODE=encoded or OS_MODE=non_encoded to select
OS21 libraries with interrupts in encoded or non encoded
mode respectively.
This variable is not set by default in the standard STAPI SDK
tree release.

8214357 Rev C 19/190


Compiling and running STAPI SDK (OS21) STAPI SDK

Table 3. Other environment variables (continued)


Reference values
Variable (Refer to setenv.bat Comments
for complete list)

Use this variable to force the usage of STMC2 for old SoCs
like STi5100, STi7100 or STi7109. These SoCs are
configured for the STMC1 by default.
USE_TARGETPACK is set to 1 by default for newer chipsets
USE_TARGETPACK 1
such as the STi7111. When USE_TARGETPACK is set to 1,
you must install the ST TargetPack, if it is not yet done.
This variable is not set by default in the standard SDK tree
release for older SoCs like the STi7109.
This variable applies to the ST40 toolset only.
Use this variable to force the address mode of the ST40 core
to be with 29 or 32 . The default value (linked to the platform
setup) is selected in the .mak file of the platform, located in
DVD_ADDRESSMODE 32 the platform directory.
This variable is relevant for cores with ST40 architecture only.
This variable is not set by default in the standard SDK tree
release.

2.4 Compiling STAPI SDK


Compiling the STAPI SDK tree is a two stage operation.The first stage is to compile the
STAPI libraries, and the second stage is to compile the application itself and link it with the
STAPI libraries. The reason for the two stage compilation is because compiling the STAPI
drivers can be very time consuming.
For MS Windows, the STAPI distribution includes a copy of gmake.exe. The configuration
script setenv.bat automatically adds this executable to the PATH. Use this version of
make in preference to any other make program that may already be installed on the host.
All compilation activities are carried out from within the stapp/ directory. The STAPI SDK
makefile is located in this directory, so all make operations can be initiated from this
directory by typing gmake followed by the relevant target. A list of the available targets are
given in Table 4.

Table 4. Targets available with the STAPI SDK makefile


Target Description

help Display help text.


Compile stdebug -stapp and link it with the apilib
all
library.
Build with support for OS21 Trace and OS21 API
all OS21_TRACE=1 OS21_TRACE_API=1
Trace. (ST40 platforms only.)
Build with support for OS21 profiler. (ST40 platforms
all OS21_PROFILER=1
only.)
apilib Compile apilib library only.

20/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (OS21)

Table 4. Targets available with the STAPI SDK makefile


Target Description

Compile the specified module in the apilib


apilib MODULE=<module> directory. The release notes provide a full list of
module names for the current release of STAPI SDK.
stapp Compile contents of stapp directory only.
stdebug Compile contents of stdebug directory only.
Clean the stapp and stdebug directories for the
purge_all
currently specified platform.
purge Clean stapp directory only.
purge_apilib Clean apilib directory only.
purge_apilib MODULE=<module> Clean specified module in the apilib directory.
purge_stdebug Clean the stdebug directory only.
run Run the application without debug.
debug Debug the application with the standard debugger.
Debug the application with the console debugger.
debug CONSOLE=1
(ST40 architecture only)
Debug the application with STWorkbench. (ST40
debug STWORKBENCH=1
architecture and if STWorkbench installed only.)
debug_flash Start debug from flash.
rom Generate ROM image of the application.
rom ZIP-1 Generate ROM zip image of the application.
blower Compile the Flash blower application.
run_blower Run the Flash blower application.

Note: Combinations of targets are permitted. The following example is an acceptable gmake
command:
gmake purge_apilib purge_all apilib all run
gmake makes each of the named targets in the order in which they are given on the
command line, reading from left to right.
The following commands are available if the $(MODULES) variable is set to 1. (The default is
0.)

Table 5. Modules services commands


Command Description

modules Compile only MODULES directory


purge_modules Clean only MODULES directory

8214357 Rev C 21/190


Compiling and running STAPI SDK (OS21) STAPI SDK

2.5 Compiling the STAPI libraries


The gmake command for compiling the STAPI libraries is:
gmake apilib
This command builds all the modules in the <SDK_ROOT>/apilib/ directory and installs
the resulting object files so that they can be linked to the STAPI application.
To clean the apilib/ directory by removing all the intermediary files generated by an
earlier build, enter the command:
gmake purge_apilib
To compile a single STAPI driver, use the MODULE command line argument. For example, to
compile just the stvid driver, enter the command:
gmake apilib MODULE=stvid
To clean the files for a specific STAPI driver only, use the MODULE argument to the
purge_apilib command. For example, to clean the stvid driver directory, enter the
command:
gmake purge_apilib MODULE=stvid

2.5.1 Object directory


During the operation to build the STAPI libraries, make constructs a name for the directory
in which object files and the libraries are placed which includes some or all of the following
elements:
● target platform name (for example, mb618 or mb680)
● backend SoC name (for example, 7111 or 7105)
● operating system (OS21 or Linux)
● address mode (29 or 32)
For example, the library directory for the MB680 platform with 7105 backend has the path:
<SDK_ROOT>\apilib\lib\mb680_7105_ST40_OS21_32BITS
This means that if an application is generated on the same machine for different platforms,
the libraries and binary files for each platform are kept separate from one another.
Recompiling any item for one platform has no effect on the software already compiled for a
different platform. Also, the purge operation only removes files relating to the platform
currently selected, and leaves all the files relating to other platforms untouched.

2.6 Compiling and linking the STAPI application


When the apilib libraries have been compiled, the next step is to compile the STAPI
application itself.
The source files for STAPI are located in the <SDK_ROOT>\stapp\ directory. The gmake
command for compiling the application and linking it with the pre-compiled libraries is:
gmake all

22/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (OS21)

This generates an executable file in the stapp\ directory for the target with the name:
main_$(DVD_PLATFORM)_$(DVD_BACKEND)_(ARCHITECTURE)_(DVD_OS)_[29|32]
BITS.out
DVD_PLATFORM and DVD_BACKEND are the values of the %DVD_PLATFORM% and
%DVD_BACKEND% environment variables, as set by the setenv.bat batch file. This naming
convention ensures that is possible to build different applications for different platforms
within the same build environment.

2.7 Running the STAPI application on the target


When the STAPI SDK libraries have been compiled, the resulting executable can be run on
the target. The executable file is first transferred to the target using an ST Micro Connect.

2.7.1 Configure the ST Micro Connect


STAPI SDK supports both the ST Micro Connect 1 (STMC1) and the ST Micro Connect 2
(STMC2). The SoC determines which ST Micro Connect is selected as the default:
generally, the default for older SoCs (such as STi7109) is the STMC1 and the default for
newer SoCs (such as the STi7111) is the STMC2.
Note: If the environment variable USE_TARGETPACK is set to 1, then the system is forced to use
the STMC2, irrespective of the default. This is because only the STMC2 supports ST
Targetpacks.
Use the environment variable $TARGET to identify the ST Micro Connect to the system. If
you are using an STMC1 through a USB connection, then set $TARGET as follows:
set TARGET=usb
Note: The gmake tool is case-sensitive, so make sure that you enter usb as written, in lower case.
For the STMC2, set $TARGET to the IP address of the ST Micro Connect, or to a name that
can be translated into an IP address. For example:
set TARGET=192.168.1.101
or:
set TARGET=mystmc

8214357 Rev C 23/190


Compiling and running STAPI SDK (OS21) STAPI SDK

2.7.2 Running the software


Having configured the ST Micro Connect, the next step is to run the STAPI application on
the target. This is done by executing the following gmake command:
gmake run
The ST Micro Connect loads the software onto the target and runs it. The makefile
configures the connection.
Note: 1 When the application is running, it displays the testtool prompt. See Chapter 8 on page 51
for information on how to use testtool.
2 If the Windows Data Execution Protection system (DEP) has been switched on for gdb, this
may prevent gdb running executable code when gmake run is invoked. To prevent this,
ensure that the Windows Data Execution Protection system is switched off for gdb. This is
done in Control Panel > System > Advanced > Performance > Data Execution
Prevention.

2.7.3 Debugging the software


To run the application using the debug interface, enter the following command:
gmake debug
To run the application using the console debugger interface, enter the following command:
gmake debug CONSOLE=1
To run the application using STWorkbench, enter the following command:
gmake debug STWORKBENCH=1
This command launches STWorkbench with the appropriate command line parameters to
create a new STWorkbench project containing the STAPI executables. The application stops
at a breakpoint on the first line of the main() function.
Note: The CONSOLE and STWORKBENCH options are only available for ST40 based platforms. The
STWORKBENCH option is only available if STWorkbench is installed.

24/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (OS21)

2.8 Compiling STAPI SDK for DUAL CPU (STi7108 SoC)


To build the SDK components (APILIB, STAPP, STDEBUG and so forth) for dual CPU
devices like STi7108, complete the following tasks in the order given (that is, real time
processor first followed by the host).

2.8.1 Compiling for the real time processor (RT)


1. Complete the environment setup for the real time processor, as described in
Section 2.1 to Section 2.4.
2. Execute the following build command from the command prompt to build all the SDK
components:
gmake purge_all apilib all

2.8.2 Compiling for the host processor


1. Complete the environment setup for the host processor, as described in Section 2.1 to
Section 2.4.
2. Execute the following build command from command prompt:
make purge_all apilib all

2.9 Running the software for dual CPUs (STi7108 SoC)


There are two ways to execute and boot a device with dual CPUs, “single boot command
mode” and “individual boot sequence for host and real time processors”. Both are described
in this section.

2.9.1 Single boot command mode


In this mode, both the real time and the host processors are booted from a single command
window. This mode also uses a single command for launching the application.
To run the software in this mode, complete the following:
1. Open a command window and carry out the environment setup for the real time
processor.
2. Ensure that the board is connected to the JTAG interface and power is ON.
3. Generate binary code for the real time processor corresponding to the.out file
generated in Section 2.8.1 on page 25 using the command:
gmake rom
4. Execute either of the following commands from the command window (on the host
side). This copies the binary file corresponding to the real time processor on to the root
file system:
gmake all
or
gmake install

8214357 Rev C 25/190


Compiling and running STAPI SDK (OS21) STAPI SDK

5. For the host processor, perform the environment setup as described in Section 2.1 to
Section 2.4.
6. Execute the following command from the command prompt to boot the host processor:
make run_kernel
7. When the host processor has been booted successfully, load the modules. This
operation loads the real time binary (as generated at step 3.) at the same time.
8. Execute the application on the host processor. After the application has loaded
successfully, and the various components have been initialized, the testtool prompt
appears in the command window.

2.9.2 Individual boot sequence for host and real time processors
To boot the host and real time processor individually, use the following sequence:
1. Carry out the environment setup for the host processor as described in Section 2.1 to
Section 2.4.
2. Execute the following command to boot the host processor:
make run_kernel
3. Using a new command window, complete the environment setup for the real time
processor, and then (in the same command window) boot the real time processor using
the following command:
make run
4. The command window now displays a GDB prompt. Enter c to continue.
5. If a serial cable is connected, the command window now displays a testtool prompt.
This indicates that the real time processor has booted successfully.
6. When the real time processor has booted, load the modules from host window.
7. After this step execute the application on the host processor. The testtool prompt now
appears in this command window, also. Execute the application command from this
stage.

26/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (STLinux)

3 Compiling and running STAPI SDK (STLinux)

Following installation of the STAPI SDK package, the next step is to configure the
compilation environment for a specific target and then compile the libraries and the STAPI
application. This chapter describes these operations for a host running Linux.
It is not possible to build STAPI SDK for STLinux on a host that is running MS Windows XP.
STAPI SDK for STLinux can only be built on a host running a standard Linux distribution,
such as Red Hat Enterprise Linux, or Fedora.
Note: Information on the installation and operation of Linux on the host PC is beyond the scope of
this manual.

3.1 Clean current STLinux distribution


When installing STAPI SDK on a board that already has STLinux installed,
STMicroelectronics recommend that you first clean the entire installation to ensure that
there is no extra software installed that may interfere with the operation of the STAPI SDK.
For STLinux 2.3, the command for removing any currently installed rpm packages is:
rpm -qa | grep stlinux23
Within a bash shell, enter the following for STLinux 2.3:
rpm -e --nodeps ‘rpm -qa | grep stlinux23‘
rm -rf /opt/STM/STLinux-2.3
Under certain circumstances, the removal of some packages may fail due to script failures.
To prevent this happening, add the option --noscripts to the rpm command.
The following command line provides a more “verbose” output of the process to remove
packages:
rpm -qa | grep stlinux23 | xargs -i -t rpm -e --nodeps --noscripts {}

3.2 Installing STLinux


For generic instructions on downloading and installing STLinux, see the STLinux web page,
www.stlinux.com. A summary is given below in Section 3.2.1: Installation of STLinux.
Section 3.2.2 on page 29 and the following sections cover various points to be considered if
you are installing STLinux specifically for STAPI SDK.

3.2.1 Installation of STLinux


The installation package for STLinux 2.3 is located at ftp://ftp.stlinux.com/pub/stlinux/2.3/.
There is a README file at this location that gives current information concerning this
release of STLinux 2.3. This file also gives a link to the release notes.
There are two different methods for completing the installation: either download the ISO
image from the URL given above and then run the install script, or just download the
install script to a Linux host and complete the installation over the network.
You can download the files you require either through a web browser or using an FTP client.

8214357 Rev C 27/190


Compiling and running STAPI SDK (STLinux) STAPI SDK

Install from ISO image


There is an ISO image for ST40 cores (STLinux-2.3-sh4-03-11-07.iso). Download
the ISO image from ftp://ftp.stlinux.com/pub/stlinux/2.3/iso and save it to an appropriate
local directory.
The ISO image contains all the files you need to complete the STLinux installation. You can
either:
● burn this image to a CD-ROM (all standard CD-ROM tools are able to do this) and then
complete the installation by running the install script from the resulting CD
● install STLinux directly from the ISO image using a loopback device with the following
commands:
host# mkdir -p /mnt/cdrom
host# mount -o loop,ro -t iso9660 -r STLinux-2.2-sh4-03-11-07.iso /mnt/cdrom

Install script
To see a list of all the available installation options, including the current install profiles, run
the install script as follows:
./install --help
Install the profile that you want by giving it as a parameter to the install script. For example,
the following command installs all the packages for the ST40 architecture and glibc
toolchain.
./install all-sh4-glibc
To install the uclib toolchain in place of glibc, use the following command:
./install all-sh4-uclibc
Note: You must be the root user to install the distribution.
The installer uses stmyum, STMicroelectronics customized version of yum, to handle the
installation and dependency checking of RPM files. See
http://www.stlinux.com/drupal/node/60 for more information about stmyum.
Note: stmyum is configured by the file yum.conf. There is a different version of yum.conf
available to use if you are working inside the STMicroelectronics firewall, which configures
stmyum to use the internal file server. The configuration file can be downloaded from
http://www.stlinux.com/drupal/node/60.

Verify the installation


Verify that the installation was successful by inspecting the name of the Linux kernel.
ls /opt/STM/STLinux-2.3/devkit/sources/kernel -l
>linux-sh4 ->linux-sh4-2.6.23.1_stm23_0102
This means by default, the installation uses linux-sh4-2.6.23.1_stm23_0102.
The installation creates a root file system for the target, which includes device files and set-
uid programs.

28/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (STLinux)

Installing additional libraries


The instructions given above install a generic version of STLinux. The next step is to replace
certain packages with STAPI SDK-specific versions. The installation process is performed
using stmyum.
1. Edit the stmyum configuration file, yum.conf, to indicate that you want stmyum to
install the STAPI SDK specific packages. Do this by adding the following lines to
/opt/STM/STLinux-2.3/host/etc/yum.conf:
[STLinux_Distribution_STAPI]
name=STLinux Distribution 2.3 STAPI
baseurl=http://www.stlinux.com/pub/stlinux/2.3/stapi/RPMS
gpgkey=http://www.stlinux.com/pub/stlinux/2.3/STLinux/gpg_key
gpgcheck=0
2. Run stmyum with the update argument to install the latest STAPI SDK-specific
versions of the packages:
/opt/STM/STLinux-2.3/host/bin/stmyum update
This operation ensures that you have the very latest version of STLinux and STAPI SDK
installed.
The site http://www.stlinux.com/pub/stlinux/2.3/stapi/RPMS contains all the versions of
STAPI SDK that are currently available. If you wish to download an older release of STAPI
SDK you can do so from this site. It is also possible to list the available versions using
stmyum.
1. Add the option showdupesfromrepos=1 to the [main] section of
/opt/STM/STLinux-2.3/host/etc/yum.conf.
2. To list the available packages, run the stmyum command:
/opt/STM/STLinux-2.3/host/bin/stmyum list stlinux23-STAPI-kernel*

To install a library other than the default, use this stmyum command:
/opt/STM/STLinux-2.3/host/bin/stmyum install <stapi_package>
For example:
/opt/STM/STLinux-2.3/host/bin/stmyum install stlinux23-STAPI-
kernel-sh4-2.6.23.17_stm23_A25C-123

3.2.2 Troubleshooting
This section lists some common errors that may arise when installing or using STLinux:
● When calling stmyum update, the following error is reported:
ImportError: No module named cElementTree
This is due to an incompatibility between Linux on the host and the STLinux
distribution. Update the following RPM packages using stmyum:
stlinux22-host-python-celementtree-1.0.5-1.i386.rpm
stlinux22-host-yum-python2.2-2.6.1-10.i386.rpm
● When using ST40 toolset under a Linux environment, it cannot find a library call
libexpat.so.0
This is caused by sh4gdb looking for libexpat.so.0 in the /usr/lib directory. To
overcome this, create a symbolic link to the libexpat.so library as follows:
ln -s /usr/lib/libexpat.so /usr/lib/libexpat.so.0

8214357 Rev C 29/190


Compiling and running STAPI SDK (STLinux) STAPI SDK

3.3 Applying the patches


For an STLinux system, the first step is to compile a kernel to run on the target. STAPI SDK
is compatible with STLinux 2.3. Although it is necessary to apply patches to the kernel
before compilation. The names of the required patches and where they can be found are
given in the release notes.
Note: Some of the patches are mandatory and others are optional. Certain board-specific patches
must only be installed for the boards for which they are designed, and installing them for
other boards may cause problems. After untarring the patch file, consult the file
README.TXT for information about which of the supplied patches must be installed and
which must not.
The following listing is an example which applies all the patches with the extension
*.patch. The exact commands to execute for any given case depend upon:
● the directory structure of the installation
● the release of STAPI SDK
● the identity of the particular patches that are required
cd /opt/STM/STLinux-2.3/devkit/sources/kernel/linux-sh4

tar xzf <SDKROOT>/bin/patches/linux/linux-sh4-STAPI_2.6.23.17_stm23_A14-


117_patches.tgz

for i in linux-sh4-STAPI_2.6.23.17_stm23_A14-117_patches/*.patch; do patch -p0 -b <


"$i"; done

where <SDKROOT> is the installation directory of STAPI SDK.

3.4 Installation of Multicom


The Multicom package is required for STLinux. This is installed as follows:
cd /opt/STM
tar -zxf <SDKROOT>/bin/patches/linux/stm-multicom.323-3.2.3-noarch-patch-2.tgz

where <SDKROOT> is the installation directory of STAPI SDK.


Having completed the installation, then, if there are patches to install, the next step is to
apply them, as in the following example:
cd /opt/STM/MULTICOM/R3.2.3
tar xzf <STSDKROOT>/bin/patches/linux/multicom-3.2.3_patches.tgz
for i in multicom-3.2.3_patches/*.patch; do patch -p0 -b < "$i"; done

Note: 1 The above is an example. The path to the Multicom directory and the name of the patches
file may be different for your installation.
2 For uclibc enabled patches to be applied to Multicom, see <SDKROOT>/bin/patches.

30/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (STLinux)

3.5 Board configuration for STLinux


Before compilation, the STAPI SDK environment must first be configured for a specific target
platform. The STAPI SDK installation includes a batch file (for MS Windows) and a shell
script file (for Linux) that performs the required configuration. The shell script for Linux is
called setenv.sh and is located in the directory <SDKROOT>/bin.
There are certain environment variables in setenv.sh that must be modified to correspond
with your installation. These variables are:
● LINUX_TARGETIP (Target IP address)
● LINUX_SERVERIP (Server IP address)
● LINUX_GWIP (Network gateway IP address)
● LINUX_NETMASK (Network subnet mask)
● LINUX_NAME (The name of the host)
● LINUX_SERVERDIR (The path of the root of the target’s file system)
● LINUX_PARAMETERS (The kernel parameters for the host)
Also, it is important to check that the definition of the variable KDIR (path to kernel source
code) is correct, as the default value:
/opt/STM/STLinux-$LINUX_VERSION/devkit/sources/kernel/linux-sh4
may not be correct for all installations.
More details of the environment variables in setenv.sh are given in Table 2: Environment
variables in setenv.bat and setenv.sh on page 16 and in Additional Linux-specific
environment variables in setenv.sh on page 32.
To configure the STAPI SDK environment for a specific platform, ensure that
<SDKROOT>/bin is on the path, then run the configuration file as follows:
source setenv.sh <platform>_<SoC>_<LINUX>
where <platform> is the name of the board and <SoC> is the name of the backend SoC
that is mounted on that board. For example, to configure the environment for an MB411
board with an STb7109 SoC, enter the following:
source setenv.sh MB411_7109_LINUX
The batch file responds with the following message:
MB411_7109_LINUX Configuration selected!
Run setenv without any arguments to display a list of all the platform and SoC combinations
that it currently supports.
Note: The arguments passed to setenv.sh are case sensitive. Enter the arguments with exactly
the same capitalization as in the list generated by the setenv.sh script.
If a platform and SoC are specified, but setenv.sh outputs a list of all the platform and
SoC combinations it supports instead of giving the Configuration selected!
message, then either the configuration is not supported, or the platform and SoC names
were entered wrongly.

8214357 Rev C 31/190


Compiling and running STAPI SDK (STLinux) STAPI SDK

3.5.1 Customized configuration for STLinux


It is possible to create a customized environment by editing the values of these environment
variables. This may be necessary, for example, when using STAPI SDK for a platform not
listed in the default configuration file.
Table 2: Environment variables in setenv.bat and setenv.sh on page 16 gives a list of the
environment variables in setenv.sh that are common to all operating systems (OS21 and
ST Linux) and which may be edited in order to customize the configuration.
The Linux only version of the configuration file, setenv.sh, contains some additional
environment variables that are only applicable when running ST Linux on the target. These
variables are listed in Table 6.

Table 6. Additional Linux-specific environment variables in setenv.sh


Variable Default Value Comments

Use this variable to indicate that the SDK is to be


compiled for Linux.
DVD_OS LINUX The variable DVD_OS is not initialized for non-Linux
configurations (such as OS21) because the makfiles for
these operating systems already define the OS value
used by default.
Use this variable to define the root path of the Multicom
/opt/STM/MULTICOM/R3. source code. If this variable is not set, STSDK attempts
MULTICOM_SOURCE
2.3p2 to use the pre-compiled Multicom in the
apilib/multicom directory.
Use this variable to add the the Linux cross compiler in
the path (sh4-linux-*). Here the cross compiler is
/opt/STM/STLinux- installed in /opt/STM/STLinux-2.x/devkit/*.
PATH 2.x/devkit/sh4/bin:$P
For uclibc support, set this variable to the default
ATH
uclibc path:
opt/STM/STLinux-2.x/devkit/sh4_uclibc/*
/opt/STM/STLinux-
Use this variable to define the root path of kernel source
KDIR 2.x/devkit/sources/ke
code.
rnel/linux-sh4
Use this variable to define the path where all the STAPI
kernel objects and scripts are to be installed during the
/opt/STM/STLinux- SDK compilation process.
KTARGET 2.x/devkit/sh4/target
For uclibc support, set this variable to:
/root
/opt/STM/STLinux-
2.x/devkit/sh4_uclibc/target/root
Use this variable to define the version of the STLinux
distribution.The value given to this variable is used to
LINUX_VERSION [2.3]
construct path names needed to compile or run the
Linux distribution.
Set this variable to 1 to generate a compact unified
module of all the STAPI drivers. This variable is set to 1
LINUX_UNIFIED_STAPI 1 by default by the command line make apilib.
Note that this flag is mandatory for all platforms with a
system memory less than or equal to 64MBytes.

32/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (STLinux)

Table 6. Additional Linux-specific environment variables in setenv.sh (continued)


Variable Default Value Comments

This variable contains the IP address to be given to the


LINUX_TARGETIP 192.168.1.50
platform.
This variable contains the IP address of the NFS server
LINUX_SERVERIP 192.168.1.51 used by the platform. In most the cases, this is the IP
address of the Linux Host machine.
This variable contains the IP address of the network
LINUX_GWIP 192.168.1.254
gateway used by the platform.
This variable contains the network subnet mask used
LINUX_NETMASK 255.255.0.0
by the platform.
This variable contains the initial host name of the
LINUX_NAME stsdk
platform.
Set this variable to on to determine the IP address
LINUX_AUTOCONF off
automatically, using the DHCP server.
This variable contains the root of target’s file system,
that is the / directory of the platform.
/opt/STM/STLinux-
LINUX_SERVERDIR For uclibc support, set this variable to:
2.x/devkit/sh4/target
/opt/STM/STLinux-
2.x/devkit/sh4_uclibc/target
This variable contains the name of the kernel image to
LINUX_KERNEL $KDIR/vmlinux
be loaded by the ST Micro Connect.
Use this variable to define a text string that contains the
kernel parameters to be applied when starting the
kernel image. The string can be multi-line, as shown in
the example in Figure 5.
LINUX_PARAMETERS See Figure 5.
The parameters are platform dependant (like ttyAS0
which could be ttyAS0/ttyAS1/ttyAS2 depending
on the UART output used to display kernel console
traces).

Figure 5. Example of LINUX_PARAMETERS environment variable


LINUX_PARAMETERS = "console=ttyAS0,115200 \
root=/dev/nfs \
nwhwconf=device:eth0,hwaddr:00:FA:E0:FA:E0:00 \
nfsroot=$LINUX_SERVERIP:$LINUX_SERVERDIR,rsize=4096,wsize=8192,tcp \
ip=$LINUX_TARGETIP::$LINUX_GWIP:$LINUX_NETMASK:$LINUX_NAME::$LINUX_AUTOCONF \
bigphysarea=2000"

3.6 STAPI SDK makefile


All compilation activities are carried out from within the stapp/ directory. The STAPI SDK
makefile is located in this directory, so all make operations can be initiated from this
directory by typing make followed by the relevant target.
Table 4 on page 20 lists the makefile targets that are available in all operating systems (both
STLinux and OS21 with OSPlus).

8214357 Rev C 33/190


Compiling and running STAPI SDK (STLinux) STAPI SDK

For STLinux, the makefile accepts a number of additional targets. These are listed in
Table 7. The important targets are described in greater detail in the following sections.

Table 7. Targets available with the STAPI SDK makefile for STLinux
Target Description

Compile the Linux kernel without the configuration


kernel menu. The kernel is compiled with the default
configuration.
Compile the Linux kernel with the configuration menu.
kernel MENUCONFIG=1 The kernel is compiled with the configuration options
selected from the menu.
multicom Compile the Multicom Linux modules.
purge_kernel Clean the Linux kernel and the Multicom directories.
purge_multicom Clean only the Multicom directory.
Load the Linux kernel on the target (using the ST
run_kernel
Micro Connect) and run the kernel without debug.
Run the Linux kernel without debug and disconnect
run_kernel DETACH=1
from target.
Load the Linux kernel on the target (using the ST
Micro Connect) and run the kernel with debug.
debug_kernel The command can also be used to perform the debug
from the console with the following parameters :
debug_kernel CONSOLE=1
Process STAPI drivers to generate a unique
unify_stapi
module(1).
purge_unify_stapi Clean only unique module files generated(1).
Copy apilib modules and main.out to the relevant
install
installation directories.
1. These options are only available if Linux Unifired STAPI is installed.

3.7 Building the kernel


To build a new kernel for the target system, use the command make kernel.
Note: The make kernel command must be executed as the root user.
This operation builds the STLinux kernel using a kernel configuration file. The kernel
configuration files are located in the stapp/platform directory. make constructs the path
of the appropriate configuration file using the values of the DVD_PLATFORM and
DVD_BACKEND environment variables, according to the following template:
$(DVD_PLATFORM)/$(DVD_BACKEND)/linux/$(DVD_PLATFORM)_$(DVD_BACKEND)_kernel-2.3.cfg

For example, the configuration file for the kernel for the mb704 board with a STx5197 SoC
has the following path:
<SDK_ROOT>/stapp/platform/mb704/5197/linux/mb704_5197_kernel-2.3.cfg
make builds the kernel using the configuration defined in the selected .cfg file.

34/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (STLinux)

To customize the configuration, invoke make with the command make kernel
MENUCONFIG=1. This option displays the configuration menu; additional options for
configuring the kernel can be selected from this menu.
The target purge_kernel purges all the object files created by make kernel and also
cleans up the Multicom directories.
To debug the kernel, enter make debug_kernel. This command loads the kernel on the
target (using the ST Micro Connect referenced by the $TARGET environment variable) and
runs the kernel in the graphical debugger.
Note: The debug_kernel target uses the ddd (Data Display Debugger) interface.
ddd is not provided with STAPI SDK, but can be downloaded for free from
www.gnu.org/software/ddd/

3.8 Compiling the STAPI SDK tree for Linux


The process of compiling the STAPI SDK tree on Linux is a two step process:
1. Compile the apilib libraries with the command make apilib. This generates the
library files in the form of *.ko files, which are loaded dynamically when the kernel is
running.
2. Compile the STAPI application with the command make all. This operation generates
the *.out file, and also performs the make install step, copying all the relevant
modules to the final target directory (as specified by the $KTARGET environment
variable.
Note: Both the make apilib command and the make all command must be executed as the
root user.

3.8.1 Compiling the STAPI SDK tree for Linux with uclibc
Before compiling the STAPI SDK tree for Linux with uclibc support, the uclibc toolchain for
ST40 must first be installed (as mentioned in Section 3.2 on page 27). When this toolchain
is successfully installed, you will be able to see the path:
opt/STM/STLinux-$LINUX_VERSION/devkit/sh4_uclibc
Compile STAPI SDK as follows:
1. Set an additional environment variable:
CROSS_COMPILE=sh4-linux-uclibc-
2. Set the relevant environment variables PATH, KTARGET and SERVER_DIR to take
account of the uclibc path. (Refer to Table 6 on page 32 for details.)
3. Build STAPI SDK as described in Section 3.8.
4. The uclibc compliant library can be seen in the folder
STAPI_SDK/STAPP/playrec/<uclibc>. This library replaces the default library
delivered with the SDK (STAPI_SDK/STAPP/playrec/*) to make it uclibc
compliant.

8214357 Rev C 35/190


Compiling and running STAPI SDK (STLinux) STAPI SDK

3.9 Running STAPI SDK for STLinux


Note: The following example assumes that the host PC is the host of the the STLinux root
filesystem. Make sure that the filesystem of the host PC is visible to the target board on the
network before attempting to run STAPI SDK on the target. The path to the root of the visible
directories on the host is defined by the environment variable $LINUX_SERVERDIR; this
path must correspond with the host directory exported by NFS (that is, the path returned by
the showmount -e command).
1. Load the kernel onto the target and run it. This is initiated with the command make
run_kernel. The variable $TARGET provides the IP address of the ST Micro Connect
to use.
2. Open a console on the target board. This can be done by connecting to the ST Micro
Connect’s telnet port. The first step is to configure telnet on the ST Micro Connect
using stmconfig:
/opt/STM/STMCR1.5.0/bin/stmcconfig --ip <MicroConnect_IP> --serial-relay 0
115200 8 none 1 0 Starting serial relay : ip: <MicroConnect_IP> port: 5331

Note: The ST Micro Connect telnet port must be reconfigured using the above command every
time that the Micro Connect IP is restarted.
3. It is then possible to connect to the ST Micro Connect with telnet:
telnet <MicroConnect_IP> 5331
4. When the kernel has booted without reporting any problems, it displays a login prompt.
Enter the username root. There is no password.
5. The next step is to load the STAPI library modules. At the shell prompt, type:
source /root/modules/load_modules.sh
As the modules are downloaded to the target using the ethernet port, this operation
could take as much as ten seconds to complete.
If you want to run the STAPI SDK application in a different telnet session, open and log
in to that session, and then set up the environment with the command:
source /root/modules/load_env.sh
Note: The location of the filesystem root on the host PC is determined by the environment variable
KTARGET. See Table 6 on page 32.
6. To run the STAPI application, execute the .out file that was created in Section 3.8:
Compiling the STAPI SDK tree for Linux. For example, for an mb680 board with an
STx710x SoC, this file is:
/root/main_mb680_710x_ST40_LINUX_32BITS.out
When the application is running, it displays the testtool prompt. See Chapter 8 on
page 51 for more information about testtool.
An alternative method is to run STAPI in user space using gdbserver. In place of step 6.
above, invoke gdbserver on the target with the following command:
gdbserver <HostMachineIP>:5555 /root/main_mb411_710x_LINUX.out
On the host machine, enter make debug. This attempts to connect to the gdbserver
running on the platform.
Note: The debug target uses the ddd (Data Display Debugger) interface.
ddd is not provided with STAPI SDK, but can be downloaded for free from
http://www.gnu.org/software/ddd/

36/190 8214357 Rev C


STAPI SDK Compiling and running STAPI SDK (STLinux)

3.10 Frame buffer and directfb support on Linux


The STAPI SDK release for Linux includes a driver called stgfb that supports frame buffer
and directfb support. This driver is compiled and installed by default by the STAPI_SDK
standard compilation process. The frame buffer and directfb are not started by default when
booting the application, however; this is because stgfb uses internal resources of the STAPI
drivers that must first be initialized by the STAPI SDK tree.
1. Open two telnet sessions to the target.
2. In one, run the STAPI SDK application, as described in Section 3.9 on page 36.
3. In the other, enter the following commands:
source /root/modules/load_env.sh
source /root/modules/load_fb.sh [PAL,HD,FULLHD] [PAL]
The load_fb.sh script can accept zero or two parameters. With no parameters, the script
initializes one frame buffer on /dev/fb0 with a resolution of 720 by 576. (If required, edit
the script to set new defaults.)
With two parameters, the script configures two frame buffers in parallel: one for main high-
definition output and the other for auxiliary standard definition output. The first parameter
takes any of the following options:
PAL 720 x 576i at 50Hz
HD 1280 x 720 at 50Hz
FULLHD 1920 x 1080i at 50Hz

Enter PAL for the second parameter to configure the auxiliary output as 50Hz at 720 by 576
resolution.
It is also possible to modify the default parameters for directfb in the resources text file:
/etc/directfbrc.
After initializing the frame buffer, it is possible to run directfb applications, including:
df_andi
df_dok
df_knuckles
df_neo
Specify the frame buffer to use (that is, frame buffer /dev/fb1) with:
df_dok --dfb:fbdev=/dev/fb1
Run an Xserver on the target with the command:
Xfbdev

8214357 Rev C 37/190


How to boot from Flash memory (STBlower) STAPI SDK

4 How to boot from Flash memory (STBlower)

This chapter provides instructions and advice on how to compile a version of the STAPI
application that can be booted directly from Flash memory and how to burn the ROM image
generated to Flash memory.
All compilation activities are carried out from within the stapp/ directory. The STAPI SDK
makefile is located in this directory, so all make operations can be initiated from this
directory by typing gmake followed by the relevant target.
Note: 1 In this chapter, the example commands are given for hosts running MS Windows for a target
running OS21. When compiling on a Linux host for a target running OS21 or STLinux,
replace gmake with make.
2 For a target running ST Linux, either the STBlower (as described in this section) or the U-
Boot utility can be used to boot the Linux kernel. For the details on how to boot from Flash
using U-Boot, see Chapter 5: How to boot from Flash memory (U-Boot) on page 42.

4.1 Create the Apilib libraries


Compiling the STAPI SDK tree is a two stage operation.The first stage is to compile the
STAPI libraries, and the second stage is to compile the application itself and link it with the
STAPI libraries. The reason for the two stage compilation is because compiling the STAPI
drivers can be very time consuming.
The first step, therefore, is to compile the STAPI libraries. For MS Windows, this is done with
the following command:
gmake apilib
For more information about compiling apilib for OS21, see Chapter 2: Compiling and
running STAPI SDK (OS21) on page 14.
For more information about compiling apilib for STLinux, see Chapter 3: Compiling and
running STAPI SDK (STLinux) on page 27.

4.2 Create a ROM image


The next step is to create a STAPI application that can be run from Flash memory. Before
building the application, set the environment variable RUN_FROM_FLASH to 1.
In MS Windows, this is done as follows:
SET RUN_FROM_FLASH=1
The Make target for generating an image for Flash ROM memory is rom. The MS Windows
command for generating a ROM image is therefore:
gmake rom
The header file pokelist.h contains the poke list table for a specific platform. gmake
builds an executable using pokelist.h, if a file with that name exists in the following
directory:
<SDK_ROOT>\stapp\platform\<Platform>\<Backend>\bootrom

38/190 8214357 Rev C


STAPI SDK How to boot from Flash memory (STBlower)

If pokelist.h does not exist (which is the default condition), gmake attempts to establish
a connection to the board in order to extract the poke table from the ST TargetPack. It uses
the poke table to generate the pokelist.h header file.
Note: Connection to the board is achieved using the romgen tool supplied with the ST Micro
Connection package, revision 1.3.1 and later.
For ST40 and ST200 platforms, the executable has the name:
flash_$(DVD_PLATFORM)_$(DVD_BACKEND)_[29|32]BITS.bin

where:
<PLATFORM> the name of the platform, for example: MB680 or HDK7111
<BACKEND> the name of the SoC, for example: 7105 or 7111
<OS> the operating system, either OS21 or LINUX
<DERIVED_OBJS> the address mode, either 29BITS or 32BITS
For example:
flash_mb680_7105_OS21_32BITS.bin

Compressed ROM image


If compiling for ST40 SoCs running OS21, it is possible to create a zipped ROM image. The
zip file is then decompressed on the fly when the board boots. This is done with the
following Make command.
gmake rom ZIP=1

4.3 Burning the image to the board


The STAPI SDK provides a tool called blower to burn the ROM image to the Flash memory.
The blower tool runs on the platform and so must be compiled specifically for that platform.

4.3.1 Creating the blower tool


The tool only needs to be compiled once for each platform. The Make command for building
the blower tool is:
gmake blower
For ST40 and ST200 platforms, this creates an executable called:
blower_$(DVD_PLATFORM)_$(DVD_BACKEND)_[29|32]BITS.out
where $(DVD_PLATFORM) is the name of the platform and $(DVD_BACKEND) is the name
of the chip, for example :
blower_mb680_7105_OS21_32BITS.out

8214357 Rev C 39/190


How to boot from Flash memory (STBlower) STAPI SDK

4.3.2 Running the blower tool


When it has been compiled, use the blower tool to burn the ROM image to the Flash
memory on the platform.
For ST40 platforms, there is a customized GDB command file that initializes the ST Micro
Connect connection for a specified platform. The path to this file is:
stapp/platform/$(DVD_PLATFORM)/$(DVD_BACKEND)/$(DVD_PLATFORM)_$(DVD
_BACKEND)_blower_script.cmd
where:
$(DVD_PLATFORM) the name of the platform, for example: MB680 or HDK7111
$(DVD_BACKEND) the name of the SoC, for example: 7105 or 7111
To run the blower, use the following Make command:
gmake run_blower
All the functions of the blower tool can be accessed from a menu. See Figure 6.

Figure 6. Blower tool menu


================================================
STAPI_SDK - Flash programmer
(c) 2010 - ST MicroElectronics
================================================

Please, type:
1 - Program the flash using a binary file
2 - Compare flash content with a binary file
3 - Erase the content of the flash
4 - Dump the content of the flash to a binary file
5 - Quit
Choice ?> 2
romtool: Compare the flash
romtool: -----------------
romtool: Identifier of the flash to be verified (default value is 0, type
'.' for default) >? .
romtool: Name of the file to be loaded and to compare content of the flash
(default value is "flash_hdk7106_7106_ST40_OS21_32BITS.bin", type '.' for
default)
romtool: Address from where to start comparison (default value is
0x00000000, type '.' for default) >? .

Note: 1 The file names given in the menu options are customized according the the selected
platform, using the file naming scheme described in Section 4.2 on page 38.
2 Building STAPI SDK with default parameters generates a .bin file. This means that option
2 in the blower tool menu is the one that is most commonly used.
3 At the romtool prompt, if you want to proceed with the default option, type . (read as dot) on
the prompt as shown in Figure 6.

40/190 8214357 Rev C


STAPI SDK How to boot from Flash memory (STBlower)

Choose an option from this menu. When blower has finished, it automatically disconnects
itself from the platform.
Select 7 - Quit to quit the blower tool.
To check that the operation has been successful, reset the board and check that the
application does boot from the Flash memory.
Note: STMicroelectronics recommend that you disconnect the ST Micro Connect from the board
before resetting. For some boards, the STMC may prevent the application from booting.
To use the testtool interface with the application, make sure that you have a terminal linked
using an RS232 to the relevant UART port on the board. See Chapter 8 on page 51 for more
information on the testtool.

8214357 Rev C 41/190


How to boot from Flash memory (U-Boot) STAPI SDK

5 How to boot from Flash memory (U-Boot)

For a target running STLinux, booting from Flash requires the U-Boot utility. U-Boot is a
multi-platform, open-source, universal boot loader with extensive support for loading and
managing boot images. Further information about U-Boot can be found at:
http://www.stlinux.com/drupal/u-boot. This web page provides detailed instructions on using
U-Boot and includes the most up-to-date configuration information.

5.1 Compile and configure U-Boot


The following instructions configure U-Boot for the memory map of the STx7111. For other
SoCs, it may be necessary to adjust some of the configuration details.
1. Download the U-Boot source code RPM from the ST Linux site:
ftp://ftp.stlinux.com/pub/stlinux/2.3/updates/SRPMS.
2. Extract the code from the RPM in the path:
opt/STM/STLinux-2.3/devkit/sources/u-boot/
3. If patches are required, apply them to the source code now.
4. It is possible that there may be updates for new cut versions of silicon. To check if there
are, go to the U-Boot directory:
/opt/STM/STLinux-2.3/devkit/sources/u-boot/u-boot-sh4-
1.3.1_stm23_0042
5. Open the file ~/include/configs/mb618.h and edit the CFG_BOOTMAPSZ
parameter as follows:
CFG_BOOTMAPSZ 0x8000000
6. In the same file, make sure CFG_SDRAM_BASE is set correctly:
– for 32-bit mode (SE = 1), set it to 0x80000000
– for 29-bit mode (SE = 0), set it to 0x8C000000
7. Ensure that PATH variable includes the directory:
/opt/STM/STLinux-2.3/devkit/sh4/bin
8. Run make to clean up the build environment:
Sh$> make distclean
9. Run make to configure the build environment for STx7111:
Sh$> make <config>
where <config> is mb618_config for 29-bit mode or mb618se_config for 32-bit
mode.
Note: A table of all permitted configuration names is provided in the STLinux website at:
http://www.stlinux.com/drupal/u-boot/compiling?q=node/228.
10. Build the files u-boot and u-boot.bin:
Sh$> make
11. Copy the files u-boot and u-boot.bin to the target directory.
/opt/STM/STLinux-2.3/devkit/sh4/target

42/190 8214357 Rev C


STAPI SDK How to boot from Flash memory (U-Boot)

This operation creates two similarly named files. It is important not to get them confused.
● The file u-boot is an ELF file which runs on the target system, but is never written to
Flash. GDB uses this file to download U-Boot.
● The file u-boot.bin is a raw binary file. This is the file that is burned directly to Flash
memory and executed at boot time.

5.2 Configure the kernel for “boot from Flash”


1. Go to the kernel directory and edit the .config file to correspond with the memory
map.
2. Run make with the following command to display the menuconfig configuration menu:
Sh$> make ARCH=sh CROSS_COMPILE=sh4-linux-menuconfig
3. Using the menu, select the following features:
– Device drivers > Block devices > RAM disk support
– General Setup > Initial RAM filesystem and RAM disk (initramfs/initrd)
support
– File systems > Second extended fs support
4. For 32-bit mode, set CONFIG_ZERO_PAGE_OFFSET to 8 Mb. If
CONFIG_ZERO_PAGE_OFFSET is greater than 0x1000, install the patch
locate_initrd.patch on the Linux kernel to detect ramfs image.
5. Recompile the kernel, as follows:
Sh$> make clean
Sh$> make ARCH=sh CROSS_COMPILE=sh4-linux-vmlinux
This creates the vmlinux file.
Note: It is also possible to compile the kernel from the /stapp directory using the SDK tree. See
Section 3.7: Building the kernel on page 34.
6. Next, compress and make an image of the kernel.
Sh$> sh4-linux-objcopy -O binary vmlinux vmlinux.bin
Sh$> gzip vmlinux.bin
7. Set the PATH variable for using the mkimage tool.
Sh$> export PATH=/opt/STM/STLinux-2.3/host/bin:$PATH
Sh$> mkimage -A sh -O linux -T kernel -C gzip -a 0x80800000
-e 0x80801000 -n "Linux 2.6" -d vmlinux.bin.gz vmlinux.ub
This creates the image vmlinux.ub.
Note: 1 For 32-bit mode, 0x80800000 is the load address and the entry point for the kernel is
0x80801000. These addresses are different for different kernels. These addresses can be
found in the System.map file available in the kernel directory. The mkimage tool is
available in /opt/STM/STLinux-2.3/host/bin directory. Before executing the
command make sure that the path to this directory is set.
For 29-bit mode, the load address is 0x8c801000 and the entry point is 0x8c802000.

8214357 Rev C 43/190


How to boot from Flash memory (U-Boot) STAPI SDK

2 If there is any doubt as to the values to be used for the -a (load address) and -e (execute
address) parameters, use the following command to extract the correct value of the execute
address from the vmlinux file:
Sh%> sh4-linux-objdump -f vmlinux | grep '^start address ' | awk '{print $3}'
Use the following command to extract the correct value of the load address:
Sh%> sh4-linux-objdump -h vmlinux | grep .empty_zero_page | awk '{print $4}'
8. Copy vmlinux.ub to the target directory:
/opt/STM/STLinux-2.3/devkit/sh4/target

5.3 Build the root file system image


The file /opt/STM/STLinux-2.3/host/share/linuxshmkimg/ramfs.txt contains
a list of all the files that are to be included in the root file system image. This includes all the
*.ko files and any other files that the application requires.
1. Edit the file ramfs.txt to make sure that all the required files are included.
2. Open the file rcSBB located in the following directory:
/opt/STM/STLinux-2.3/devkit/sh4/target/etc/init.d/
Add the commands required for running the application to this file.
3. Go to /opt/STM/STLinux2.3/host/bin and give the command for making the
ramdisk image. (The command must be entered in a single line.)
Sh$> linuxshmkimg --ramdisk=16384
--rootPath=/opt/STM/STLinux-2.3/devkit/sh4/target
--script=/opt/STM/STLinux-
2.3/host/share/linuxshmkimg/ramfs.txt /tmp/ramdisk.img
Note: The above command assumes that 16384 (blocks), one block being 1 Kb in size, is greater
than actual (physical) size of ramfs (ram file system). If the file system is more than
16384 Kb in size, change this value so that it is appropriate for the file system.
Caution: Do not use the current version of insmod (part of BusyBox) as this tool has a problem when
inserting Multicom modules. This BusyBox bug is due to be fixed in BusyBox release 1.8.2-
22.
4. Run mkimage to create the file ramdisk.ub, as follows:
Sh$> mkimage -C none -A sh -O linux -T ramdisk -a 0x81000000
-n "ST40 Linux ramdisk" -d /tmp/ramdisk.img ramdisk.ub
Note: The address 0x81000000 is normally 8 Mb beyond the kernel load address. For 29-bit
mode, use 0x8D000000 instead.
5. Copy ramdisk.ub to the target directory:
/opt/STM/STLinux-2.3/devkit/sh4/target
All three elements that are required to boot from Flash have now been created. The final
step is to burn these images to Flash.

44/190 8214357 Rev C


STAPI SDK How to boot from Flash memory (U-Boot)

5.4 Burn the images onto Flash


There are a range of different methods available for downloading the images to Flash
memory. This section, however, only covers the most popular method: nfs.
Although it is possible to burn an image straight into Flash, it is generally safer to load the
image into the target’s RAM first and burn it into Flash from there. The following procedure
uses this second approach.
1. From the exported target directory, enter the command:
Sh$> sh4-linux-gdb
2. In GDB, enter the following commands to load U-Boot into the target’s RAM.
(gdb)> sh4tp mytargetip:mb618:st40<,seuc=1>
(gdb)> load /opt/STM/STLinux-2.3/devkit/sh4/target/u-boot
(gdb)> continue
Note: sh4tp is the command to perform the connection to the target. In the options to this
command, mytargetip is the IP address of the target. Add the optional argument seuc=1
for 32-bit mode only.
3. When u-boot has been loaded, the HyperTerminal window shows the command
prompt:
MB618>
4. At this prompt, set the appropriate environment variables, as follows:
MB618> set ipaddr <board_ip_addr>
MB618> set netmask <your_net_mask>
MB618> set serverip <your_server_ip>
MB618> set gatewayip <your_gateway_ip>
MB618> set ethaddr <your mac_addr>
5. Load u-boot.bin into the RAM of the target board using nfs, as follows:
MB618> nfs $load_addr
$serverip:/opt/STM/STLinux-2.3/devkit/sh4/target/u-boot.bin
Note: The file u-boot.bin must be is a directory exported by the NFS server and accessible to
the target board.
6. Unprotect and erase sectors 0 to 4 of bank 1 in Flash:
MB618> prot off 1:0-4
MB618> era 1:0-4
7. Load u-boot.bin from RAM to Flash and protect the sectors in Flash:
MB618> cp.b $load_addr 0xa0000000 $filesize
MB618> prot on 1:0-4
Note: The variable $filesize is set automatically when the file is loaded into RAM. This value
must be less than the size of unprotected and erased sectors.
8. Load the kernel binary into sectors 6 to 23 of bank 1 of Flash:
MB618> nfs $load_addr
$serverip:/opt/STM/STLinux-2.3/devkit/sh4/target/vmlinux.ub
MB618> prot off 1:6-23
MB618> era 1:6-23
MB618> cp.b $load_addr 0xa0060000 $filesize
MB618> iminfo 0xa0060000
MB618> prot on 1:6-23

8214357 Rev C 45/190


How to boot from Flash memory (U-Boot) STAPI SDK

9. Load the Ramdisk image into sectors 27 to 63 of bank 1 of Flash:


MB618> nfs $load_addr
$serverip:/opt/STM/STLinux-2.3/devkit/sh4/target/ramdisk.ub
MB618> prot off 1:27-63
MB618> era 1:27-63
MB618> cp.b $load_addr 0xa0300000 $filesize
MB618> iminfo 0xa0300000
MB618> prot on 1:27-63
10. Set the bootargs and the bootcmd variable of the U-Boot environment:
MB618> set bootargs console=ttyAS0,115200 root=/dev/ram0
ramdisk_size=16384 mem=128M bigphysarea=2000
MB618> set bootcmd bootm a0060000 a0300000
11. Save the environment variables:
MB618> saveenv
12. Disconnect the ST Micro Connect and reset the board. The board boots and runs the
application from Flash.

46/190 8214357 Rev C


STAPI SDK Create or modify a platform

6 Create or modify a platform

The standard distribution of the STAPI SDK contains everything that an engineer requires to
generate the STAPI application on a wide range of standard STMicroelectronics platforms.
All the files that are specific to any given platform are located in the “platform” directory,
which has the following path:
<Platform_Root>\<Platform>\<Backend>
where:
<Platform_Root> by default, this is <SDK_ROOT>\stapp\platform, but can be
changed by setting the $(DVD_PLATFORM_ROOT) environment
variable to a different path.
<Platform> the name of the platform, for example: MB680 or HDK7111
<Backend> the name of the SoC, for example: 7105 or 7111

The platform directory for any given platform and backend combination contains the
following files and sub-directories.
● A platform-specific header file, which defines memory mapping, STAPI task priority and
interrupt levels for the platform. The header file has a .h extension.
● A makefile that defines all the platform specific compile options. The makefile has a
.mak extension.
● A configuration file, which is read when booting STAPI SDK using an ST Micro
Connect. This file configures on-chip peripherals such as clocks, memory, EPLDs and
so forth. The configuration file has a.cmd extension.
● A directory called bootrom, which contains all the code necessary to boot the STAPI
application from Flash memory.
● A directory called targetpack, which contains the ST TargetPack definition for the
platform.
● An optional directory called linux, which contains code specific to the STLinux build
of STAPI for the selected platform
The platform directory may also contain other files that are linked to the toolset and
environment used for the platform.
A complex network of dependencies exist between these files and other files in the STAPI
SDK tree. Therefore, if a change is made to any detail or parameter within these files, it may
have multiple impacts on a range of files throughout the tree. Therefore, if a change is made
to a platform-specific file, STMicroelectronics recommend that the entire STAPI SDK tree is
purged and recompiled.

8214357 Rev C 47/190


Create or modify a platform STAPI SDK

6.1 Creating a new platform


To compile STAPI for a new (that is, currently unsupported) platform, follow the instructions
given below.
1. The first step is to create a name for the new platform, based on the
<Platform>_<Backend> convention used for the existing platforms. This name is
used within the source code to identify sections of code to be conditionally compiled for
the new platform.
2. Identify which of the currently supported platforms comes closest to the new platform in
terms of core, SoC, memory and other features.
3. Search the source code in the stapp, stdebug and apilib directories for any
section of conditionally compiled code that relates specifically to the platform identified
at step 2.
4. Modify the code to ensure that these sections of code are also compiled for the new
platform, using the name devised at step 1.
5. Make a copy of the entire platform directory for the platform identified at step 2., and
then modify the file names to correspond with the name of the new platform.
6. Update the files in this directory so that they are correctly defined for the new platform.
7. Update the environment variables so that they specifically reference the new platform,
using the name devised at step 1.
Following this, try compiling the modified code and monitor the results. Depending on how
similar the new platform is to the original, supported platform, it may be possible to continue
using the STAPI SDK without any further modifications. If the software fails to compile, or if it
does not perform as expected, then further modifications to the files in the platform directory
may be required.

48/190 8214357 Rev C


STAPI SDK How to customize STAPI SDK

7 How to customize STAPI SDK

7.1 Video and audio firmware


For SoCs that have embedded audio or video processors or accelerators, STAPI SDK
provides video and audio firmware for playing audio and video files in a number of common
formats. However, the provided firmware can only support a subset of the different formats
available, so it may be necessary to acquire additional firmware and integrate it within the
STAPI SDK tree.
Note: To obtain firmware for specific audio and video formats, contact your ST FAE.
The firmware is typically supplied as a *.bin file which is loaded by STAPI at boot time.
STAPI looks for the firmware files in the following directories:
● for audio codecs: stapp\mbx\audio
● for video codecs: stapp\mbx\video
Install the firmware by copying the .bin files into the relevant directory and renaming them
to correspond with the appropriate naming convention.
Note: When LX_FIRMWARE_FROM_JTAG is set to 1, the firmware files on the host are loaded onto
the platform using the JTAG interface. This means that the codecs cannot be loaded if the
application boots from Flash.

7.2 Multimedia playback support


To activate the media player feature in the SDK, first ask your ST FAE for the
stapi_sdk_plugins package and then complete the following steps:
1. Starting with the official, default SDK, remove the directory
$STSDKROOT/stapp/playrec as follows:
rm -rf $STSDKROOT/stapp/playrec
2. From the stapi_sdk_plugins package, copy the playrec directory into
stapp/playrec:
cp -Rf ~/stapi_sdk_plugins/PLAYREC/STAPI_SDK-REL_XX/playrec $STSDKROOT/stapp
3. From stapi_sdk_plugins, copy the OPENSOURCE directory into stapp/playrec:

mkdir $STSDKROOT/opensource
cp -Rf ~/stapi_sdk_plugins/OPENSOURCE/* $STSDKROOT/opensource

8214357 Rev C 49/190


How to customize STAPI SDK STAPI SDK

4. Figure 7 shows the directory hierarchy for STAPI SDK after the changes in the previous
steps have been made.

Figure 7. Directory hierarchy for media player

5. Finally, build the complete SDK in the usual manner:


gmake apilib
gmake all
To play a .mkv or an .avi file, execute the playprog command from the testtool interface,
as shown in the following example, which plays the file /mnt/files/movie.mkv:
testtool> playprog 0 "/mnt/files/movie.mkv"

50/190 8214357 Rev C


STAPI SDK Testtool

8 Testtool

The testtool interface provides a command shell that enables the user to enter a test
command and then monitor the output. A complete list of the testtool commands that are
currently implemented is provided in Section 8.2 on page 54. The commands that directly
invoke features in the STAPI application are listed in Section 8.3 on page 70.
The testtool command language is also a fully functional scripting language, containing all
the features needed to create scripts to provide repeatable and verifiable test scenarios. The
features provided include conditional commands (IF, ELSE, and ELIF), loops (FOR and
WHILE), the ability to procedurize blocks of code (DEFINE) and to return values from
procedures (EXIT). The scripting language is described in Section 8.1.
Note: For all OS21 systems, it is mandatory to use the UART interface when using testtool. The
performance of the JTAG interface with testtool is exceptionally poor and can cause an
ST40 or ST200 core to freeze long enough to introduce latency in real time threads. For
OS20 systems, the problem is less damaging, but there are still distinct advantages to using
the UART interface.
When connected using the UART interface, testtool provides a simple command history
feature, similar to the command history of UNIX and Linux command shells. The commands
for accessing the command history and editing command lines are as follows:
Up key Move up in the command history
Down key Move down in the command history
Tab key Auto-completion of commands, macro, or file names (files only if file
system mounted)
Ctrl+A Go to beginning of line
Ctrl+K Delete chars to end of line
Insert key Toggle between insert/replace mode
!! Execute previous command
history Display command history
!n Execute history command number n

Short form commands


It is not always necessary to type out the full name of a command; the testtool interface
recognizes short forms of most commands. The requirement is that enough letters must be
provided in order to make the command unambiguous; for example, PR is acceptable for
PRINT as there are no other commands that begin with the letters “PR”.

8214357 Rev C 51/190


Testtool STAPI SDK

8.1 Testtool scripting language


The testtool scripting language provides the ability to define repeatable and verifiable test
scenarios. Scripts (in the form of text files) are loaded into testtool using the SOURCE
command. The current state of testtool (including symbols and macro definitions) can be
saved using the SAVE command and then reloaded later using SOURCE.
A testtool script contains a sequence of testtool commands. A script can contain
statements to allow for conditional execution (the IF, ELIF and ELSE commands that will be
familiar to anyone who has used any high-level programming language) and looping (using
WHILE and FOR commands, which are also used the same way as in other scripting or
programming languages). Each block of statements within a branch of a conditional
statement or within a loop is terminated with an END statement.
The syntax of the scripting language will be familiar to anyone who has experience with any
scripting or programming language.

Testtool configuration
The command CONFIG_TESTTOOL enables testtool users to configure basic testtool
parameters to suit specific environments and requirements. For more details on how to use
this command, see CONFIG_TESTTOOL on page 56.
The following parameters can be configured using CONFIG_TESTTOOL.
● The number of characters that testtool needs to match in variable names to consider
those names to be identical. (The default is 2.)
● By default, testtool commands do not return a result. A CONFIG_TESTTOOL parameter
causes testtool commands to return an error value in case of failure.

Comparison operators
The IF, ELIF and WHILE commands recognize the following comparison operators.
> greater than
< less than
== equal to
!= not equal to
>= greater or equal
<= less or equal

Any comparison that evaluates to zero equates to a logical FALSE; any other value equates
to a logical TRUE. Comparisons cannot be nested or combined with logical operators (in
other words, there are no AND or OR operators). However, IF and ELIF commands
themselves can be nested.
Note: Comparisons between floating point values are performed only on the integer part of the
value; therefore 5.3 == 5.5 evaluates to TRUE.

Variables
Variables can be created within scripts in order to store data items. A variable is created
when it is first named in the script.

52/190 8214357 Rev C


STAPI SDK Testtool

The scope of a variable only extends to the block of code within which it was created.
Therefore, variables created within a macro are always local to that macro. Use the EXIT
statement to return a value to the calling process.
A variable created manually at the command prompt has global scope, and is available until
the testtool is closed down.
Note: Any testtool variable used for numerical operations has an upper storage limit. If a value is
assigned to a variable that overflows this limit, the value can be truncated.

Comments
Comments can be included in testtool scripts. Comments start with a semi-colon and end
with a new line.

Example: Debug macro


In the following examples, indentation has been used to help readability, but it is not
mandatory.
; Debug macro prints the VALUE of variable NAME
; DEBUGFLAG is a variable defined at a level above this macro

DEFINE DEBUG NAME VALUE


IF DEBUGFLAG > 1
PRINT "Value of " NAME " is " VALUE
END
END

Example: FOR loop


The FOR statement accepts four parameters: the name of the counter variable, the initial
value of this variable, the final value of this variable, and the increment to be applied on each
iteration of the loop. The increment is optional, and if not stated, defaults to 1.
; loop ten times, using I as a counter
FOR I 1 10
A = A * A
END

8214357 Rev C 53/190


Testtool STAPI SDK

Example: Factorial
The following example shows a simple application of nested macro definition and recursion.
When the variables NUM and RESULT are created within an instance of the macro
RECURSION, their scope is limited to that macro, and do not conflict with the NUM or RESULT
variables in the macro from which it has been called.
DEFINE FACTORIAL VALUE
RESULT = 0
DEFINE RECURSION NUM
IF NUM > 1
RESULT = RECURSION NUM-1
RESULT = RESULT*NUM
PR "NUM " NUM " RESULT " RESULT
END
ELSE
RESULT = NUM
END
END RESULT
RESULT = RECURSION VALUE
END RESULT
This example also uses the abbreviated form PR for PRINT.
For further examples, see the file called macros.ttm in the \stapp directory.

8.2 Common testtool commands


This section describes the commands that are specific to testtool itself, and are not related
in any way to the hardware blocks of the SoC.

ALLOC
Usage: ALLOC <Size>
Parameters:
<Size> The size in bytes to be allocated.

Description: Use this command to allocate a piece of memory. This function guarantees that the
allocated buffer is contiguous and is in a non-cached memory area.
The <Size> parameter specifies the number of bytes to be allocated. The command
displays the address of the buffer when the allocation succeeds.
Example: Allocate 1024 bytes:
ALLOC +1024
Limits: Software: None.
Hardware: None.

54/190 8214357 Rev C


STAPI SDK Testtool

BPEEK
Usage: BPEEK <Address>
Parameters:
<Address> The address to be read.

Description: Use this command to read a byte from a specific address. It displays the content of
that address.
Example: Read a byte in memory:
BPEEK #A4500000
Limits: Software: None.
Hardware: None.

BPOKE
Usage: BPOKE <Address> <Value>
Parameters:
<Address> The address at which to write.
<Value> The byte value to be written.
Description: Use this command to write a byte to a specific address.
Example: Write a byte in memory:
BPOKE #A4500000 #FF
Limits: Software: None.
Hardware: None.

8214357 Rev C 55/190


Testtool STAPI SDK

CONFIG_TESTTOOL

Usage: CONFIG_TESTTOOL <chars_to_match> <return_result>


Parameters:
<chars_to_match> By default, testtool considers a minimum of two characters as
an exact match for a variable. This means that testtool
considers BITMAP_1 and BITMAP to be the same. This limit
can be modified by this parameter by defining the number of
characters to match, or by passing a value of -1 to enforce an
exact match.
<return_result> By default, testtool commands do not return a return value. To
facilitate use cases such as ERR=PLAY_PROG, set this
parameter to TRUE. To revert to the default condition, Set this
parameter to FALSE.

Description: Use this command to configure basic testtool parameters.


Example: To configure exact match of variables and to enable commands to return errors:
CONFIG_TESTTOOL -1 1
Limits: Software: None.
Hardware: None.

COPY
Usage: COPY <SrcAddress> <Size> <DstAddress>
Parameters:
<SrcAddress> The source address of the buffer to be copied.
<Size> The size in bytes of the buffer to be copied to the destination
address.
<DstAddress> The destination address.
Description: Use this command to copy a memory buffer at a new location address. Overlapping
the source and destination regions may produce unexpected results.
Example: Duplicate 16 bytes:
COPY #A4500000 +16 #A4500010
Limits: Software: None.
Hardware: None.

56/190 8214357 Rev C


STAPI SDK Testtool

DEFINE
Usage: DEFINE <MacroName> [<Param>]*
Parameters:
<MacroName> The name for the macro.
<Param> The name of a parameter to pass to the macro.

Description: Use the DEFINE command to define a macro. The macro is stored under the name
<MacroName> and, once defined, can be invoked at any time by entering
MacroName at the command prompt. A macro can accept any number of optional
parameters, as defined by one or more <Param> arguments.
Having entered the DEFINE command, testtool displays a double prompt (>>). Enter
the body of the macro against this prompt. The macro can contain any number of
command statements, each entered on a new line.
End the macro definition with either the END or EXIT command. Testtool returns to
the normal prompt.
Macros can be nested to any level, with a DEFINE command indicating the start of
the nested macro and END (or EXIT) indicating the end.
Macros can access any global variables. A nested macro can access global variables
and the variables of the macro (or macros) that contain it. The scope of any symbols
defined within a macro (that is, variable and macro names) is limited to the body of
that macro itself.
Example: The following example defines a macro called MULDIV that multiplies its first two
parameters and divides the result by the third:
> DEFINE MULDIV A B C
>> RES =0
>> RES:=(A*B)/C
>> PRINT "THE RESULT IS" RES
>> EXIT
To run the macro MULDIV, enter the following:
> MULDIV 3 2 1
The macro gives the following result:
THE RESULT IS 6
Limits: Software: None.
Hardware: None.

8214357 Rev C 57/190


Testtool STAPI SDK

DELETE
Usage: DELETE <SymbolName>
Parameters:
<SymbolName> The name of the symbol to be deleted.

Description: Use this command to delete a symbol name from the testtool interface. A symbol
may be a variable or a function.
Example: Create a variable called toto and set it to 5:
TOTO = +5
Delete the variable toto:
DEL TOTO
Limits: Software: None.
Hardware: None.

DISPLAY
Usage: DISPLAY <Address> [<Size>]
Parameters:
<Address> The address from where we want to start the display dump.
<Size> This is an optional parameter to specify size in bytes to be
read. It read 256 bytes by default.
Description: Use this command to display the contents of the memory. It displays the content by
using long word read access.
Example: Dump data memory:
DISPLAY #A4500000
Limits: Software: None.
Hardware: None.

58/190 8214357 Rev C


STAPI SDK Testtool

DISPLAY_B
Usage: DISPLAY_B <Address> [<Size>]
Parameters:
<Address> This is the address from where we want to start the display
dump.
<Size> This is an optional parameter to specify size in bytes to be
read. It read 256 bytes by default.

Description: Use this command to display the content of the memory. It displays the content byte
per byte.
Example: Dump data memory:
DISPLAY_B #A4500000
Limits: Software: None.
Hardware: None.

DUMPMEM
Usage: DUMPMEM <Filename> <Address> <Size>
Parameters:
<Filename> The file name to be created to dump the memory. The file
location can be local mass storage devices of the platform or
remote mass storage using NFS for Linux or JTAG..
<Address> This is the address from where we want to start the file dump.
<Size> This is the parameter to specify size in bytes to be dumped.

Description: Use this command to dump the contents of a block of memory into a file.
Example: Dump data memory to a file (1024 bytes):
DUMP "C:\memory_dump.bin" #A4500000 +1024
Limits: Software: None.
Hardware: None.

END
Usage: END
Parameters: None.
Description: Use the END command to mark the end of a macro definition.
Limits: Software: None.
Hardware: None.

8214357 Rev C 59/190


Testtool STAPI SDK

EXIT
Usage: EXIT <ReturnValue>
Parameters:
<ReturnValue> The value returned by the macro. It can either be a literal value
or the name of a variable used within the macro.

Description: Use the EXIT command to mark the end of a macro definition and return a value.
Example: > DEFINE MULDIV A B C
>> NUM= (A*B)/C
>> EXIT NUM
The value of NUM is assigned to the variable RES when the macro is called with the
following syntax:
> RES = MULDIV 3 2 1
Limits: Software: None.
Hardware: None.

FILL
Usage: FILL <Address> <Size> <Pattern>
Parameters:
<Address> The address from where to start filling with the pattern. This
address must be 32 bits aligned.
<Size> The size in bytes to be fill. The size must be a multiple of
4 bytes.
<Pattern> This is the value of the 32-bit pattern.

Description: Use this command to fill a memory buffer with a 32-bit repeated pattern.
Example: Fill up a buffer with 0xFFFFFFFFF values:
FILL #A4500000 +1024 #FFFFFFFF
Limits: Software: Take care with address alignment and size multiple of 4 bytes.
Hardware: None.

60/190 8214357 Rev C


STAPI SDK Testtool

FREE
Usage: FREE <Address>
Parameters:
<Address> The address to be freed.

Description: Use this command to free a block of memory that was allocated using the ALLOC
testtool command.
Example: Allocate 1024 bytes:
ALLOC +1024
Deallocate the buffer:
FREE #A5234C00
Limits: Software: None.
Hardware: None.

GETKEY
Usage: GETKEY
Parameters: None.
Description: Use this command to wait for a key to be pressed.
Example: Get a key and store the result in key_pressed:
key_pressed = getkey
Limits: Software: None.
Hardware: None.

HELP
Usage: HELP
Parameters: None.
Example: Use this command to display a list of all testtool commands together with a short
description for each command.
To list a specific subset of the testtool commands, see the LIST command.
Limits: Software: None.
Hardware: None.

8214357 Rev C 61/190


Testtool STAPI SDK

HISTORY
Usage: HISTORY
Parameters: None.
Description: Use this command to display the last 20 previous testtool commands executed. Each
command is given an ID number. You may repeat any of the commands in the list by
entering ! followed by the ID number of the command. For example, !5 repeats
command number five in the history list.
The command history facility resembles the command history for bash. Use !! to
repeat the last command issued.
Limits: Software: None.
Hardware: None.

IOBASE
Usage: IOBASE <DefaultBase>
Parameters:
<DefaultBase> The new default base to be used. It can take the following
values:
– +16 : To switch to hexadecimal.
– +10 : To switch to decimal.
– +8 : To switch to octal.
– +2 : To switch to binary.

Description: Many commands in the testtool interface accept numerical values as parameters.
These numerical parameters may be entered as decimal, hexadecimal, octal or
binary values. Use the IOBASE command to define which base testtool uses for
interpreting numerical values.
The default base is hexadecimal. Consequently, the following command sets the
variable toto to be sixteen in decimal:
; Set toto variable
TOTO = 10
To force testtool to interpret the value 10 as decimal, prefix the number with a plus
sign:
; Set toto variable
TOTO = +10
The variable toto is now initialized as ten.
To set a different base as the default, use the IOBASE command. For example:
; Switch to decimal base by default
IOBASE +10

62/190 8214357 Rev C


STAPI SDK Testtool

Example: Set base to hexadecimal:


IOBASE +16
Set toto variable to 0x20 or 32 in decimal:
TOTO = 20
or
TOTO = +32
Set toto variable to -0x20 or -32 in decimal:
TOTO = -20
or
TOTO = -+32
The unusual combination -+ to indicate a negative value of a decimal is perfectly
normal in this context.
Limits: Software: None.
Hardware: None.

LIST
Usage: LIST <SymbolName>
Parameters:
<SymbolName> This is the name used to filter specific help for testtool
functions.

Description: This command is like the HELP command, except that it lists just a subset of the
available commands, using the text of the <SymbolName> parameter as a filter. See
the examples below.
Example: Display help for all the play commands:
LIST PLAY
Display help for all the I2C commands:
LIST I2C
Limits: Software: None.
Hardware: None.

8214357 Rev C 63/190


Testtool STAPI SDK

LOADMEM
Usage: LOADMEM <Filename> <Address> <Size>
Parameters:
<Filename> This is the file name to be loaded. The file location could be
local mass storage devices of the platform or remote mass
storage using NFS for Linux or JTAG.
<Address> This is the address to where we want to load the file.
<Size> This is the parameter to specify size in bytes to be read.

Description: Use this command to load a file and store it in memory at a specific address.
Example: Load data memory from a file (1024 bytes):
LOAD "C:\memory_dump.bin" #A4500000 +1024
Limits: Software: None.
Hardware: None.

LOG
Usage: LOG <Filename> <InOutFlag>
Parameters:
<Filename> This is the file name to be used to save the logs. The file
location could be local mass storage devices of the platform or
remote mass storage using NFS for Linux or JTAG.
<InOutFlag> This is the flag to be set to 1 in order to save input and output.
Please set it to 0 in order to log only inputs logs commands.
Description: Use this command to log all the testtool inputs and outputs to a file.
Example: Log all the testtool commands:
LOG "/ATA00/logs.txt" 1
Limits: Software: None.
Hardware: None.

PEEK
Usage: PEEK <Address>
Parameters:
<Address> This is address to be read.

Description: Use this command to read a long word (32 bits) of data from a specific address. It
displays the content of the address just read.
Example: Read a 32bits word in memory:
PEEK #A4500000
Limits: Software: None.
Hardware: None.

64/190 8214357 Rev C


STAPI SDK Testtool

POKE
Usage: POKE <Address> <Value>
Parameters:
<Address> The address to which to write.
<Value> The long word value to be written to that address.

Description: This command is used to write a long word (32bits) to a specific address.
Example: Write a 32-bit word in memory:
POKE #A4500000 #11223344
Limits: Software: None.
Hardware: None.

PRINT
Usage: PRINT [<Params>]
Parameters:
<Params> This is the list of parameters to print.

Description: Use this command to print values or strings on the user interface.
Example: > TOTO=+10
> PRINT "TOTO=" TOTO
TOTO=10
> MY_NAME="MARC"
> STRING=PRINT "MY NAME IS " MY_NAME
MY NAME IS MARC
> PRINT STRING "OR MARCO"
MY NAME IS MARC OR MARCO
> PRINT (8+2)*(+10)
+100
Limits: Software: None.
Hardware: None.

8214357 Rev C 65/190


Testtool STAPI SDK

SAVE
Usage: SAVE <Filename> <ConstFlag>
Parameters:
<Filename> This is the file name to be used to save the testtool state. The
file location could be local mass storage devices of the
platform or remote mass storage using NFS for Linux or JTAG.
<ConstFlag> This is the flag to be set to 1 in order to save constants
definitions as well.

Description: Use this command to save the state of the testtool, in terms of symbols and macro
definitions, into ASCII files. These files are identical to those read by the SOURCE
command and therefore can be used to incrementally develop an enhanced Testtool
environment tailored to the preferences of an individual user. The <ConstantFlag>
parameter allows optional saving of the constant values defined by the
implementation of the testtool.
Example: Save all the testtool state:
SAVE "/ATA00/testtool_state.txt" 1
Limits: Software: None.
Hardware: None.

SEARCH
Usage: SEARCH <StringToFind> <Address> <Size>
Parameters:
<StringToFind> This is the string to find for the search
<Address> This is the address from where we want to start the search
<Size> This is the size in bytes for the range of the search
Description: This command is used to search a string pattern into the memory, starting at address
<Address> and look for onto a range of data specified by <Size> in bytes. When
the pattern has been found, the address of matching is displayed.
Example: Look for “TAG” into the memory
SEARCH "TAG" #A4500000 +4096
Limits: Software: None.
Hardware: None.

66/190 8214357 Rev C


STAPI SDK Testtool

SHOW
Usage: SHOW <SymbolName>
Parameters:
<SymbolName> This is the name of the symbol to be displayed.

Description: Use this command to display the content of a symbol or a user defined function.
Example: > SHOW TRUE
0: TRUE: 1 (h1) - INTEGER CONSTANT
> DEFINE AREA SIDE1 SIDE2
> RESULT=SIDE1*SIDE2
> END
> SHOW AREA
DEFINE AREA SIDE1 SIDE2
RESULT=SIDE1*SIDE2
END
Limits: Software: None.
Hardware: None.

SOURCE
Usage: SOURCE <Filename> <EchoFlag>
Parameters:
<Filename> This is the file name to be loaded. The file location could be
local mass storage devices of the platform or remote mass
storage using NFS for Linux or JTAG.
<EchoFlag> This is the flag to be set to 1 in order to have the script file
displayed in the same time into the testtool interface.
By default this flag is 0 (no echo).

Description: Use this command to load testtool script files. The scripts file are text files which
contains commands compatible with the testtool interface. There is an example in the
STAPI SDK tree in the root directory in $STSDKROOT/stapp/macros.ttm. For
information, the macros.ttm file is loaded automatically when running the
STAPI SDK tree. This is true when RUN_FROM_FLASH environment variable is set to
0.
Example: Load the script test.ttm:
SOURCE "/ATA00/test.ttm" 1
Limits: Software: None.
Hardware: None.

8214357 Rev C 67/190


Testtool STAPI SDK

SPEEK
Usage: SPEEK <Address>
Parameters:
<Address> This is address to be read.

Description: Use this command to read a word (16 bits) of data from a specific address. It displays
the content of the address just read.
Example: Read a 16-bit word in memory
SPEEK #A4500000
Limits: Software: None.
Hardware: None.

SPOKE
Usage: SPOKE <Address> <Value>
Parameters:
<Address> This is the address to which to write.
<Value> This is the word value to be written
Description: Use this command to write a word (16 bits) of data to a specific address.
Example: Write a 16-bit word to memory:
SPOKE #A4500000 #1122
Limits: Software: None.
Hardware: None.

WAIT
Usage: WAIT <Milliseconds>
Parameters:
<Milliseconds> This is the number of milliseconds to wait.

Description: This command waits a certain value of time specified in milliseconds. The precision of
the wait is not guaranteed as it depends on the toolset, operating system and chipset
used.
Example: Wait for at least 5 seconds:
WAIT +5000
Limits: Software: None.
Hardware: None.

68/190 8214357 Rev C


STAPI SDK Testtool

ZAP
Usage: ZAP
Parameters: None.
Description: Use this command to switch the testtool interface to UART or JTAG connection. It
works only if the JTAG connection is on.
Example: ZAP
Limits: Software: OS21 (not Linux).
Hardware: Only available if application run from JTAG.

8214357 Rev C 69/190


Testtool STAPI SDK

8.3 STAPI SDK testtool commands


This section provides a list of the currently implemented STAPI SDK testtool commands.
Many of the commands accept additional parameters, as shown in the Usage paragraph.
Some parameters are mandatory and others are optional.

8.3.1 Hard Disk Driver access commands

ATAPI_BENCH
Usage: ATAPI_BENCH <Id> <Mode>
Parameters:
<Id> This is the ATA interface to test, and is an integer starting from
0.
<Mode> 0: Master
1: Slave

Description: Use this command to run basic benchmark read and write tests of the PATA or SATA
interface. It displays the bandwidth results of the tests.
Note: This function does not work if the virtual file system has been started. This is the case
by default in the STAPI SDK tree. Comment out the VFS_Init() call in the
stapp/main/main.c to perform ATAPI bench test.
Example: To run benchmark tests on ATA interface 0:
ATAPI_BENCH 0 0
Limits: Software: OS21, not Linux.
Hardware: Available for all platforms having a PATA or SATA disk drive.

ATAPI_DRIVEINFO
Usage: ATAPI_DRIVEINFO <Id> <Mode>
Parameters:
<Id> This is the ATA interface to test, and is an integer starting from
0.
<Mode> 0: Master
1: Slave

Description: This command displays information on either the Master or Slave disk drive.
Example: ATAPI_DRIVEINFO 0
Limits: Software: OS21, not Linux.
Hardware: Available for all platforms having a PATA or SATA disk drive.

70/190 8214357 Rev C


STAPI SDK Testtool

ATAPI_INFO
Usage: ATAPI_INFO
Parameters: None.
Description: This command displays the STATAPI driver version.
Example: ATAPI_INFO
Limits: Software: Available on OS21, not Linux.
Hardware: Available for all platforms having a PATA or SATA disk drive.

8.3.2 Audio based commands

AUD_BEEP
Example: AUD_BEEP <Id> <Sampling Frequency> <NbSeconds>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Sampling Audio sampling frequency (32000, 44100, 48000)
Frequency>
<NbSeconds> Number of seconds for which the beep tone is generated

Description: Sounds a beep.


Example: AUD_BEEP 0 +32000 +5
Limits: Software: None.
Hardware: None.

8214357 Rev C 71/190


Testtool STAPI SDK

AUD_DISABLE
Usage: AUD_DISABLE <Id> [<Type>]
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Type> This parameter is used to mute a specific output of the audio
device. If <Type> is not specified, mute all the outputs;
otherwise use one of the following:
– A_STEREO: mute pcm outputs only.
– A_SPDIF: mute digital output only.
For STx710x/STx520x/STx7200 only:
– A_PCMP0: mute pcm0 output only.
– A_PCMP1: mute pcm1 output only.

Description: Use this command to mute the audio output. To unmute the audio output, use
AUD_ENABLE.
Example: To mute all audio output on device 0:
AUD_DISABLE 0
To mute digital output only of device 1:
AUD_DISABLE 1 A_SPDIF
Limits: Software: None.
Hardware: None.

72/190 8214357 Rev C


STAPI SDK Testtool

AUD_ENABLE
Usage: AUD_ENABLE <Id> [<Type>]
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Type> This parameter is used to unmute a specific output of the
audio device. If <Type> is not specified, unmute all the
outputs; otherwise use one of the following:
– A_STEREO: mute pcm outputs only.
– A_SPDIF: mute digital output only.
For STx710x/STx520x/STx7200 only:
– A_PCMP0: mute pcm0 output only.
– A_PCMP1: mute pcm1 output only.

Description: Use this command to unmute the audio output. To mute the audio output, use
AUD_DISABLE.
Example: To unmute all audio output on device 0:
AUD_ENABLE 0
To unmute digital output only of device 1:
AUD_ENABLE 1 A_SPDIF
Limits: Software: None.
Hardware: None.

AUD_GETCAPABILITY
Usage: AUD_GETCAPABILITY <Id>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.

Description: Use this command to get capabilities of the audio device <Id>. It displays information
on the capabilities of the decoder.
Example: AUD_GETCAPABILITY 0
Limits: Software: None.
Hardware: None.

8214357 Rev C 73/190


Testtool STAPI SDK

AUD_INFO
Usage: AUD_INFO
Parameters: None.
Description: This command displays the STAUD driver version. For the STx710x, STx520x and
STx7200 series of SoCs, it also displays information on the audio firmware.
Example: AUD_INFO
Limits: Software: None.
Hardware: None.

AUD_INJSTART
Usage: AUD_INJSTART <Id> <Filename> <NbLoops> <Content> <Freq> <Type>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Filename> Name of the file to be loaded
<NbLoops> Number of times to play the file.
Enter 0 to loop an infinite number of times.
There is also a specific case when <NbLoops> is a negative
value. See Description below.
<Content> This is the stream content parameter describing the stream
decoder to be used to decode this audio content. It can take
the following values :
[A_AC3, A_DTS, A_MP1, A_MP2, A_CDDA, A_PCM,
A_LPCM, A_MP3, A_MLP, A_AAC]
For STx710x, STx520x and STx7200, other decoders are
available:
[A_WMA, A_WMAPRO, A_DV, A_CDDA_DTS,
A_LCPM_DVDA, A_HE_AAC, A_DDPLUS]
<Freq> This is sampling frequency of the stream in Hertz (44100 or
48000). This parameter is most of the time detected
automatically with some informations which are in the stream.
But this is not the case typically for PCM streams where you
have to specify the sampling frequency.
<Type> This is the stream type. It must be either A_ES or A_PES

Description: Use this command to start playback on an ES or PES audio elementary stream. The
audio stream is loaded from a local or external hard disk drive (using JTAG). If the file
is small in size (or loaded from JTAG), the audio stream is loaded completely in the
memory and the stream is played from memory. If the stream is greater than
1 MBytes, the audio injector plays the stream by reading smaller chunks on the fly.
By default, the audio is muted after the start of the injection. Use the AUD_ENABLE
command to make the audio audible.

74/190 8214357 Rev C


STAPI SDK Testtool

To stop playback, use the AUD_INJSTOP command.


When <NbLoops> < 0, the injector swaps the order of each 16-bit word before
passing it to the audio player. The main use of this feature is for when the stream is
big endian, such as a PCM stream. In this particular case, if <NbLoops> < 0, the
audio injector loops -<NbLoops>-1 number of times. Therefore, if
<NbLoops> == -1, -<NbLoops>-1 is equal to 0, and the player plays the stream
an infinite number of times by swapping words.
Example: AUD_INJSTART 0
Limits: Software: None.
Hardware: None.

AUD_INJSTOP
Usage: AUD_INJSTOP <Id>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.

Description: This command is used to stop the audio device stream injection previously started
using AUD_INJSTART.
Example: AUD_INJSTOP 0
Limits: Software: None.
Hardware: None.

AUD_PAUSE
Usage: AUD_PAUSE <Id>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.

Description: Use this command to pause an audio device. To resume playback, use the
AUD_RESUME command.
Example: AUD_PAUSE 0
Limits: Software: None.
Hardware: None.

8214357 Rev C 75/190


Testtool STAPI SDK

AUD_RESUME
Usage: AUD_RESUME <Id>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.

Definition: Use this command to resume an audio device that had earlier been paused using
AUD_PAUSE.
Example: AUD_RESUME 0
Limits: Software: None.
Hardware: None.

AUD_SETDYNAMIC
Usage: AUD_SETDYNAMIC <Id> <Enable> <CutFactor> <BoostFactor>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Enable> This parameter is the flag to be set to 1 or 0 to enable or
disable the dynamic range control.
<CutFactor> This parameter is the cut factor value to be applied, in the
range 0 to 255.
<BoostFactor> This parameter is the boost factor value to be applied, in the
range 0 to 255.
Description: Use this command to set the dynamic range control of the audio driver.
Example: To enable the dynamic range control of device 0 with a cut factor of 128 and a boost
factor of 64:
AUD_SETDYNAMIC 0 1 +128 +64
Limits: Software: None.
Hardware: None.

76/190 8214357 Rev C


STAPI SDK Testtool

AUD_SETEFFECT
Usage: AUD_SETEFFECT <Id> <Effect>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Effect> This parameter is the effect to be applied on the audio device.
It can take one of the following values :
– A_EFFECT_SRS3D: Surround 3D effect
– A_EFFECT_SRSTS: Trusurround effect
– A_EFFECT_SRSTB: Trubass effect
– A_EFFECT_SRSF: Focus effect
– A_EFFECT_SRSTSXT: Trusurround XT effect
– A_EFFECT_NONE: No effect

Description: Use this command to set an audio effect. The effects available are listed in the
Parameters section.
Example: To enable the “Surround 3D effect” of audio device 0:
AUD_SETEFFECT 0 A_EFFECT_SRS3D
Limits: Software: None.
Hardware: None.

AUD_SETLATENCY
Usage: AUD_SETLATENCY <Id> <Type> <Latency>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Type> This parameter is used to specify the output type to be
delayed. It can take the following values :
– A_PCMP0: pcm0 output
– A_PCMP1: pcm1 output
– A_SPDIF: SPDIF output
<Latency> This parameter contains the latency value in milliseconds to
be applied to the appropriate audio output.
Description: Use this command to add a delay or latency in milliseconds to a specific audio output
type. It could be used in fact to adjust for example audio delays between S/PDIF and
HDMI or SCART outputs to have the audio in phase on all outputs.
Example: To set a latency value of 50 milliseconds to PCM0 output of audio device 0:
AUD_SETLATENCY 0 A_PCMP0 50
Limits: Software: None.
Hardware: Only available for STx710x, STx520x or STx7200 series SoCs.

8214357 Rev C 77/190


Testtool STAPI SDK

AUD_SETOFFSET
Usage: AUD_SETOFFSET <Id> <Offset>
Description: Use this command to add an offset in milliseconds on the synchronize audio
algorithm for the lipsync.
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Offset> This parameter is an integer value (negative or positive value)
to be used as an offset for the synchronization. The parameter
is in milliseconds. This means that setting <Offset> to -1000
causes one second of audio to be buffered.

Example: To add a positive offset of 50 milliseconds on device 0:


AUD_SETOFFSET 0 +50
Limits: Software: None.
Hardware: None.

AUD_SETSTEREO
Usage: AUD_SETSTEREO <Id> <Mode>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Mode> This parameter is used to specify the output mode for stereo.
It can take the following values :
– A_STEREO_DL: Dual left mode
– A_STEREO_DR: Dual right mode
– A_STEREO_DM: Dual mono mode
– A_STEREO_SS: Stereo mode
– A_STEREO_2S: Second stereo mode
– A_STEREO_PL: Prologic stereo mode

Description: Use this command to set the stereo output mode. For example we can select left or
right channel or both with this command.
Example: To set stereo mode for audio device 0:
AUD_SETSTEREO 0 A_STEREO_SS
Limits: Software: None.
Hardware: None.

78/190 8214357 Rev C


STAPI SDK Testtool

AUD_SETVOLUME
Usage: AUD_SETVOLUME <Id> <Volume>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Volume> This parameter is the volume, expressed as a percentage.
Therefore a parameter of 0 is silence and 100 is the maximum
volume of the device.

Description: Use this command to adjust audio volume level. The change in volume is applied
equally to all outputs.
Note: A future enhancement to this command will allow the volume levels of different
outputs to be adjusted independently.
Example: To set volume to 50%:
AUD_SETVOLUME 0 +50
Limits: Software: None.
Hardware: None.

AUD_SETSPEED
Usage: AUD_SETSPEED <Id> <Speed>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Speed> This parameter is the speed of audio playback
Description: Use this command to change the speed of audio playback. The change is applied
equally to all outputs.
Example: To set the speed as 1.5 times the normal speed:
AUD_SETSPEED 0 +150
Limits: Software: None.
Hardware: None.

8214357 Rev C 79/190


Testtool STAPI SDK

AUD_SPDIF
Usage: AUD_SPDIF <Id> <Mode>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Mode> This parameter is the S/PDIF mode to be setup. It can take the
following values :
– A_COMPRESSED: S/PDIF output is in compressed
mode (5.1)
– A_NONCOMPRESSED: S/PDIF output is not
compressed (pcm 2 channels)
– A_OFF: S/PDIF output is off

Description: This command changes the S/PDIF output configuration. Use this command to switch
between compressed or non compressed output or simply to disable the S/PDIF
output altogether.
Note: It is not possible to change S/PDIF mode on the fly for the STx710x, STx520x or
STx7200 series of SoCs. For these SoCs, stop the audio before using the
AUD_SPDIF command.
Example: To set S/PDIF output for audio device 0 to compressed:
AUD_SPDIF 0 A_COMPRESSED
Limits: Software: None.
Hardware: None.

AUD_STATUS
Usage: AUD_STATUS <Id> [<Reset>]
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Reset> This parameter is a flag which could be set to 1 to reset the
current statistics and put all fields to 0.
Description: Use this command to display various information relating to the selected audio
device, such as the number of audio frames decoded.
Example: AUD_STATUS 0
Limits: Software: None.
Hardware: None.

80/190 8214357 Rev C


STAPI SDK Testtool

AUD_SYNCHRO
Usage: AUD_SYNCHRO <Id> <Synchro>
Parameters:
<Id> This is the identifier of the audio device, which is an integer
starting from 0.
<Synchro> This parameter is a flag which could be set to 1 to enable
synchronization or 0 to disable synchronization.

Description: Use this command to enable or disable the embedded synchronization algorithm
inside the audio device to guarantee lipsync.
Example: To enable synchronization of device 0:
AUD_SYNCHRO 0 1
To disable synchronization of device 0:
AUD_SYNCHRO 0 0
Limits: Software: None.
Hardware: None.

8.3.3 Remote control commands

BLAST_INFO
Usage: BLAST_INFO
Parameters: None.
Description: This command displays the STBLAST driver version.
Example: BLAST_INFO
Limits: Software: On Linux, STBLAST is sometimes replaced by LIRC, in which case
STBLAST is not used.
Hardware: None.

BLAST_GETKEY
Usage: BLAST_GETKEY <Id> <TimeOutInMs>
Parameters: None.
Description: Use this command to check basic feature of the STBLAST driver: catching remote
control buttons. This function currently works with only one specific remote control
(the “Futarqe” remote control with some DVR buttons).
Example: BLAST_GETKEY 0 +10
Limits: Software: Tested only with a specific remote control where we know the protocol and
key assignments.
Hardware: Works only with Futarque remote control.

8214357 Rev C 81/190


Testtool STAPI SDK

BLAST_POLLKEY
Usage: BLAST_POLLKEY <Id>
Parameters: None.
Description: Use this command to get the remote key pressed and return immediately.
Example: BLAST_POLLKEY 0
Limits: Software: Tested only with a specific remote control where we know the protocol and
key assignments. May not work with other remote controls.

8.3.4 Blitter engine based commands

BLIT_CLEAR
Usage: BLIT_CLEAR <Id>
Parameters: <Id> This parameter is the graphic plane identifier [0,1...].
Description: Use this command to clear a graphic plane by using hardware blitter feature. It uses
the fill rectangle function to clear the screen with a transparent color.
Example: BLIT_CLEAR 1
Limits: Software: None.
Hardware: None.

BLIT_COPY
Usage: BLIT_COPY <Source> <Destination>
Parameters:
<Source> The identifier of the graphic plane to copy from.
<Destination> The identifier of the graphic plane to copy to.
Description: Use this command to copy one graphic plane to another graphic plane.
Example: BLIT_COPY 1 2
Limits: Software: None.
Hardware: None.

82/190 8214357 Rev C


STAPI SDK Testtool

BLIT_FILL
Usage: BLIT_FILL <Id>
Parameters: <Id> This parameter is the graphic plane identifier [0,1...].
Description: Use this command to fill a graphic plane with random color and positions of
rectangles, using hardware blitter feature.
It displays also the bandwidth of the test in Mpixels/s. The test is displaying 512
rectangles.
Example: BLIT_FILL 1
Limits: Software: None.
Hardware: None.

BLIT_FILL_JOB
Usage: BLIT_FILL_JOB <Id>
Parameters: <Id> This parameter is the graphic plane identifier [0,1...].
Description: Use this command to fill a graphic plane with random color and positions of
rectangles, using blit jobs.
Example: BLIT_FILL_JOB 1
Limits: Software: None.
Hardware: None.

BLIT_INFO
Usage: BLIT_INFO
Parameters: None.
Description: This command displays the STBLIT driver version.
Example: BLIT_INFO
Limits: Software: None.
Hardware: None.

8214357 Rev C 83/190


Testtool STAPI SDK

8.3.5 Close Caption commands

CC_INFO
Usage: CC_INFO
Parameters: None.
Description: This command displays the STCC driver version.
Example: CC_INFO
Limits: Software: None.
Hardware: None.

CC_START
Usage: CC_START <Id> <GfxId>
Parameters:
<Id> This parameter is the playback identifier [0,1...].
<GfxId> Display the Close Captions on this graphics plane.
Description: Start Close Caption.
Example: CC_INFO
Limits: Software: None.
Hardware: None.

CC_STOP
Usage: CC_STOP <Id>
Parameters: <Id> This parameter is the playback identifier [0,1...].
Description: Stop Close Caption.
Example: CC_INFO
Limits: Software: None.
Hardware: None.

84/190 8214357 Rev C


STAPI SDK Testtool

8.3.6 Clock recovery based commands

CLKRV_CHECKSTC
Usage: CLKRV_CHECK <Id> <TimeinMS>
Parameters:
<Id> This parameter is the clkrv device identifier.
<TimeinMS>

Description: Use this command to check two measures of STC in the interval determined by
TimeinMS.
Example: CLKRV_CHECKSTC 0 +10
Limits: Software: None.
Hardware: None.

CLKRV_DISABLE
Usage: CLKRV_DISABLE <Id>
Parameters: <Id> This parameter is the clkrv device identifier.
Description: This command disables the clock recovery handling of PCRs by setting the
PCRHandlingActive flag in given instance ControlBlock.
Example: CLKRV_DISABLE 1
Limits: Software: None.
Hardware: None.

CLKRV_ENABLE
Usage: CLKRV_ENABLE <Id>
Parameters: <Id> This parameter is the clkrv device identifier.
Description: This command enables the clock recovery handling of PCRs by setting the
PCRHandlingActive flag in given instance ControlBlock.
Example: CLKRV_ENABLE
Limits: Software: None.
Hardware: None.

CLKRV_GET
Usage: CLKRV_GET <Id>
Description: This command displays the current time (STC) of the clock instance <Id>
Example: CLKRV_GET 0
Limits: Software: None.
Hardware: None.

8214357 Rev C 85/190


Testtool STAPI SDK

CLKRV_INFO
Usage: CLKRV_INFO
Parameters:
<Id> This parameter is the clkrv device identifier. A device with an
<Id> of 0 always exists in the system. The 0 clkrv device
identifier is the one use to control and to adjust the local
27Mhz frequency of the set-top box. If we compile STSDK
with DVR = 1 flag, the application creates more than one
clock devices to connect one clock device by video instance.
The command may return an error if no pcr is available on the
service that has been played. This command is useful to
check if we receive the pcr information for example.

Description: This command displays the STCLKRV driver version.


Parameters: None.
Example: CLKRV_INFO
Limits: Software: None.
Hardware: None.

CLKRV_INVALIDATE
Usage: CLKRV_INVALIDATE <Id>
Parameters:
<Id> This parameter is the clkrv device identifier. This invalidates
the clock recovery counter. Each driver which asks for the
<Id> time is notified with an error.

Description: Use this command to reset a clock recovery counter. In this case, any driver asking
for local time receives an error until a new PCR comes into the system or until the
clkrv instance has been set again.
Example: CLKRV_INVALIDATE 0
Limits: Software: None.
Hardware: None.

86/190 8214357 Rev C


STAPI SDK Testtool

CLKRV_SET
Usage: CLKRV_SET <Id> <33Bit> <Base> <Extension>
Parameters:
<Id> This parameter is the clkrv device identifier.
<33bit> 33th MSB bit of the base clocked at 90Khz.
<Base> 32 LSB bits of the base clocked at 90Khz.
<Extension> 9 bits of the extension clocked at 27Mhz.

Description: Use this command to set the clock recovery counter to a specific value. The local
system clock is coded on 42 bits (Base.Extension) : 33 bits counter at 90 Khz and
9 bits of extension at 27 Mhz.
Example: CLKRV_SET 0
Limits: Software: None.
Hardware: None.

CLKRV_SETOFFSET
Usage: CLKRV_SETOFFSET <Id> <Offset>
Parameters:
<Id> This parameter is the clkrv device identifier.
<Offset> Offset in units of 90Khz to be applied to the local clock
recovery.
All drivers synchronized with this clkv device identifier jump to
this offset in time. For example an offset of -90000 forces
drivers to bufferize one second more of data.

Description: Use this command to set an offset on a specific clock recovery. The offset is specified
in units of 90 Khz and is a 32 bits signed value to be able to provide a positive or
negative offset.
Example: To set an offset of 90 Khz (that is, 1 unit) to device 0:
CLKRV_SETOFFSET 0 1
Limits: Software: None.
Hardware: None.

8214357 Rev C 87/190


Testtool STAPI SDK

8.3.7 Cryptography commands

CRYPT_BENCH
Usage: CRYPT_BENCH <Id> <NbPackets> <NbLoops>
Parameters:
<Id> This parameter is the cryptography DMA device identifier, and
is an integer starting from 0.
<NbPackets> Number of dummy TS packets to generate for the benchmark.
<NbLoops> Number of times to perform the test.

Description: Use this command to perform cryptography benchmarks using the cryptography DMA
engine available in the system. Whether or not this command is available depends on
hardware and system capabilities.
For example, the cryptography engine on STx5100/7100 is the TDES DMA and on
STx7109 is the TKDMA, but there is no cryptography DMA on 5105, 5107, 5118 or
5119.
For security reasons, the default cryptographic libraries provided in the STAPI SDK
tree do not permit the encryption or decryption of any content. Nonetheless, running
this test provides an accurate assessment of the cryptography DMA capabilities. The
DMA facilities can be used for features such as HDD read and write with an
ATAPI/EMI interface.
The test performs a cryptographic DMA copy from DDR to DDR using dummy
transport stream packets. The number of the packets is specified by the
<NbPackets> argument. The test is repeated the number of times specified by the
<NbLoops> argument.
Finally, the test displays the bandwidth capability of the cryptographic DMA in Mbits/s
Example: CRYPT_BENCH 0 10 10
Limits: Software: OS21 not Linux.
Hardware: Chipset dependant.

CRYPT_INFO
Usage: CRYPT_INFO
Parameters: None.
Description: This command displays the STCRYPT/STTKDMA driver version.
Example: CRYPT_INFO
Limits: Software: OS21 not Linux.
Hardware: Chipset dependant.

88/190 8214357 Rev C


STAPI SDK Testtool

8.3.8 Cursor commands

CURSOR_DISABLE
Usage: CURSOR_DISABLE <Id>
Parameters:
<Id> This parameter is the cursor plane to be disabled. For some
systems, it may be possible to have more than one cursor
plane, which is why <Id> can have any value starting from 0.

Description: This command disables the cursor plane <Id>. To enable the cursor, see
CURSOR_ENABLE.
Example: CURSOR_DISABLE 0
Limits: Software: None.
Hardware: Chipset dependant.

CURSOR_ENABLE
Usage: CURSOR_ENABLE <Id>
Parameters:
<Id> This parameter is the cursor plane to be enabled. For some
systems, it may be possible to have more than one cursor
plane, which is why <Id> can have any value starting from 0.

Description: This command enables a cursor plane <Id>. To disable the cursor, see
CURSOR_DISABLE.
Example: CURSOR_ENABLE 0
Limits: Software: None.
Hardware: Chipset dependant.

CURSOR_LOAD
Usage: CURSOR_LOAD <Id> <Filename>
Parameters:
<Id> This parameter is the cursor plane affected.
<Filename> This is the name of the file containing the cursor bitmap. The
cursor bitmap is in the .gam ST standard format. Use the tool
“ST File format” to convert .bmp into .gam files. The tool is
available on the stapi_sdk_plugins Subversion server or can
be provided on request.

Description: Use this command to load a new cursor bitmap in memory for cursor <Id>.
Example: CURSOR_LOAD 0 "/ATA00/my_arrow.gam"
Limits: Software: None.
Hardware: Chipset dependant.

8214357 Rev C 89/190


Testtool STAPI SDK

CURSOR_SETPOS
Usage: CURSOR_SETPOS <Id> <X> <Y>
Parameters:
<Id> This parameter is the cursor plane to be enabled.
<X> This is the X position to be set. The range of the X value is
dependant on screen resolution.
<Y> This is the Y position to be set. The range of the Y value is
dependant on screen resolution.

Description: Use this command to move a cursor plane <Id> on the screen.
Example: CURSOR_SETPOS 0 +300 +250
Limits: Software: None.
Hardware: Chipset dependant.

90/190 8214357 Rev C


STAPI SDK Testtool

8.3.9 Demux commands

DEMUX_CONNECT
Usage: DEMUX_CONNECT <TsInput> <PhysicalPTI> <LogicalPTI>
[<ParallelFlag>] [<InvBitClockFlag>]
Parameters:
<TsInput> This parameter is the transport stream input to be connected.
It can take the following values:
– TSIN0: Transport stream input 0.
– TSIN1: Transport stream input 1.
– TSIN2: Transport stream input 2.
– TSIN3: Transport stream input 3.
– TSIN4: Transport stream input 4.
– SWTS0: Software transport stream input 0.
– SWTS1: Software transport stream input 1.
– SWTS2: Software transport stream input 2.
Some values may not be available, depending on the
hardware capabilities.
<PhysicalPTI> This parameter is the physical PTI name to be used. It can
take the following values :
– PTI0: Physical PTI hardware block 0.
– PTI1: Physical PTI hardware block 1.
<LogicalPTI> This parameter is the logical PTI device instance identifier. It is
an integer value from 0 to N, where N is the number maximum
of instances of physical PTI available on the system.
<ParallelFlag> FALSE: The TS input is serial
TRUE: The TS input is a parallel transport stream.
<InvBitClock> FALSE: The bit clock is not inverted.
TRUE: The bit clock is inverted to latch data on the opposite
edge.

Description: Use this command to create and to change transport stream inputs connection to
each PTI demultiplexer instance.
It connects a physical transport stream input to a physical PTI hardware block. Each
PTI hardware block can have more than one logical PTI instance, so the logical PTI
identifier must also be specified.
<ParallelFlag> and <InvBitClockFlag> are optional parameters. If there are
not provided, the command tries to find the correct TS signals setting by checking if a
demodulator is connected to the specified<TsInput>. If it is successful, it sets the
appropriate parallel or serial and bit clock polarity settings to be compatible with the
demodulator.
If a demodulator is not found, the command forces an internal default setting.
STMicroelectronics recommend specifying <ParallelFlag> and
<InvBitClockFlag> settings.

8214357 Rev C 91/190


Testtool STAPI SDK

Example: Connect TSIN0 to physical PTI0 instance 2 :


DEMUX_CONNECT TSIN0 PTI0 2
Connect TSIN2 to physical PTI1 instance 0 with parallel ts stream and bit clock
inverted :
DEMUX_CONNECT TSIN2 PTI1 0 TRUE FALSE
Limits: Software: None.
Hardware: Chipset dependant.

DEMUX_DUPLICATE
Usage: DEMUX_DUPLICATE <TsInput>
Parameters:
<TsInput> This parameter is the transport stream input to be connected.
It can take the following values :
– TSIN0 : Transport stream input 0.
– TSIN1 : Transport stream input 1.

Description: Use this command to duplicate TSIN0 or TSIN1 inputs to TSIN2 by using an internal
connection inside the transport stream merger.
Note: This function is available only for chipsets that have the duplicate feature.
Limits: Software: None.
Hardware: Chipset dependant.

DEMUX_INFO
Usage: DEMUX_INFO
Parameters: None.
Description: This command displays the version numbers of the drivers used for DEMUX input and
management (such as STPTI and STMERGE).
Example: DEMUX_INFO
Limits: Software: None.
Hardware: None.

DEMUX_MUX
Usage: DEMUX_MUX
Parameters: None.
Description: This command displays the current status of all the transport stream inputs of the
demultiplexer. It provides information if a stream is detected as a TS input and if there
are packets in error.
Example: DEMUX_MUX
Limits: Software: None.
Hardware: Chipset dependant.

92/190 8214357 Rev C


STAPI SDK Testtool

DEMUX_PESSTART
Usage: DEMUX_PESSTART <Id> <Filename> <LogicalPTI> <Pid>
Parameters:
<Id> This parameter is used to identify the packetized elementary
stream (PES) collector instance. This ID is in the range of
[0...3].
<Filename> Filename of the file to generate to collect PES content.
<LogicalPTI> This parameter is used to specify the logical instance identifier
of the PTI to be used to filter the pes.
<Pid> Pid to filter [0...0x1FFFF].

Description: Use this command to filter PES content from a specified PID and to store that content
in a file. The <Pid> value is filtered from the logical PTI instance identifier provided by
the <LogicalPTI> parameter.
This command is available only if there is a hard disk drive connected to the system.
It is possible to filter up to four pes files in parallel.
Example: DEMUX_PESSTART 0 "/USBHDISK00/video.pes" 0 #65
Limits: Software: None.
Hardware: Available for all platforms with a mass storage device.

DEMUX_PESSTOP
Usage: DEMUX_PESSTOP <Id>
Parameters:
<Id> This parameter is used to identify the pes collector instance to
stop. <Id> can be in the range of [0...3].

Description: This command stops filtering a PES into a file. See DEMUX_PESSTART.
Example: DEMUX_PESSTOP 0
Limits: Software: None.
Hardware: Available for all platforms having a mass storage device.

8214357 Rev C 93/190


Testtool STAPI SDK

DEMUX_SETKEY
Usage: DEMUX_SETKEY <Id> <KeyId> <Pid> <OddNotEven> <Key>[8]
Parameters:
<Id> This parameter is used to identify the logical instance of the
PTI on which we want to setup a DVB key.
<KeyId> This parameter is the key identifier. This id could be in the
range of [0...3].
<Pid> Pid to associate the key [0...0x1FFFF].
<OddNotEven> 0: indicates this is the even key.
1: indicates this is the odd key.
<Key>[8] Key value with 8 bytes long.

Description: Use this command to set a DVB key for the specified pid and logical PTI instance. The
key is provided as eight bytes values.
Example: DEMUX_SETKEY 0 0 #65 0 #11 #22 #33 #66 #33 #22 #11 #66
Limits: Software: None.
Hardware: None.

DEMUX_STATUS
Usage: DEMUX_STATUS <Id> [<Reset>]
Parameters:
<Id> This parameter is the PTI logical device id to be used [0,1...].
<Reset> This parameter is a flag which when set to 1 resets the current
statistics and put all fields to 0.
Description: This command checks the status of the demux device by displaying some statistics
informations, such as the number of cc errors.
Example: To display the demux status of device 0 and reset the statistics:
DEMUX_STATUS 0 1
Limits: Software: None.
Hardware: None.

94/190 8214357 Rev C


STAPI SDK Testtool

8.3.10 Digital Encoder (DENC) commands

DENC_COLORBAR
Usage: DENC_COLORBAR <Id> <Enable>
Parameters:
<Id> This parameter is the DENC device id to be used [0,1...].
<Reset> This parameter is a flag which could be set to 1 to enable the
colorbar or 0 to disable the colorbar pattern.

Description: Use this command to enable or disable the color bar pattern on video analog DENC
outputs.
Example: DENC_COLORBAR 0
Limits: Software: None.
Hardware: None.

DENC_GETCAPABILITY
Usage: DENC_GETCAPABILITY <Id>
Parameters: <Id> This parameter is the DENC device id to be used [0,1...]
Description: This command displays details of DENC capabilities.
Example: DENC_GETCAPABILITY 0
Limits: Software: None.
Hardware: None.

DENC_GETMODE
Usage: DENC_GETMODE <Id>
Parameters: <Id> This parameter is the DENC device id to be used [0,1...]
Description: This command displays STDENC driver capabilities such as device type, chroma
delays and so forth.
Example: DENC_GETMODE 0
Limits: Software: None.
Hardware: None.

DENC_INFO
Usage: DENC_INFO
Parameters: None.
Description: This command displays the STDENC driver version.
Example: DENC_INFO
Limits: Software: None.
Hardware: None.

8214357 Rev C 95/190


Testtool STAPI SDK

DENC_SETMODE
Usage: DENC_SETMODE <Id> <Mode>
Parameters:
<Id> This parameter is the DENC device ID to be used [0,1...].
<Mode> This parameter is the mode to be applied to the DENC output
It can take the following values:
– PAL: Switch to PAL standard.
– SECAM: Switch to SECAM standard.
– NTSC: Switch to NTSC standard.

Description: Use this command to change the DENC output mode.


Example: To switch device 0 to PAL standard:
DENC_SETMODE 0 PAL
Limits: Software: None.
Hardware: None.

8.3.11 Direct Memory Access (DMA) commands

DMA_INFO
Usage: DMA_INFO
Parameters: None.
Description: This command displays the DMA engine driver version (STFDMA).
Example: DMA_INFO
Limits: Software: None.
Hardware: None.

DMA_SWTS
Usage: DMA_SWTS <PtiId> <NbPackets> <NbLoops>
Parameters:
<Id> This parameter is the PTI logical device identifier [0,1...].
<NbPackets> Number of dummy TS packets to generate for the test.
<NbLoops> Number of times to perform the test.
Description: Use this command to perform a software transport stream injection test by using the
DMA engine available in the system. Whether or not this command is available
depends upon hardware and system capabilities.
The test performs an injection of dummy transport packets into the <PtiId> logical
instance which is supposed to be connected to a SWTS transport stream. If this is not
the case, the command returns an error.

96/190 8214357 Rev C


STAPI SDK Testtool

<NbPackets> are injected to the SWTS and the test checks the result of the
injection to identify if packets have been lost or corrupted. The test is repeated the
number of times specified by <NbLoops> argument.
Finally, the test displays the bandwidth capability of the injection in Mbits/s.
Example: Do a SWTS injection using DMA on PTI2 with 256 Ts packets and loop is 2
DMA_SWTS +2 +256 +16
Limits: Software: None.
Hardware: Chipset dependant.

DMA_TEST
Usage: DMA_TEST <AddressSrc> <AddressDst> <Size>
Parameters:
<AddressSrc> Source buffer address
<AddressDst> Destination buffer address
<Size> Number of bytes to copy

Description: Use this command to perform a basic test of memory copy using DMA.
A source and a destination buffer must be specified. These can be allocated in
advance using the ALLOC command, and then removed afterwards using FREE. The
source buffer can contain any type of data, such as a pattern generated by the FILL
command.
This test copies the data in source to destination and then checks the success of the
operation by comparing the contents of the two buffers. The command also displays
the bandwidth of the transfer, measured in MBits/s.
Example: Allocate 1024 bytes for source:
ALLOC +1024
Fill with 0x11223344 pattern:
FILL <AddressSrc> +1024 #11223344
Allocate 1024 bytes for destination:
ALLOC +1024
Do the DMA copy:
DMA_TEST <AddressSrc> <AddressDst> +1024
Finally, free the buffers:
FREE <AddressSrc>
FREE <AddressDst>
Note: Replace <AddressSrc> and <AddressDst> with the addresses returned by the
ALLOC commands.
Limits: Software: OS21 only (not Linux).
Hardware: Chipset dependant.

8214357 Rev C 97/190


Testtool STAPI SDK

8.3.12 FLASH commands

FLASH_BLOWER
Usage: FLASH_BLOWER <Filename> [<Parameters>]
Parameters:
<Filename> This is a string which contains the filename reference to the
rom to be loaded. For example, if you set the filename to
“COCOREF_GOLD_7109_OS21”, the blower looks for a file
called “flash_COCOREF_GOLD_7109_OS21.[hex|bin]”.
<Parameters> This is a string which contains optional configuration for the
blower. Currently, only one parameter is recognized:
– PROGRAM_FROM_THE_END means that the blower
burns the image by starting from the end of Flash
memory and decrementing addresses.

Description: Use this command to start the flash burner from the STSDK testtool interface. It is
exactly the same tool when we run the blower from the JTAG interface:
make run_blower.
The advantage of having the blower integrated into the STAPI SDK tree is that it is
possible to flash a new STAPI SDK tree from within the current STAPI SDK tree. This
means that the software can be upgraded without the need of an ST Micro Connect.
Store your new .hex or .bin file to an USB key or HDD typically and then you use
the embedded blower to burn the new image from the USB key.
If there is no mass storage interface in the system, then the only way of upgrading the
software is by using an ST Micro Connect.

98/190 8214357 Rev C


STAPI SDK Testtool

Example: See Figure 8.

Figure 8. Example output of FLASH_BLOWER command


================================================
STAPI_SDK - Flash programmer
(c) 2009 - ST MicroElectronics
================================================

Please, type:
1 - Program the flash, from file flash_mb680_7105_OS21.hex
2 - Program the flash, from file flash_mb680_7105_OS21.bin
3 - Compare flash and file flash_mb680_7105_OS21.hex
4 - Compare flash and file flash_mb680_7105_OS21.bin
5 - Erase content of all flash
6 - Dump the content of the flash into flash_mb680_7105_dump.bin
7 - Quit
Choice?1
romtool : ---------------------------------------
romtool : Identifier of the flash to be programmed (default value is 0)
>?0
romtool: Name of the file to load to program the flash (default value is
"flash_mb796_5206_ST40_OS21_32BITS.bin") ?>.
romtool: Address from where to start programming (default value is
0x00000000) >?.
romtool: Size to program (default value is 0 bytes, 0=>program all the
file size) >? .

Limits: Software: None


Hardware: None.

FLASH_INFO
Usage: FLASH_INFO
Parameters: None.
Description: This command displays the STFLASH driver version.
Example: FLASH_INFO
Limits: Software: OS21 only (not LINUX).
Hardware: None.

8214357 Rev C 99/190


Testtool STAPI SDK

8.3.13 File system commands

FS_BENCH
Usage: FS_BENCH <Filename>
Parameters:
<Filename> This parameter is the filename of the file to create for the test.
The file is deleted at the end of the test.

Description: Use this command to run some basic benchmark read and write tests on the file
system. The test creates a file (with the path specified by the <Filename> argument)
and performs a series of reads and writes using different sizes of memory chunks.
The test reports the bandwidth capabilities of each transfer.
To benchmark a different file system, change the <Filename> argument so that the
file is created on the file system under investigation.
Example: Linux: Perform a benchmark test of a NFS file system:
FS_BENCH "/mnt/mydisk/file.bin"
OS21: Perform a benchmark test of a SATA disk and VFS file system with
OSPlus/OS21
FS_BENCH "/ATA00/file.bin"
Limits: Software: Requires OSPlus on OS2x systems.
Hardware: Available for all platforms with a mass storage device.

FS_COPY
Usage: FS_COPY <FilenameSrc> <FilenameDst>
Parameters:
<FilenameSrc> This parameter is the filename of the source file.
<FilenameDst> This parameter is the filename of the destination file.
Description: This command copies a source file to a destination file. On OS21, either the source
file or destination file may be files on your host machine, in which case the data is
read or written through the JTAG interface.
Example: Linux: Copy a file between different mounted file systems:
FS_COPY "/mnt/myfile.trp" "/root/myfile.trp"
OS2x: Copy from SATA to USB key
FS_COPY "/ATA00/file.bin" "/USBRDISK01/file.bin"
OS2x: Copy from host machine to the local HDD of the box
FS_COPY "C:\pictures\myimage.gam" "/ATA00/myimage.gam"
Limits: Software: Need OSPlus for OS2x systems.
Hardware: Available for all platforms with a mass storage device.

100/190 8214357 Rev C


STAPI SDK Testtool

FS_DEL
Usage: FS_DEL <Filename>
Parameters:
<Filename> This parameter is the filename of the file to be deleted.

Description: Use this command to delete a file. For OS21, it is not possible to use this command to
remove a file from the host machine (through JTAG).
Example: Linux: Delete a file from a mounted file system:
FS_DEL "/mnt/myfile.trp" "/root/myfile.trp"
OS2x: Delete a file from USB HDD disk drive
FS_DEL "/USBHDISK00/file.bin" "/USBRDISK01/file.bin"
Limits: Software: Requires OSPlus for OS2x systems.
Hardware: Available for all platforms with a mass storage device.

FS_DIR
Usage: FS_DIR <Pathname>
Parameters:
<Pathname> This parameter is the pathname of the directory to be listed.

Description: Use this command to list the contents of a directory. For OS21, it is not possible to list
a directory from the host machine (through JTAG).
Example: Linux: List the directory on a mounted file system:
FS_DIR "/mnt/mydir"
OS2x: List the directory from a USB key:
FS_DIR "/USBRDISK00/images"
Limits: Software: Requires OSPlus for OS2x systems.
Hardware: Available for all platforms with a mass storage device.

8214357 Rev C 101/190


Testtool STAPI SDK

FS_FDISK
Usage: FS_DISK <DiskName>
Parameters:
<DiskName> This parameter is the disk name of the mass storage device.

Description: Use this command to perform disk formatting and/or partitions creation of the disk
device name. When a new, unformatted hard disk drive is connected to the system,
use this command to format and partition that drive.
Note: This command is only available for OS2x/OSPlus systems because Linux has its own
commands to perform these operations (such as mkfs.ext2). Consult the Linux
documentation for more information.
The <DiskName> parameter is the name of the device identified by the OSPlus
libraries. For example, this may be:
– /usb/hdisk0 for a USB Hdd drive
– /usb/rdisk0 for a USB key
– /ATA0” for a PATA or SATA HDD drive.
The command displays an interactive menu. Choose a specific action from the
following:
[1] Display list of partitions
[2] Create a partition
[3] Delete a partition
[4] Remove all partitions
[5] Check file system
[6] Destroy MBR
[7] Quit
Options [1] through [4] are for managing partitions on the disk. A single mass storage
device may contain one or more partitions, each with a unique name. A new partition
is created with the name volumeX, where X is an integer starting from 0.
Use option [5] to repair the disk if it has suffered damage from an unexpected power
loss or if the application was terminated without properly unmounting all the devices.
Option [6] is a specific feature to erase the first LBA 0 (512 bytes). This is needed to
address the specific case where a mass storage device cannot be detected by the
OSPlus volume manager. If this happens, use this option to clean the first LBA and
then re-create the partitions.
Use option [7] to quit the menu. After quitting, FS_FDISK mounts all the volumes of
the file system denoted by <DiskName> with “rw” access. For example, if you have
created two partitions (/volume0 and /volume1) on the device /usb/hdisk0
device. When the file system is mounted, two mount names are available.

102/190 8214357 Rev C


STAPI SDK Testtool

The mount name for a partition is constructed from the device name according to the
following rules:
1.Remove all slashes from device name and convert to upper case. Thus,
/usb/hdisk0 becomes USBHDISK0.
2. Prefix the name with a slash. USBHDISK0 becomes /USBHDISK0
3. Append the partition number to the end of the name. For example: /USBHDISK00
Consequently, the mount name for the first partition of device /usb/hdisk0 is
/USBHDISK00.
Use the mount name as the first element of pathnames when manipulating the
contents of the given partition with all the other FS_* testtool commands. For
example:
FS_MKDIR "/USBRDISK00/new_directory"
Example: FS_DISK /usb/hdisk0
Limits: Software: OS21 only (not Linux).
Hardware: Available for all platforms with a mass storage device.

FS_INFO
Usage: FS_INFO
Parameters: None.
Description: This command displays details of all the mount points.
Example: FS_INFO
Limits: Software: OS21 with OSPlus (not Linux).
Hardware: Available for all platforms with a mass storage device.

FS_LIST
Usage: FS_LIST
Parameters: None
Description: Use this command to list all the peripheral devices detected by OSPlus. The list may
include ethernet devices, mass storage devices, volumes and so forth.
Example: FS_LIST
Limits: Software: OS21 with OSPlus (not Linux).
Hardware: Available for all platforms with a mass storage device.

8214357 Rev C 103/190


Testtool STAPI SDK

FS_MKDIR
Usage: FS_MKDIR <Pathname>
Parameters:
<Pathname> This parameter is the pathname of the directory to create.

Description: Use this command is used to create a directory. For OS21, please note that it is not
possible to create a directory on the host machine (through JTAG).
Example: Linux: Create a directory on a mounted file system:
FS_MKDIR "/mnt/new_directory"
OS2x: Create a directory on the USB key
FS_MKDIR "/USBRDISK00/mydirectory"
Limits: Software: Needs OSPlus for OS2x systems.
Hardware: Available for all platforms with a mass storage device.

FS_MOUNT
Usage: FS_MOUNT <DiskName> <VolumeName> [<Mode>]
Parameters:
<DiskName> This parameter is the device name to be mounted.
<VolumeName> This parameter is the volume name to be mounted
(OS2x/OSPlus) or the mount point name for Linux.
<Mode> This parameter is a string [“r”|”rw”] to define access to the
mass storage.

Description: Use this command to mount a mass storage to a specific mount point name.
Depending upon the operating system in use (that is, OS2x/OSPlus or Linux), the
three parameters have different meanings:
OS2x/OSPlus
When using OS2x/OSPlus, the <DiskName> parameter is the name of the device
identified by OSPlus (in other words, the device listed by FS_LIST). It accepts some
common values like "/usb/hdisk0" or "/usb/rdisk0" or "/ATA0".
The <VolumeName> parameter is a string which determinates the volume to be
mounted on a specific device. It could be "/volumeX" where X is an integer starting
from 0.
Finally, the optional <Mode> parameter is a string equal to “r” or “rw” that specifies
the access control of the disk or volume to be mounted.
The mount name for a partition is constructed from the device name according to the
following rules:
1.Remove all slashes from device name and convert to upper case. Thus,
/usb/hdisk0 becomes USBHDISK0.
2. Prefix the name with a slash. USBHDISK0 becomes /USBHDISK0
3. Append the partition number to the end of the name. For example: /USBHDISK00

104/190 8214357 Rev C


STAPI SDK Testtool

Consequently, the mount name for the first partition of device /usb/hdisk0 is
/USBHDISK00.
Use the mount name as the first element of pathnames when manipulating the
contents of the given partition with all the other FS_* testtool commands. For
example:
FS_MKDIR "/USBRDISK00/new_directory"
The <Mode> parameter is significant. A mode of “rw” allows both reading and writing
to mass storage. However, if write access is not required, STMicroelectronics
recommend that you use “r” mode, in order to improve security and to avoid a disk
crash caused by a power failure or the application failing in an unexpected way.
However, it is possible to repair the disk with the FS_FDISK command if needed.
Linux
Using Linux, the FS_MOUNT command is just a wrapper to the mount common
system command. It avoids the need for a separate shell to mount or umount devices.
Instead, both operations can be carried out directly from STAPI SDK.
The <DiskName> parameter is the name of the device identified by the kernel. For
example, if mass storage devices are connected, the /dev directory contains items
similar to the following:
/dev/sdaX
/dev/sdbX
/dev/sdcX
where X is a number starting from 0.
As volumes are directly managed by the kernel, the <VolumeName> parameter is
simply the mount point name you want.
The <Mode> parameter is not used at all.
FS_MOUNT "/dev/sdb1" "/mnt"
mounts the /dev/sdb1 device to directory /mnt.
As explained above, the FS_MOUNT command is just a wrapper to the mount Linux
command. This means that mount command line arguments can be passed as part
of the <DiskName> parameter. For example, to mount a disk formatted in FATxx ,
use the following:
FS_MOUNT "-t vfat /dev/sdb1" "/mnt"
Example: Linux: Mount a USB HDD driver (formatted on PC) to /mnt :
FS_MOUNT "-t vfat /dev/sdb1" "/mnt"
OS2x: Mount a USB key with “r” access only.
FS_MOUNT "/usb/rdisk0" "/volume0" "r"
Limits: Software: OS21 with OSPlus (not Linux).
Hardware: Available for all platforms with a mass storage device.

8214357 Rev C 105/190


Testtool STAPI SDK

FS_RENAME
Usage: FS_RENAME <OldName> <NewName>
Parameters:
<OldName> This parameter is the current name of the file to be renamed.
<NewName> This parameter is the new name of the file.

Description: Use this command to rename a file. For OS21, it is not possible to create a directory
on the host machine (through JTAG).
Note: This command works only for files and not directories.
Example: Linux: Rename a file:
FS_RENAME "/mnt/image.jpg" "/mnt/image1.jpg"
OS2x: Rename a file on ATA interface
FS_RENAME "/ATA00/stream.ts" "/ATA00/stream.trp"
Limits: Software: OS21 with OSPlus (not Linux).
Hardware: Available for all platforms with a mass storage device.

FS_RMDIR
Usage: FS_RMDIR <Pathname>
Parameters:
<Pathname> This parameter is the pathname of the directory to delete.

Description: Use this command to remove a directory. For OS21, it is not possible to delete a
directory on the host machine (through JTAG).
Example: Linux: Delete a directory on a mounted file system
FS_RMDIR "/mnt/mydirectory"
OS2x: Delete a directory on the USB key
FS_RMDIR "/USBRDISK00/mydirectory"
Limits: Software: Requires OSPlus for OS2x systems.
Hardware: Available for all platforms with a mass storage device.

106/190 8214357 Rev C


STAPI SDK Testtool

FS_UMOUNT
Usage: FS_UMOUNT <MountName>
Parameters:
<MountName> This parameter is the mount point name of the mass storage
to unmount.

Description: Use this command to perform a "umount" in order to unmount a mass storage device.
Example: Linux: Unmount /mnt:
FS_UMOUNT "/mnt"
OS2x: Unmount USB key
FS_UMOUNT "/USBRDISK00"
Limits: Software: OS21 with OSPlus (not Linux).
Hardware: Available for all platforms with a mass storage device.

8.3.14 FSK commands

FSK_CHANGE_CHANNEL
Usage: FSK_CHANGE_CHANNEL <DeviceID> <FEDeviceID> <FreqMhz> <Polarity>
<Band>
Parameters:
<DeviceID> The identifier of the tuner device, an integer started from 0.
<FEDeviceID> The identifier of the FSK device.
<FreqMhz> The frequency in MHz.
<Polarity> FSK_POL_V: Vertical polarity.
FSK_POL_H: Horizontal polarity.
<Band> Either 0 or 1.

Description: Use this command to change channel.


Example: FSK_CHANGE_CHANNEL
Limits: Software: No Linux support. FSK not supported with stfrontend.
Hardware: Hardware change required on the board to support FSK filtering.

FSK_INFO
Usage: FSK_INFO
Parameters: None.
Description: This command displays revision number of the STFSK driver.
Example: FSK_INFO
Limits: Software: No Linux support. FSK not supported with stfrontend.
Hardware: Hardware change required on the board to support FSK filtering.

8214357 Rev C 107/190


Testtool STAPI SDK

FSK_TUNER_REGISTER
Usage: FSK_TUNER_REGISTER <DeviceID> <FEDeviceID>
Parameters:
<DeviceID> The identifier of the tuner device, an integer started from 0.
<FEDeviceID> The identifier of the FSK device.

Description: Use this command to register the tuner with FSK device.
Example: FSK_TUNER_REGISTER 0 0
Limits: Software: No Linux support. FSK not supported with stfrontend.
Hardware: Hardware change required on the board to support FSK filtering.

FSK_TUNER_STATUS
Usage: FSK_TUNER_STATUS <DeviceID> <FEDeviceID>
Parameters:
<DeviceID> The identifier of the tuner device, an integer started from 0.
<FEDeviceID> The identifier of the FSK device.
Description: This command displays the status of the specified FSK-registered tuner.
Example: FSK_TUNER_STATUS 0 1
Limits: Software: No Linux support. FSK not supported with stfrontend.
Hardware: Hardware change required on the board to support FSK filtering.

FSK_TUNER_UNREGISTER
Usage: FSK_TUNER_UNREGISTER <DeviceID>
Parameters: <DeviceID> The identifier of the tuner device, an integer started from 0.
Description: Use this command to unregister the specified tuner.
Example: FSK_TUNER_UNREGISTER 0
Limits: Software: No Linux support. FSK not supported with stfrontend.
Hardware: Hardware change required on the board to support FSK filtering.

108/190 8214357 Rev C


STAPI SDK Testtool

8.3.15 Graphics based commands

GFX_ALPHA
Usage: GFX_ALPHA <Id> <Alpha0> <Alpha1>
Parameters:
<Id> This is the identifier for the graphic plane.
<Alpha0> This parameter is the global alpha 0 value (8 bits).
<Alpha1> This parameter is the global alpha 1 value (8 bits).

Description: Use this command to change global alpha 0 and 1 to a specific graphic plane
specified by the <Id> parameter. This command is mainly used when the graphic
plane is in ARGB1555 format. There is one bit of alpha: when the bit is 0, <Alpha0>
is applied, and when the bit is 1, <Alpha1> is applied for the transparency.
For other color formats, <Alpha0> is equal to <Alpha1>.
Example: Set Alpha0 to 0x70 and Alpha1 to 0x10:
GFX_ALPHA 0 #70 #10
Limits: Software: None.
Hardware: None.

8214357 Rev C 109/190


Testtool STAPI SDK

GFX_BITMAP
Usage: GFX_BITMAP <Id> <Filename> [<SrcScaleMode> <DstScaleMode>]
[<S_Xin> <S_Yin> <S_Width> <S_Height>] [<D_Xin> <D_Yin>
<D_Width> <D_Height>]
Parameters:
<Id> This is the identifier for the graphic plane.
<Filename> The filename of the bitmap to be loaded.
<SrcScaleMode> This parameter is optional and can take the following values :
– GFX_SDEFAULT: Take the full bitmap and display
it.
– GFX_SAUTO: Take the full bitmap and display it.
– GFX_SMANUAL: Specify a specific window area of
the bitmap to be displayed. The window area is set
by the optional parameters <S_Xin>, <S_Yin>,
<S_Width> and <S_Height>.
<DstScaleMode> This parameter is optional and can take the following values :
– GFX_SDEFAULT: Put the bitmap in the middle of
screen.
– GFX_SAUTO: Take the full bitmap and display it.
– GFX_SMANUAL: Specify a specific window area of
the bitmap to be displayed. The window area is set
by the optional parameters <D_Xin>, <D_Yin>,
<D_Width> and <D_Height>.

Description: Use this command to display the bitmap in the file <Filename> in the graphic plane
<Id>. For OS2x systems, it is possible to name a file located on the host to be loaded
using JTAG, such as C:\files\mypicture.gam. On Linux or OS2x/OSPlus
systems, specify bitmaps files that are located on a locally mounted mass storage
device.
The only bitmap format currently supported is the .gam format, which is a specific ST
file format. Use the gfx tool on a PC to convert .bmp files to .gam files. The gfx tool
can be provided by an ST FAE.
The input bitmap can have a color format that is different from the graphic plane in
which you want to display it. In this case, the accelerated embedded blitter performs
the color format conversion. If the input format is the same, and if no resize is
requested, the CPU copies the bitmap.
The graphics plane must be enabled in order to see the bitmap. See the
GFX_ENABLE command for more details.
Example: Display a complete picture and center if on the layer:
GFX_BITMAP 0 "/mnt/crow_argb_1555.gam"
Zoom a specific part of the picture and center if on the layer.
GFX_BITMAP 0 "/mnt/crow_argb_1555.gam" GFX_SMANUAL GFX_SDEFAULT
+100 +100 +300 +300

110/190 8214357 Rev C


STAPI SDK Testtool

Limits: Software: None.


Hardware: None.

GFX_DISABLE
Usage: GFX_DISABLE <Id>
Parameters:
<Id> This is the identifier for the graphic plane.

Description: Use this command to disable a graphic plane <Id>.


Example: GFX_DISABLE 0
Limits: Software: None.
Hardware: None.

GFX_ENABLE
Usage: GFX_ENABLE <Id>
Parameters:
<Id> This is the identifier for the graphic plane.

Description: Use this command to enable a graphic plane <Id>.


Example: GFX_ENABLE 0
Limits: Software: None.
Hardware: None.

GFX_INFO
Usage: GFX_INFO
Parameters: None.
Description: This command displays the STLAYER/STBLIT driver version.
Limits: Software: None.
Hardware: None.

8214357 Rev C 111/190


Testtool STAPI SDK

GFX_SETANTIFLICKER
Usage: GFX_SETANTIFLICKER <Id> <State>
Parameters:
<Id> This is the identifier for the graphic plane.
<State> 0: Disable antiflicker
1: Enable antiflicker

Description: Use this command to enable or disable antiflicker.


Example: GFX_SETANTIFLICKER 0 1
Limits: Software: None.
Hardware: None.

GFX_SETWINDOW
Usage: GFX_SETWINDOW <Id> <In_X> <In_Y> <In_Width> <In_Height> <Out_X>
<Out_Y> <Out_Width> <Out_Height>
Parameters:
<Id> This is the identifier for the graphic plane.
<In_*> These parameters define the window area of the source to be
resized in the graphic plane.
<Out_*> These parameters define the window area of the destination.
Description: Use this command to resize a part of a graphic plane <Id>.
Example: GFX_SETWINDOW 0 +100 +100 +300 +300 0 0 +720 +576
Limits: Software: None.
Hardware: None.

8.3.16 Graphical User Interface (GUI) control commands

GUI_COM
Usage: GUI_COM
Parameters: None.
Description: Use this command to control the GUI interface through testtool.
Example: GUI_COM
Limits: Software: None.
Hardware: None.

112/190 8214357 Rev C


STAPI SDK Testtool

GUI_INFO
Usage: GUI_INFO
Parameters: None.
Description: This command displays the GUI driver version.
Example: GUI_INFO
Limits: Software: None.
Hardware: None.

GUI_RESTORE
Usage: GUI_RESTORE
Parameters: None.
Description: This command reads a channel list from a local file.
Example: GUI_RESTORE
Limits: Software: None.
Hardware: None.

GUI_SAVE
Usage: GUI_SAVE
Parameters: None.
Description: This command saves a channel list to a local file.
Example: GUI_SAVE
Limits: Software: None.
Hardware: None.

GUI_SORT
Usage: GUI_SORT
Parameters: None.
Description: This command sorts the channel list.
Example: GUI_SORT
Limits: Software: None.
Hardware: None.

8214357 Rev C 113/190


Testtool STAPI SDK

8.3.17 High-Definition Multimedia Interface (HDMI) commands

HDMI_DISABLE
Usage: HDMI_DISABLE <Id>
Parameters:
<Id> This parameter is the HDMI device to be disabled. After this
call, video or graphic planes should disappear on the HDMI
screen connected to the box.

Description: Use this command to disable the HDMI output <Id>.


Example: HDMI_DISABLE 0
Limits: Software: None.
Hardware: Available only when the chipset has a HDMI interface.

HDMI_ENABLE
Usage: HDMI_ENABLE <Id>
Parameters:
<Id> This parameter is the HDMI device to be enabled. After this
call, video or graphic planes should be displayed on the HDMI
screen connected to the box.

Description: Use this command to enable the HDMI output <Id>.


Example: HDMI_ENABLE 0
Limits: Software: None.
Hardware: Available only when the chipset has a HDMI interface.

HDMI_INFO
Usage: HDMI_INFO
Parameters: None.
Description: This command displays the STHDMI driver version.
Example: HDMI_INFO
Limits: Software: None.
Hardware: Available only when chipset has a HDMI interface.

114/190 8214357 Rev C


STAPI SDK Testtool

HDMI_SETAVI
Usage: HDMI_SETAVI <Id> <AviTag> <AviValue> [<AviTag> <AviValue>]...
Parameters:
<Id> This is the HDMI device identifier.
<AviTag> This parameter is a tag that identifies the AVI info frame to be
set. It can take the following values:
– HDMI_AS: Change the aspect ratio.
– HDMI_AAS: Change the active aspect ratio.
– HDMI_PS: Change picture scaling.
– HDMI_OUT: Change output type.
– HDMI_COL: Change colorimetry.
– HDMI_SCI: Change scan information.
– HDMI_END: Special tag to identify end of the
parameters. This tag does not have an associated
<AviValue>.
<AviValue> This parameter is the value associated with the tag specified by
the previous parameter. It can take the following values :
– HDMI_RGB: Set output type to RGB888
(Tag = HDMI_OUT).
– HDMI_YC: Set output type to YCBCR444
(Tag = HDMI_OUT).
– HDMI_169: Set aspect ratio to 16/9
(Tag = HDMI_AS/AAS).
– HDMI_43: Set aspect ratio to 4/3
(Tag = HDMI_AS/AAS).
– HDMI_2211: Set aspect ratio to 221/1
(Tag = HDMI_AS/AAS).
– HDMI_SQUARE: Set aspect ratio to square
(Tag = HDMI_AS/AAS).
– HDMI_ITUR601: Set colorimetry to 601
(Tag = HDMI_COL).
– HDMI_ITUR709: Set colorimetry to 709
(Tag = HDMI_COL).
– HDMI_SCANNODATA: Set no scan
(Tag = HDMI_PS/SCI)
– HDMI_OVERSCANNED: Set over scan
(Tag = HDMI_PS/SCI)
– HDMI_UNDERSCANNED: Set under scan
(Tag = HDMI_PS/SCI)

8214357 Rev C 115/190


Testtool STAPI SDK

Description: Use this command to send AVI info frames to the HDMI receiver (screen <Id>). Many
AVI info frames exist, which is why the command accepts one tag parameter to
identify which info frame to update and a value to be set to the associated info frame.
Example: HDMI_SETAVI 0 HDMI_OUT HDMI_RGB HDMI_END
Limits: Software: None.
Hardware: Available only when chipset has a HDMI interface.

HDMI_SETKEY
Usage: HDMI_SETKEY <Id> <IV_0> <IV_1> <KSV_0> <KSV_1>
Parameters:
<Id> This is the HDMI device identifier.
<IV_0> This parameter is the initial vector LSB 32 bits.
<IV_1> This parameter is the initial vector MSB 32 bits.
<KSV_0> This parameter is the key selection vector LSB 32 bits.
<KSV_1> This parameter is the key selection vector MSB 32 bits.

Description: Use this command to specify key vectors for the High-bandwidth Digital Content
Protection (HDCP) authentication. This command does not permit the full key to be
specified.
You will need to modify the code to perform this operation. See
stapp/hdmi/hdmi.c and HDMI_DeviceKeys[] array.
This command is available only if the STAPI SDK tree has been compiled with HDCP
support. (This option is enabled through the .mak file of the platform when activating
STVOUT_HDCP_PROTECTION). This is possible only if you have a tree with the
appropriate HDCP support inside the STAPI drivers, and for that you require an
HDCP licence. By default, STAPI SDK is not provided with HDCP support, so this
testtool command is not available by default.
Example: HDMI_SETKEY 0 #11223344 #00556677 #00000001 #23456789
Limits: Software: Available only with HDCP licence and appropriate STAPI drivers.
Hardware: Available only when chipset has a HDMI/HDCP interface.

HDMI_STATUS
Usage: HDMI_STATUS <Id>
Parameters:
<Id> This is the HDMI device identifier.

Description: Use this command to get information about the HDMI device <Id>. It displays the
name of the HDMI receiver and some of these capabilities (like DVI or HDMI
capable.)
Example: HDMI_STATUS 0
Limits: Software: None.
Hardware: Available only when chipset has a HDMI interface.

116/190 8214357 Rev C


STAPI SDK Testtool

8.3.18 I2C interface commands

I2C_DETECT
Usage: I2C_DETECT <Mode>
Parameters:
<Mode> This parameter is the mode to be used for write I2C access.
– 0 : Normal write and read access.
– 1 : Write with no stop bit access.

Description: Use this command to detect if anything is connected on the I2C bus defined on the
platform. The test carries out read and write accesses to all I2C addresses from 0x00
to 0xFF. and displays the I2C addresses that reply properly to read or write access.
This command is useful to check if demodulators are properly connected on the
board (for example, not in a reset state).
Example: I2C_DETECT 0
Limits: Software: None.
Hardware: Depending on the I2C topology of the board, this command may cause a
lock-up if, for example, the I2C bus tested is in tristate or if a I2C peripheral does not
like dummy read or write. If this occurs on a platform, repeat the test after changing
the <Mode> parameter.

I2C_INFO
Usage: I2C_INFO
Parameters: None.
Description: This command displays the STI2C driver version.
Example: I2C_INFO
Limits: Software: None.
Hardware: None.

I2C_READ
Usage: I2C_READ <Device> <Address> <NbBytes>
Parameters:
<Device> The I2C bus device identifier, an integer starting from 0.
<Address> The peripheral I2C address from which to read.
<NbBytes> The number of bytes to be read.

Description: Use this command to read <NbBytes> bytes on a specific I2C peripheral on the bus.
The command displays the bytes read.
Example: I2C_READ 0 #38 2
Limits: Software: None.
Hardware: None.

8214357 Rev C 117/190


Testtool STAPI SDK

I2C_READEXT
Usage: I2C_READEXT <Device> <Address> <SubAddress>
Parameters:
<Device> The I2C bus device identifier, an integer starting from 0.
<Address> The peripheral I2C address from which to read.
<SubAddress> This is the specific register address to read.

Description: Use this command to read only one byte on a specific I2C peripheral on the bus using
the read extended mode. The command first performs a write access (without stop
bit) to transfer the sub address to the peripheral, then performs a read access to get
the content of the sub address. The command displays the byte read.
Example: I2C_READEXT 0 #38 1
Limits: Software: None.
Hardware: None.

I2C_WRITE
Usage: I2C_WRITE <Device> <Address> <Byte0> [<ByteN>]
Parameters:
<Device> The I2C bus device identifier, an integer starting from 0.
<Address> The peripheral I2C address to which to write.
<Byte0> First byte to write to the peripheral
<ByteN> Remaining bytes to be written to the peripheral. N must be
less than or equal to 63.

Description: Use this command to write N bytes on a specific I2C peripheral on the bus.
Example: I2C_WRITE 0 #38 #11 #22 #33 #44....
Limits: Software: None.
Hardware: None.

118/190 8214357 Rev C


STAPI SDK Testtool

8.3.19 Internet Protocol (IP) commands

IP_CONFIG
Usage: IP_CONFIG <Id> [<Address>] [<Mask>] [<Gateway>]
Description: Use this command to get or set the IP configuration of the ethernet interface <Id>. If
invoked with <Id> as the only parameter, the command displays the current
configuration.
Parameters:
<Id> The ethernet device identifier, which is an integer starting from
0.
<Address> This is a string which contains the IP address to be set. If the
parameter DHCP is passed as the address, it automatically
request the IP from the server.
<Mask> This is a string which contains the mask/subnet to be set.
<Gateway> This is a string which contains the IP address of the gateway.

Example: Get current IP configuration:


IP_CONFIG 0
Ip Address : 192.168.1.50
Netmask : 255.255.255.0
Gateway : 192.168.1.254
MAC Address : 00:FA:E0:00:FA:E0
Set a new IP configuration:
IP_CONFIG 0 "164.129.62.12" "255.255.254.0" "164.129.62.1"
Ip Address : 164.129.62.12
Netmask : 255.255.254.0
Gateway : 164.129.62.1
MAC Address : 00:FA:E0:00:FA:E0
Limits: Software: (OS21 with OSPlus) not Linux.
Hardware: The platform needs to have an ethernet interface.

IP_FTP_START
Usage: IP_FTP_START <Id>
Parameters:
<Id> The ethernet device identifier, which is an integer starting from
0.

Description: Use this command to start the FTP server.


Example: IP_FTP_START 0
Limits:

8214357 Rev C 119/190


Testtool STAPI SDK

IP_FTP_STOP
Usage: IP_FTP_STOP <Id>
Parameters:
<Id> The ethernet device identifier, which is an integer starting from
0.

Description: Use this command to stop the FTP server.


Example: IP_FTP_STOP 0
Limits:

IP_INFO
Usage: IP_INFO
Parameters: None.
Description: This command displays the revision numbers of the TCP/IP driver and its associated
modules.
Example: IP_INFO
Limits:

IP_PING
Usage: IP_PING <Id> <Address>
Parameters:
<Id> The ethernet device identifier, which is an integer starting from
0.
<Address> The IP address to ping.

Description: Use this command to ping an IP address.


Example: IP_PING 0 "167.126.1.45"
Limits:

IP_STATUS
Usage: IP_STATUS <Id> <Reset>
Parameters:
<Id> The ethernet device identifier, which is an integer starting from
0.
<Reset> 0: Do not reset the statistics
1: Reset the statistics.

Description: This command displays statistics relating to the TCP/IP driver.


Example: IP_STATUS 0 0
Limits:

120/190 8214357 Rev C


STAPI SDK Testtool

IP_STREAMS
Usage: IP_STREAMS <Id> <Name> <Params> <Mode>
Description: Use this command to either get or set the IP streams configuration.
Parameters:
<Id> The ethernet device identifier, which is an integer starting from
0.
<Name> The name of the IP stream, and is one of the following: IP0,
IP1, IP2 or IP3.
<Params> The stream parameters to set
<Mode> This is either "r" or "w" (for "read" or "write" respectively).

Example:
Limits:

8.3.20 Keyscan based commands

KEYSCN_INFO
Usage: KEYSCN_INFO
Parameters: None.
Description: This command displays the STKEYSCN driver version.
Example: KEYSCN_INFO
Limits: Software: None.
Hardware: Available only when chipset has a keyscan interface.

KEYSCN_GETKEY
Usage: KEYSCN_GETKEY <Id> <NumberKeysToRead> <TimeOutInMs>
Description: Use this command to get keys from a keyboard connected to the platform. It displays
the keystrokes detected.
Note: The parameter <NumberKeysToRead> must be twice the number of the actual
physical keystrokes to be captured, as each keystroke is registered once when it is
pressed and once again when it is released.
Parameters:
<Id> The identifier of the keyscan interface.
<NumberKeysToRead> Total number of keystrokes to read (see Note above)
<TimeOutInMs> Timeout in milliseconds
Example: To capture two keystrokes from keyboard interface 0:
KEYSCN_GETKEY 0 +4 +10000
Limits: Software: None.
Hardware: Available only when chipset has a keyscan interface.

8214357 Rev C 121/190


Testtool STAPI SDK

KEYSCN_GETPARAMS
Usage: KEYSCN_GETPARAMS <Id>
Description: Use this command to get the current parameters of the keyscan interface. It displays
all the useful parameters (such as debounce time).
Parameters:
<Id> The identifier of the keyscan interface.

Example: KEYSCN_GETPARAMS 0
Limits: Software: None.
Hardware: Available only when chipset has a keyscan interface.

KEYSCN_SETDEBOUNCETIME
Usage: KEYSCN_SETDEBOUNCETIME <Id> <DebounceTimeInMs>
Parameters:
<Id> The identifier of the keyscan interface.
<DebounceTimeInMs> This parameter is the debounce time in milliseconds

Description: Use this command to set the debounce time of the keyscan interface. The debounce
time is the time to refresh the keyboard status. It is set in milliseconds.
Example: KEYSCN_SETDEBOUNCETIME 0 +3
Limits: Software: None.
Hardware: Available only when chipset has a KEYSCAN interface.

8.3.21 PIO commands

PIO_ATA_RESET
Usage: PIO_ATA_RESET <OnOff>
Parameters:
<OnOff> The state of PIO to be set:
0: 0V
1: +3.3V

Description: Use this command to set or clear a PIO to reset the hard disk drive. Set the <OnOff>
parameter to 1 to configure the PIO to high voltage at the output (typically +3.3V).
This is done by the STAPI SDK software when initializing the PATA/SATA hard disk
drives (that is, with the ATAPI_Init() function call).
Example: PIO_ATA_RESET 0
; Wait 100ms
WAIT +100
PIO_ATA_RESET 1
Limits: Software: None.
Hardware: Platform dependant.

122/190 8214357 Rev C


STAPI SDK Testtool

PIO_CLEAR
Usage: PIO_CLEAR <PIONumber> <BitNumber>
Parameters:
<PIONumber> This is the PIO block number to be used to clear a specific bit.
This parameter is an integer in the range of 0 to N, where N is
determined by the chipset used. For example, on the STi7109,
N = 7.
<BitNumber> This is the specific bit to clear [0,7].

Description: Use this command to clear the PIO specified by the <PIONumber> and
<BitNumber> parameters. "Clear" means set to 0, or 0V.
Example: Set the PIO3.7 on the board to 0V:
PIO_CLEAR 3 7
Limits: Software: None.
Hardware: Platform dependant.

PIO_DAC_RESET
Usage: PIO_DAC_RESET <OnOff>
Parameters:
<OnOff> The state of PIO to be set:
0: 0V
1: +3.3V

Description: Use this command to set or clear a PIO to reset the DACs that are connected to the
chipset. In this sense, “DAC” is generic in that it could be video or audio DAC. This
command is dependant on the platform used, and in most cases, there is no DAC to
be reset. The <OnOff> parameter has to be set to 1 to configure the PIO to high
voltage at the output (typically +3.3V).
Example: PIO_DAC_RESET 1
; Wait 100ms
WAIT +100
PIO_DAC_RESET 0
; Wait 100ms
WAIT +100
PIO_DAC_RESET 1
Limits: Software: None.
Hardware: Platform dependant.

8214357 Rev C 123/190


Testtool STAPI SDK

PIO_FE_RESET
Usage: PIO_FE_RESET <OnOff>
Parameters:
<OnOff> The state of PIO to be set:
0: 0V
1: +3.3V

Description: Use this command to set or clear a PIO to reset the demodulator and tuners on the
platform. This must be done before sending I2C commands to the demodulators
when trying to set the frequency to lock to a specific channel. Set the <OnOff>
parameter to 1 to configure the PIO to high voltage at the output (typically +3.3V).
This is done by the STAPI SDK software when initializing the tuner parts (that is, a call
to TUNER_Init() ).
Example: PIO_FE_RESET 1
; Wait 100ms
WAIT +100
PIO_FE_RESET 0
; Wait 100ms
WAIT +100
PIO_FE_RESET 1
Limits: Software: None.
Hardware: Platform dependant.

PIO_GET
Usage: PIO_GET <PIONumber> <BitNumber>
Parameters:
<PIONumber> Get the state of a given bit within this PIO block. This can be a
value from 0 to N, where N is the maximum number of PIO
blocks on the SoC.
<BitNumber> Get the state of this bit. This is an integer in the range of 0 to
7.
Description: Use this command to get the state of the PIO specified by the <PIONumber> and
<BitNumber> parameters. If the PIO is at 0V on the output, the command returns 0.
Note: This command works only for PIOs that are not used as outputs or alternate
functions. The PIO to be read has to be a free PIO and configured as an input.
Example: Return state of the push-button connected to PIO4.1:
PIO_GET 4 1
Limits: Software: None.
Hardware: Platform dependant.

124/190 8214357 Rev C


STAPI SDK Testtool

PIO_INFO
Usage: PIO_INFO
Parameters: None.
Description: This command displays the STPIO driver version.
Example: PIO_INFO
Limits: Software: None.
Hardware: None.

PIO_LED
Usage: PIO_LED <LEDNumber> <OnOff>
Parameters:
<LEDNumber> This is the LED identifier parameter starting from 0 to N.
<OnOff> 0: Power off the LED
1: Power on the LED
Description: Use this command to power on or off any of the LEDs on the platform.
Example: To illuminate LED number 2:
PIO_LED 2 1
Limits: Software: None.
Hardware: Platform dependant.

PIO_MODEM_RESET
Usage: PIO_MODEM_RESET <OnOff>
Parameters:
<OnOff> The state of PIO to be set:
0: 0V
1: +3.3V

Description: Use this command to set or clear a PIO to reset the modem available on the platform.
The <OnOff> parameter has to be set to 1 to configure the PIO to high voltage at the
output (typically +3.3V).
Example: PIO_MODEM_RESET 1
; Wait 100ms
WAIT +100
PIO_MODEM_RESET 0
; Wait 100ms
WAIT +100
PIO_MODEM_RESET 1
Limits: Software: None.
Hardware: Platform dependant.

8214357 Rev C 125/190


Testtool STAPI SDK

PIO_SET
Usage: PIO_SET <PIONumber> <BitNumber>
Parameters:
<PIONumber> Set the state of a given bit within this PIO block. This can be a
value from 0 to N, where N is the maximum number of PIO
blocks on the SoC.
<BitNumber> Set the state of this bit of the given PIO. This is an integer in
the range of 0 to 7.

Description: Use this command to set the PIO specified by <PIONumber> and <BitNumber>
parameters. In this context, "set" means to configure the PIO to high voltage (typically
3.3V).
Example: Set PIO2.4 on the board:
PIO_SET 2 4
Limits: Software: None.
Hardware: Platform dependant.

PIO_USB_RESET
Usage: PIO_USB_RESET <OnOff>
Parameters:
<OnOff> This is the state of PIO to be set:
0: 0V
1: +3.3V

Description: Use this command to set or clear a PIO to reset the USB interface. Set the <OnOff>
parameter to 1 to configure the PIO to high voltage at the output (typically +3.3V).
Note: The reset is performed by the STAPI SDK software when initializing the USB interface
(that is, a USB_Init() call).
Example: PIO_USB_RESET 0
Wait 100ms before reset:
WAIT +100
PIO_USB_RESET 1
Limits: Software: None.
Hardware: Platform dependant.

126/190 8214357 Rev C


STAPI SDK Testtool

8.3.22 Picture in Picture use case commands

PIP_CLOSE
Usage: PIP_CLOSE <Id>
Parameters: <Id> The identifier of a PiP viewport.
Description: Close a picture-in-picture viewport.
Example: PIP_CLOSE 0
Limits:

PIP_DISABLE
Usage: PIP_DISABLE <Id>
Parameters: <Id> The identifier of a PiP viewport.
Description: Use this command to disable a picture-in-picture viewport.
Example: PIP_DISABLE 0
Limits:

PIP_ENABLE
Usage: PIP_ENABLE <Id>
Parameters: <Id> The identifier of a PiP viewport.
Description: Use this command to enable a picture-in-picture viewport.
Example: PIP_ENABLE 0
Limits:

PIP_OPEN
Usage: PIP_OPEN <Id> <VideoId> <GfxId>
Parameters:
<Id> The identifier of a PiP viewport.
<VideoId> The identifier of the video device to display the PiP viewport.
<GfxId> The identifier of the graphics layer on which to display the PiP
viewport.

Description: Use this command to open a picture-in-picture viewport.


Example: PIP_OPEN
Limits:

8214357 Rev C 127/190


Testtool STAPI SDK

PIP_PAUSE
Usage: PIP_PAUSE <Id>
Parameters: <Id> The identifier of a PiP viewport.
Description: Use this command to pause a picture-in-picture viewport.
Example: PIP_PAUSE 0
Limits:

PIP_RESUME
Usage: PIP_RESUME <Id>
Parameters: <Id> The identifier of a PiP viewport.
Description: Use this command to resume a picture-in-picture viewport that is currently paused.
Example: PIP_RESUME 0
Limits:

PIP_SETWINDOW
Usage: PIP_SETWINDOW <Id> <Xpos> <Ypos> <Width> <Height>
Description: Use this command to move a picture-in-picture viewport to the given position and size
it to the given dimensions.
Parameters:
<Id> The identifier of a PiP viewport.
<Xpos> The X co-ordinate of the ?? corner of the PiP viewport.
<Ypos> The Y co-ordinate of the ?? corner of the PiP viewport.
<Width> The new width of the PiP viewport, in pixels?
<Height> The new height of the PiP viewport, in pixels?

Example: PIP_SETWINDOW 0 150 100 250 200


Limits:

128/190 8214357 Rev C


STAPI SDK Testtool

8.3.23 Play commands

PLAY_AUDIO_SETOUTPUT
Usage: PLAY_AUDIO_SETOUTPUT <Id> <Enable>
Parameters:
<Id> The playback identifier, 0 or 1.
<Enable> 0: Disable audio playback.
1: Enable audio playback.

Description: Use this command to enable or disable audio playback.


Example: PLAY_AUDIO_SETOUTPUT 0 1
Limits:

PLAY_CHANGEPIDS
Usage: PLAY_CHANGEPIDS <Id> [<PidList>]
Parameters:
<Id> The playback identifier, 0 or 1.
<PidList> The type of playback, which is one of the following: P_MP1V,
P_MP2V, P_MP4V, P_H264, P_MPEG4P2, P_VC1, P_MP1A,
P_MP2A, P_MP4A, P_AC3, P_AAC, P_HEAAC, P_WMA,
P_DDPLUS, P_DTS, P_TTXT, P_SUBT, P_PCR, P_PID, P_AVS
or P_END.

Description: Use this command to update the PID list to play.


Example: PLAY_CHANGEPIDS 0 P_MP4V
Limits:

PLAY_INFO
Usage: PLAY_INFO
Parameters: None
Description: This command provides information about the playback driver.
Example: PLAY_INFO
Limits:

PLAY_PAUSE
Usage: PLAY_PAUSE <Id>
Parameters: <Id> The playback identifer, 0 or 1.
Description: Use this command to pause playback
Example: PLAY_PAUSE 0
Limits:

8214357 Rev C 129/190


Testtool STAPI SDK

PLAY_PAUSERECORD
Usage: PLAY_PAUSERECORD <PlayId> <RecordId> <Filename> <Size>
Parameters:
<PlayId> The playback identifier, 0 or 1.
<RecordId> The record identifier, 0 or 1.
<Filename> The name of the file in which the recording is to be stored.
<Size> The size in minutes.

Description: Use this command to pause playback and start a record


Example: PLAY_PAUSERECORD 0
Limits:

PLAY_PROGRAM
Usage: PLAY_PROGRAM <Id> <Filename> <ProgramId> [<Layer> ]
Parameters:
<Id> The playback identifier, 0 or 1.
<Filename> The name of the file to play.
<ProgramId> The program identifier.
<Layer> One of P_MAIN, P_AUX or P_REMOTE.
Description: Use this command to playback the contents of the file <Filename>.
Example: PLAY_PROGRAM 0 "stream.trp" 0x0001 P_MAIN
Limits:

PLAY_PROGRAM_A3
Usage: PLAY_PROGRAM_A3 <Id> <Filename> <ProgramId> [<Layer> ]
Parameters:
<Id> The playback identifier, 0 or 1.
<Filename> The name of the file to play.
<ProgramId> The program identifier.
<Layer> One of P_MAIN, P_AUX or P_REMOTE.

Description: Use this command to playback an A3 service from the contents of the file
<Filename>.
Example: PLAY_PROGRAM 0 "stream.trp" 0x0001 P_MAIN
Limits:

130/190 8214357 Rev C


STAPI SDK Testtool

PLAY_PROGRAM_DTV
Usage: PLAY_PROGRAM_DTV <Id> <Filename> <ProgramId> [<Layer> ]
Parameters:
<Id> The playback identifier, 0 or 1.
<Filename> The name of the file to play.
<ProgramId> The program identifier.
<Layer> One of P_MAIN, P_AUX or P_REMOTE.

Description: Use this command to playback a DTV service from the contents of the file
<Filename>.
Example: PLAY_PROGRAM 0 "stream.trp" 0x0001 P_MAIN
Limits:

PLAY_RESUME
Usage: PLAY_RESUME <Id>
Parameters: <Id> The playback identifer, 0 or 1.
Description: Use this command to resume playback that is currently paused.
Example: PLAY_RESUME 0
Limits:

PLAY_SEEK
Usage: PLAY_SEEK <Id> <SeekInMs> <SeekMode>
Parameters:
<Id> The playback identifier, 0 or 1.
<SeekInMs> Seek time, in milliseconds.
<SeekMode> Seek mode, one of P_SEEK_SET, P_SEEK_CUR or
P_SEEK_END

Description: Use this command to perform a seek into a playback file.


Example: PLAY_SEEK 0 500000 P_SEEK_SET
Limits:

8214357 Rev C 131/190


Testtool STAPI SDK

PLAY_SPEED
Usage: PLAY_SPEED <Id> <Speed>
Parameters:
<Id> The playback identifier, 0 or 1.
<Speed> The speed of playback, which must be a signed value
(prefixed by + or -).

Description: Use this command to set the speed of playback.


Example: PLAY_SPEED 0 +100
Limits:

PLAY_START
Usage: PLAY_START <Id> <Filename> [<PidList>] [<Layer>]
Parameters:
<Id> The playback identifier, 0 or 1.
<Filename> The name of the file to play.
<ProgramId> The program identifier.
<Layer> One of P_MAIN, P_AUX or P_REMOTE.
Description: Use this command to start video and audio decoding.
Example: PLAY_START 0 "stream.trp" 0x0001 P_MAIN
Limits:

PLAY_STATUS
Usage: PLAY_STATUS <Id>
Parameters: <Id> The playback identifer, 0 or 1.
Description: This command displays the status of the selected playback.
Example: PLAY_STATUS 0
Limits:

PLAY_STEP
Usage: PLAY_STEP <Id>
Parameters: <Id> The playback identifer, 0 or 1.
Description: Use this command to step through the playback.
Example: PLAY_STEP 0
Limits:

132/190 8214357 Rev C


STAPI SDK Testtool

PLAY_STOP
Usage: PLAY_STOP <Id> <Freeze>
Parameters:
<Id> The playback identifier, 0 or 1.
<Freeze> 0: Blank the screen.
1: Keep last picture.

Description: Use this command to stop playback. The <Freeze> flag determines whether the last
picture should remain (“freeze frame”) or not.
Example: PLAY_STOP 0 1
Limits:

PLAY_VIDEO_SETOUTPUT
Usage: PLAY_VIDEO_SETOUTPUT <Id> <Enable>
Parameters:
<Id> The playback identifier, 0 or 1.
<Enable> 0: Disable video playback.
1: Enable video playback.
Description: Use this command to enable or disable video playback.
Example: PLAY_VIDEO_SETOUTPUT 0 1
Limits:

PLAY_WAIT_END
Usage: PLAY_WAIT_END <Id> <TimeOut>
Parameters:
<Id> The playback identifier, 0 or 1.
<TimeOut> The timeout to apply, in seconds.

Description: Use this command to wait until the end of playback or until the timeout expires,
whichever is the sooner.
Example: PLAY_WAIT_END 0 5
Limits:

8214357 Rev C 133/190


Testtool STAPI SDK

8.3.24 Power management commands

POWER_INFO
Usage: POWER_INFO
Description: This command displays the STPOWER driver version.
Parameters: None.
Example: POWER_INFO
Limits: Software: None.
Hardware: None.

POWER_GETPROFILE
Usage: POWER_GETPROFILE <Id> <ProfileId>
Parameters:
<Id> This parameter sets the power profile ID to use.
<ProfileId> Defines which profile data to display. If no argument is passed
it provides the present system state; that is, the profile that is
the currently set profile.

Description: This command displays the status of the power profile indicated by <Id>.
Example: POWER_GETPROFILE 0 1
Limits: Software: None.
Hardware: None.

134/190 8214357 Rev C


STAPI SDK Testtool

POWER_SETMODE
Usage: POWER_SETMODE <Id> <ProfileId> <CPUState> <WakeupCondition>
<WakeupParam>
Parameters:
<Id> This parameter sets the power profile ID to use.
<ProfileId> Defines the power mode for this profile:
0: Normal Mode
1 to 5: Active StandBy Mode
<CPUState> Defines the CPU state, which is either:
PM_CPU_SLEEP, PM_CPU_STANDBY
<WakeupCondition> One of the following:
PM_WAKEUP_NONE, PM_WAKEUP_HDMI,
PM_WAKEUP_TIMER, PM_WAKEUP_FRONTPANEL,
PM_WAKEUP_ETHERNET, PM_WAKEUP_IR
<WakeupParam> Defines a parameter to apply to the wake up condition, For
IR, HDMI Id, Blast ID and so forth, this could be the time to
wait before waking.

Description: This command selects the power mode of the system or of a specified device.
Example: POWER_SETMODE 0 1 PM_CPU_SLEEP PM_WAKEUP_TIMER 2

POWER_SETPROFILE
Usage: POWER_SETPROFILE <Id> <ProfileId> <DeviceName> <State>
Parameters:
<Id> This parameter sets the power profile ID to use.
<ProfileId> Defines the power mode for this profile.
<DeviceName> Defines the device name to append or change state
<State> Defines the device state to be changed for the device name.
Description: This command sets a specific power state for the given device when the given power
profile is selected.
Example: POWER_SETPROFILE 0 2 "I2C0" PM_NORMAL
Limits: Software: None.
Hardware: None.

8214357 Rev C 135/190


Testtool STAPI SDK

8.3.25 POD commands

POD_CONNECT
Usage: POD_CONNECT <Id> <PODMode>
Parameters:
<Id> The POD identifier.
<PODMode>

Description: This command makes a CCSC configuration for POD.


Example: POD_CONNECT
Limits:

POD_LOOPBACK_SIMPLE
Usage: POD_LOOPBACK_SIMPLE <Id>
Parameters: <Id> The POD identifier.
Description: POD simple loopback.
Example: POD_LOOPBACK_SIMPLE
Limits:

POD_LOOPBACK_ADVANCE
Usage: POD_LOOPBACK_ADVANCE <Id>
Parameters: <Id> The POD identifier.
Description: POD multi size packet loopback.
Example: POD_LOOPBACK_ADVANCE
Limits:

POD_MCARD_CP_TEST
Usage: POD_MCARD_CP_TEST <Id>
Parameters: <Id> The POD identifier.
Description: POD simple loopback.
Example: POD_MCARD_CP_TEST
Limits:

136/190 8214357 Rev C


STAPI SDK Testtool

8.3.26 Pulse Width Modulated (PWM) signal commands

PWM_INFO
Usage: PWM_INFO
Parameters: <Id> The PWM identifier, which is an integer starting from 0.
Description: This command displays the revision number of the PWM driver.
Example: PWM_INFO
Limits:

PWM_GET
Usage: PWM_SET <Id> <Value>
Parameters:
<Id> The PWM identifier, which is an integer starting from 0.
<Value> Set the specified PWM to this value. <Value> must be an
integer.
Description: Use this command to set a PWM value.
Example: PWM_SET 10 0x1000
Limits:

PWM_SET
Usage: PWM_GET <Id>
Parameters: <Id> The PWM identifier, which is an integer starting from 0.
Description: Use this command to get a PWM value.
Example: PWM_GET 10
Limits:

8.3.27 Recording commands

REC_INSERT_PMT
Usage: REC_INSERT_PMT <Id>
Parameters: <Id> The recording identifier, in the range 0 to 7.
Description: Use this command to insert a PMT into the recording.
Example: REC_INSERT_PMT 1
Limits:

8214357 Rev C 137/190


Testtool STAPI SDK

REC_PAUSE
Usage: REC_PAUSE <Id>
Parameters: <Id> The recording identifier, in the range 0 to 7.
Description: Use this command to pause recording.
Example: REC_PAUSE 0
Limits:

REC_PROGRAM
Usage: REC_PROGRAM <Id> <StreamName> <Filename> <Size> <ProgramId>
Parameters:
<Id> The recording identifier, in the range 0 to 7.
<StreamName> Record the input coming from this stream.
<Filename> Store the recording in a file with this filename.
<Size> The size of the circular file used for the recording. This is
defined in minutes.
<ProgramId> The PID of the program to be recorded, in the range 0x0001
to 0xFFFF.
Description: Use this command to start recording from the stream identified by <StreamName>.
Example: REC_PROGRAM 0
Limits:

REC_RESUME
Usage: REC_RESUME <Id>
Parameters: <Id> The recording identifier, in the range 0 to 7.
Description: Use this command to resume a recording that is currently paused.
Example: REC_RESUME 0
Limits:

138/190 8214357 Rev C


STAPI SDK Testtool

REC_START
Usage: REC_START <Id> <StreamName> <Filename> <Size> [<Type> <Pid>]
Parameters:
<Id> The recording identifier, in the range 0 to 7.
<StreamName> Record the input coming from this stream.
<Filename> Store the recording in a file with this filename.
<Size> The size of the circular file used for the recording. This is
defined in minutes.
<Type> The format of the recording, which is one of the following:
P_MP1V, P_MP2V, P_MP4V, P_H264, P_MPEG4P2, P_VC1,
P_MP1A, P_MP2A, P_MP4A, P_AC3, P_AAC, P_HEAAC, P_WMA,
P_DDPLUS, P_DTS, P_TTXT, P_SUBT, P_PCR, P_PID, P_AVS
or P_END.
<Pid> The PID of the program to be recorded, in the range 0x0001
to 0xFFFF.

Description: Use this command to start a recording.


Example: REC_START 0
Limits:

REC_STATUS
Usage: REC_STATUS <Id>
Parameters: <Id> The recording identifier, in the range 0 to 7.
Description: This command displays the current status of the recording.
Example: REC_STATUS 0
Limits:

REC_STOP
Usage: REC_STOP <Id>
Parameters: <Id> The recording identifier, in the range 0 to 7.
Description: Use this command to stop a recording in progress.
Example: REC_STOP 0
Limits:

8214357 Rev C 139/190


Testtool STAPI SDK

8.3.28 Rack commands


Rack is not supported for some low memory profile boards.

RACK_OFF
Usage: RACK_OFF
Parameters: None.
Description: Use this command to disable the rack debug plane.
Example: RACK_OFF
Limits:

RACK_ON
Usage: RACK_ON <PlaneId> <VtgId>
Parameters:
<PlaneId> This is the graphic plane index to enable.
<VtgId>

Description: Use this command to enable the rack debug plane.


Example: RACK_ON
Limits:

8.3.29 SCART commands

SCART_INFO
Usage: SCART_INFO
Parameters: None.
Description: This command displays the revision number of the SCART driver.
Example: SCART_INFO
Limits:

SCART_RATIO
Usage: SCART_RATIO <Id> <AspectRatio>
Parameters:
<Id> This is the SCART identifier.
<AspectRatio> Set the aspect ratio. This is either TV_4_3 (for a ratio of 4:3) or
TV_16_9 (for a ratio of 16:9).
Description: Use this command to change the SCART aspect ratio. The choice is between 4:3 and
16:9.
Example: SCART_RATIO 0 TV_16_9
Limits:

140/190 8214357 Rev C


STAPI SDK Testtool

SCART_SET
Usage: SCART_SET <Id> <Format>
Parameters:
<Id> This is the SCART identifier.
<Format> The output format. This is one of RGB, CVBS or YPRPB.

Description: Use this command to set the format of the SCART output. The choice is between
RGB, CVBS, or YPrPb.
Example: SCART_SET 0 RGB
Limits:

8.3.30 Smartcard commands

SMART_INFO
Usage: SMART_INFO
Parameters: None.
Description: This command displays the revision number of the Smartcard driver.
Example: SMART_INFO
Limits:

SMART_GETPARAMS
Usage: SMART_GETPARAMS <Id>
Parameters: <Id> The smartcard identifier, an integer starting from 0.
Description: This command displays the current parameters of the specified smartcard.
Example: SMART_GETPARAMS 0
Limits:

SMART_READ
Usage: SMART_READ <Id> <LengthToRead> <TimeOut>
Parameters:
<Id> The smartcard identifier, an integer starting from 0.
<LengthToRead> The number of bytes to read. The maximum is 512.
<TimeOut> The time out to apply, in milliseconds.

Description: Use this command to read the response from a smartcard after sending a command.
Example: SMART_READ 0 50 1000
Limits:

8214357 Rev C 141/190


Testtool STAPI SDK

SMART_RESET
Usage: SMART_RESET <Id>
Parameters: <Id> The smartcard identifier, an integer starting from 0.
Description: Reset the specified smartcard.
Example: SMART_RESET 0
Limits:

SMART_TRANSFER
Usage: SMART_TRANSFER <Id> <LengthToWrite> <Cmd0,Cmd1,...,CmdN>
<TimeOut>
Parameters:
<Id> The smartcard identifier, an integer starting from 0.
<LengthToWrite> The number of bytes to read. The minimum is 5 and the
maximum is 512.
<Cmd0,Cmd1,...,CmdN> A sequence of smartcard commands, delimited by
commas.
<TimeOut> The time out to apply, in milliseconds.
Description: Use this command to perform a transfer protocol on the smartcard.
Example:
Limits:

SMART_WRITE
Usage: SMART_WRITE <Id> <LengthToWrite> <Cmd0,Cmd1,...,CmdN> <TimeOut>
Parameters:
<Id> The smartcard identifier, an integer starting from 0.
<LengthToWrite> The number of bytes to read. The minimum is 5 and the
maximum is 512.
<Cmd0,Cmd1,...,CmdN> A sequence of smartcard commands, delimited by
commas.
<TimeOut> The time out to apply, in milliseconds.

Description: Use this command to perform a write operation to the specified smartcard. If the
commands written to the smartcard return data, this can be read using
SMART_READ.
Example:
Limits:

142/190 8214357 Rev C


STAPI SDK Testtool

8.3.31 SPI commands

SPI_INFO
Usage: SPI_INFO
Parameters: None.
Description: This command displays the revision number of the SPI driver.
Example: SPI_INFO
Limits:

SPI_READ
Usage: SPI_READ <Device> <Address> <NbBytes>
Parameters:
<Device> The SPI bus device identifier, which is an integer starting from
0.
<Address> The peripheral SPI address from which to read bytes.
<NbBytes> The number of bytes to read.
Description: Use this command to read a number of bytes on a specific SPI peripheral on the bus.
The command displays the bytes just read.
Example: I2C_SPI 0 #38 2
Limits: Software: None.
Hardware: SPI peripheral required.

SPI_WRITE
Usage: SPI_WRITE <Device> <Address> <Byte0> [<ByteN>]
Description: Use this command to write bytes to a specific SPI peripheral on the bus.
Parameters:
<Device> The SPI bus device identifier, which is an integer starting from
0.
<Address> The peripheral SPI address to which to write bytes.
<Byte0> The first byte to write.
[<ByteN>] The remaining bytes to write to the peripheral, where N is less
than or equal to 63.

Example: I2C_WRITE 0 #38 #11 #22 #33 #44


Limits: Software: None.
Hardware: SPI peripheral required.

8214357 Rev C 143/190


Testtool STAPI SDK

8.3.32 Subtitling commands

SUBT_INFO
Usage: SUBT_INFO
Parameters: None.
Description: This command displays the revision number of the subtitle driver.
Example: SUBT_INFO
Limits:

SUBT_ENABLE
Usage: SUBT_ENABLE <Id>
Parameters: <Id> This is the identifier of the subtitle display, which is either 0 or 1.
Description: Use this command to enable the display of subtitles.
Example: SUBT_ENABLE 0
Limits:

SUBT_DISABLE
Usage: SUBT_DISABLE <Id>
Parameters: <Id> This is the identifier of the subtitle display, which is either 0 or 1.
Description: Use this command to disable the display of subtitles.
Example: SUBT_DISABLE 0
Limits:

SUBT_START
Usage: SUBT_START <Id> <GfxId> <PID> <CompPageID> <AnciPageID>
Parameters:
<Id> This is the identifier of the subtitle display, which is either 0 or
1.
<GfxId> The identifier of the graphics layer.
<PID> The PID for the program that contains the subtitles.
<CompPageID> The identifier of the composition page.
<AnciPageID> The identifier of the ancillary page.

Description: Use this command to start displaying subtitles.


Example: SUBT_START
Limits:

144/190 8214357 Rev C


STAPI SDK Testtool

SUBT_STOP
Usage: SUBT_STOP <Id>
Parameters: <Id> This is the identifier of the subtitle display, which is either 0 or 1.
Description: Use this command to stop the display of subtitles.
Example: SUBT_STOP 0
Limits:

SUBT_SETWINDOW
Usage: SUBT_SETWINDOW <Id> <OutX> <OutY> <OutWidth> <OutHeight>
Parameters:
<Id> This is the identifier of the subtitle display, which is either 0 or
1.
<OutX> The X co-ordinate of the top left corner of the subtitle window.
<OutY> The Y co-ordinate of the top left corner of the subtitle window.
<OutWidth> The width of the window.
<OutHeight> The height of the window.
Description: Use this command to set the position and size of the window used for displaying
subtitles.
Example: SUBT_SETWINDOW 0 150 200 500 50
Limits:

8.3.33 System commands

SYS_CLOCK
Usage: SYS_CLOCK
Parameters: None.
Description: This command displays details of the configuration of the clocks.
Example: SYS_CLOCK
Limits:

SYS_ID
Usage: SYS_ID
Parameters: None.
Description: This command displays the version number of the chip cut.
Example: SYS_ID
Limits:

8214357 Rev C 145/190


Testtool STAPI SDK

SYS_IRQ
Usage: SYS_IRQ <Scope>
Parameters:
<Scope> 0: Display summary details.
1: Display full details.

Description: This command displays details of the IRQ settings. Use the <Scope> parameter to
display either full or summary details.
Example: SYS_IRQ 1
Limits:

SYS_MEM
Usage: SYS_MEM
Parameters: None.
Description: This command displays details of the memory partitions.
Example: SYS_MEM
Limits:

SYS_PROF_START
Usage: SYS_PROF_START
Parameters: None.
Description: Use this command to start task profiling.
Example: SYS_PROF_START
Limits: Software: OS21/OSPlus only, not Linux.
Hardware:

SYS_PROF_STOP
Usage: SYS_PROF_STOP
Parameters: None.
Description: Use this command to stop task profiling.
Example: SYS_PROF_STOP
Limits: Software: OS21/OSPlus only, not Linux.
Hardware:

146/190 8214357 Rev C


STAPI SDK Testtool

SYS_PROF_FLUSH
Usage: SYS_PROF_FLUSH
Parameters: None.
Description: Use this command to flush the profiling data to the host.
Example: SYS_PROF_FLUSH
Limits: Software: OS21/OSPlus only, not Linux.
Hardware:

SYS_REV
Usage: SYS_REV
Parameters: None.
Description: This command displays the revision number of the modules.
Example: SYS_REV
Limits:

SYS_TASK
Usage: SYS_TASK
Parameters: None.
Description: This command displays the task settings.
Example: SYS_TASK
Limits:

SYS_WATCHMEM_START
Usage: SYS_WATCHMEM_START <Address> <Size>
Parameters:
<Address> The memory location to watch.
<Size> The size of the memory region, in bytes.

Description: Use this command to start watching the specified memory region.
Example: SYS_WATCHMEM_START 0x4000 0x0100
Limits: Software: OS21/OSPlus only, not Linux.
Hardware: STx7109 only.

8214357 Rev C 147/190


Testtool STAPI SDK

SYS_WATCHMEM_STOP
Usage: SYS_WATCHMEM_STOP
Parameters: None
Description: Use this command to stop memory watching.
Example: SYS_WATCHMEM_STOP
Limits: Software: OS21/OSPlus only, not Linux.
Hardware: STx7109 only.

8.3.34 Table commands

TABLE_EIT
Usage: TABLE_EIT <Pti/Connection> <FullInfo>
Parameters:
<Pti/Connection> This is the PTI ID or the connection name.
<FullInfo> 0: Display summary information
1: Display full information.

Description: Use this command to filter an EIT section.


Example: TABLE_EIT 1 1
Limits:

TABLE_FILTER
Usage: TABLE_FILTER <Pti/Connection> <Pid> <TableId>
Parameters:
<Pti/Connection> This is the PTI ID or the connection name.
<Pid> The PID for the program, in the range 0x0000 to 0xFFFF.
<TableId> The ID for the table, in the range 0x0000 to 0xFFFF.
Description: Use this command to filter a full section.
Example: TABLE_FILTER 0 0x0001 0x00FF
Limits:

148/190 8214357 Rev C


STAPI SDK Testtool

TABLE_NIT
Usage: TABLE_NIT <Pti/Connection> <FullInfo>
Parameters:
<Pti/Connection> This is the PTI ID or the connection name.
<FullInfo> 0: Display summary information
1: Display full information.

Description: Use this command to filter an NIT section.


Example: TABLE_NIT 1 0
Limits:

TABLE_PAT
Usage: TABLE_PAT <Pti/Connection>
Parameters:
<Pti/Connection> This is the PTI ID or the connection name.

Description: Use this command to filter an PAT section.


Example: TABLE_PAT 1
Limits:

TABLE_PMT
Usage: TABLE_PMT <Pti/Connection> <FullInfo>
Parameters:
<Pti/Connection> This is the PTI ID or the connection name.
<FullInfo> 0: Display summary information
1: Display full information.

Description: Use this command to filter an PMT section.


Example: TABLE_PMT 0 1
Limits:

TABLE_SDT
Usage: TABLE_SDT <Pti/Connection> <FullInfo>
Parameters:
<Pti/Connection> This is the PTI ID or the connection name.
<FullInfo> 0: Display summary information
1: Display full information.

Description: Use this command to filter an SDT section.


Example: TABLE_SDT 0 0
Limits:

8214357 Rev C 149/190


Testtool STAPI SDK

TABLE_TDT
Usage: TABLE_TDT <Pti/Connection>
Parameters:
<Pti/Connection> This is the PTI ID or the connection name.

Description: Use this command to filter an TDT section.


Example: TABLE_TDT 0
Limits:

8.3.35 Text commands

TEXT_CLEAR
Usage: TEXT_CLEAR <Id>
Parameters: None.
Description: This command clears the text object created by TEXT_PRINT and referenced by
<Id>.
Example: TEXT_INFO
Limits:

TEXT_INFO
Usage: TEXT_INFO
Parameters: None.
Description: This command displays the revision number of the TEXT driver.
Example: TEXT_INFO
Limits:

150/190 8214357 Rev C


STAPI SDK Testtool

TEXT_PRINT
Usage: TEXT_PRINT <Id> <FontId> <X> <Y> <Color> <String> [<Params>]
Parameters:
<Id> The ID of the text to print.
<FontId> Use the font with this ID number.
<X> The X co-ordinate of the point from which to start printing.
<Y> The Y co-ordinate of the point from which to start printing.
<Color> The color of the text.
<String> The string to print.
[<Params>]

Description: This command prints the text referenced by <Id>.


Example: TEXT_INFO
Limits:

8.3.36 Trace commands

TRACE_HDDCLOSE
Usage: TRACE_HDDCLOSE
Parameters: None.
Description: Use this command to close the trace file previously opened using
TRACE_HDDOPEN.
Example: TRACE_HDDCLOSE
Limits:

TRACE_HDDOPEN
Usage: TRACE_HDDOPEN <FileName>
Parameters: <FileName> The name of the file for storing trace data.
Description: Use this command to open a trace file on the hard disk.
Example: TRACE_HDDOPEN
Limits:

TRACE_OFF
Usage: TRACE_OFF
Parameters: None.
Description: Use this command to turn tracing off.
Example: TRACE_OFF
Limits:

8214357 Rev C 151/190


Testtool STAPI SDK

TRACE_ON
Usage: TRACE_ON
Parameters: None.
Description: Use this command to turn tracing on.
Example: TRACE_ON
Limits:

TRACE_TEST
Usage: TRACE_TEST
Parameters: None.
Description: Use this command to perform a simple test for generating trace data.
Example: TRACE_TEST
Limits:

8.3.37 Teletext commands

TTX_INFO
Usage: TTX_INFO
Parameters: None.
Description: This command displays the revision number of the TTX driver.
Example: TTX_INFO
Limits:

TTX_START
Usage: TTX_START <PlayID><Pid>
Parameters:
<PlayID> The play ID, which is an integer starting from 0.
<Pid> The PID by which the stream supplies teletext data.

Description: Use this command to start teletext decode and display.


Call either PLAY_PROGRAM or PLAY_START before starting teletext. This requirement
is due to retrieving demux connections for teletext. The platform must tap CVBS
output in order to display teletext. It does not work on HDMI and COMPONENT
outputs.
Example: To start teletext on play 0 at PID 578 (decimal):
TTX_START 0 +578
Limits: Software: None.
Hardware: Occasionally the TV needs to be restarted to get teletext display ON.

152/190 8214357 Rev C


STAPI SDK Testtool

TTX_STOP
Usage: TTX_STOP <PlayID>
Parameters:
<PlayID> This is the play ID starting from 0 to N.

Description: Use this command to stop teletext decode and display.


Example: TTX_STOP 0
Limits: Software: None.
Hardware: None.

8.3.38 Tuner commands

TUNER_INFO
Usage: TUNER_INFO
Parameters: None.
Description: This command displays the version number of the tuner driver.
Example: TUNER_INFO
Limits:

TUNER_LOOP
Usage: TUNER_LOOP <Device> <Enable>
Parameters:
<Device> The identifier of the tuner device.
<Enable> 0: Disable loopthrough
1: Enable loopthrough.
Description: Use this command to enable or disable loopthrough.
Example: TUNER_LOOP 0 1
Limits:

TUNER_SCAN
Usage: TUNER_SCAN <Device> <Start> <End>
Parameters:
<Device> The identifier of the tuner device.
<Start> The start frequency in MHz.
<End> The end frequency in MHz.

Description: Use this command to perform frequency scanning.


Example: TUNER_SCAN 0 10700 12750
Limits:

8214357 Rev C 153/190


Testtool STAPI SDK

TUNER_SENDDISEQCCMD
Usage: TUNER_SENDDISEQCCCMD <Device> <DiseqCVer> <Length> <Command>
Parameters:
<Device> The identifier of the tuner device.
<DiseqCVer> DiSEqC command version number, either DISQ_VER_1_2 or
DISQ_VER_2_0.
<Length> The length of the command, in bytes, in the range 1 to 16.
<Command> The DiSEqC command

Description: Use this command to send a DiSEqC command.


Example: TUNER_SENDDISEQCCCMD 0
Limits:

TUNER_STATUS
Usage: TUNER_STATUS <Id>
Parameters: <Id> The identifier of the tuner device.
Description: This command displays the status of the specified tuner.
Example: TUNER_STATUS 0
Limits:

TUNER_SWITCH
Usage: TUNER_SWITCH <Device> <Satellite>
Description: Use this command to switch between LNBs.
Parameters:
<Device> The identifier of the tuner device.
<Satellite> The identifier of the satellite.

Example: TUNER_SWITCH
Limits:

154/190 8214357 Rev C


STAPI SDK Testtool

TUNER_TUNE
Usage: TUNER_TUNE <Device> <Freq> <SymbolRate> <Modulation> <FEC>
<Polarity> <FECType> <Pilot> <RollOff> <PLSIndex>
Parameters:
<Device> The identifier of the tuner device.
<Freq> The required frequency, in MHz.
<SymbolRate> Satellite or cable.
<Modulation> The modulation, which is one of the following: MOD_QPSK,
MOD_8PSK, MOD_QAM, MOD_4QAM, MOD_16QAM, MOD_32QAM,
MOD_64QAM, MOD_128QAM, MOD_256QAM, MOD_BPSK,
MOD_16APSK, MOD_32APSK or MOD_8VSB.
<FEC> This is one of the following: FEC_A, FEC_B, FEC_C, FEC_ALL,
or FEC_1_2 through to FEC_9_10.
<Polarity> This is the polarity and is one of the following:
– POL_V: Vertical polarity
– POL_H: Horizontal polarity
– POL_A: Both vertical and horizontal polarity
Used for satellite tuners only.
<FECType> One of the following: DVBS1, DVBS2 or DTV.
Used for satellite tuners only.
<Pilot> This is the pilot flag, and is either 0 or 1.
Used for satellite tuners only.
<RollOff> One of the following: 20, 25 or 35
Used for satellite tuners only.
<PLSIndex> This is an integer in the range of 0 to 255.
Used for satellite tuners only.

Description: Use this command to tune the tuner to a given frequency.


Example: TUNER_TUNE 0 11776 6875 MOD_QPSK FEC_ALL POL_V DVBS1 0 20 127
Limits:

8214357 Rev C 155/190


Testtool STAPI SDK

8.3.39 USB commands

USB_KEYB
Usage: USB_KEYB
Parameters: None.
Description: Use this command to check the USB keyboard and display errors, if any.
Example: USB_KEYB
Limits:

USB_INFO
Usage: USB_INFO
Parameters: None.
Description: This command displays the USB driver version
Example: USB_INFO
Limits:

USB_MOUSE
Usage: USB_MOUSE
Parameters: None.
Description: Use this command to check the USB mouse and display details of the errors, if any.
Example: USB_MOUSE
Limits:

8.3.40 Video commands

VID_BITMAP
Usage: VID_BITMAP <Id> <Filename> <Layer>
Parameters:
<Id> The identifier of the video decoder.
<Filename> The .gam file to display.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.

Description: Use this command to display a .gam file in a video plane.


Example: VID_BITMAP 0 "test.gam" V_MAIN
Limits:

156/190 8214357 Rev C


STAPI SDK Testtool

VID_CLEAR
Usage: VID_CLEAR <Id>
Parameters:
<Id> The identifier of the video decoder.

Description: Use this command to clear the video plane.


Example: VID_CLEAR 0
Limits:

VID_DISABLE
Usage: VID_DISABLE <Id> <Layer>
Parameters:
<Id> The identifier of the video decoder.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.
Description: Use this command to disable the video plane.
Example: VID_DISABLE 0 V_MAIN
Limits:

VID_ENABLE
Usage: VID_ENABLE <Id> <Layer>
Parameters:
<Id> The identifier of the video decoder.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.

Description: Use this command to enable the video plane.


Example: VID_ENABLE 0 V_MAIN
Limits:

VID_ERR
Usage: VID_ERR <Id> <Mode>
Parameters:
<Id> The identifier of the video decoder.
<Mode> The permitted error recovery modes are V_FULL, V_HIGH,
V_PARTIAL or V_NONE

Description: Use this command to set the error recovery mode of the video decoder.
Example: VID_ERR 0 V_FULL
Limits:

8214357 Rev C 157/190


Testtool STAPI SDK

VID_GETDISPLAYPARAMS
Usage: VID_GETDISPLAYPARAMS <Id> <Layer>
Parameters:
<Id> The identifier of the video decoder.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.

Description: Use this command to get the layer display parameters.


Example: VID_GETDISPLAYPARAMS 0 V_MAIN
Limits:

VID_INFO
Usage: VID_INFO
Parameters: None.
Description: This command provides information about the video driver.
Example: VID_INFO
Limits:

VID_INJSTART
Usage: VID_INJSTART <Id> <FileName> <NbLoops> <StreamType> <Layer>
Parameters:
<Id> The identifier of the video decoder.
<FileName> This is the file to play
<NbLoops> Loop the file this number of times.
<StreamType> One of either V_ES or V_PES.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.

Description: Use this command to play a video file as a video injection.


Example: VID_INJSTART 0 "/videos/video.mpg" 2 V_ES V_MAIN
Limits:

VID_INJSTOP
Usage: VID_INJSTOP <Id>
Parameters:
<Id> The identifier of the video decoder.

Description: Use this command to stop a video injection.


Example: VID_INJSTOP 0
Limits:

158/190 8214357 Rev C


STAPI SDK Testtool

VID_PAUSE
Usage: VID_PAUSE <Id>
Parameters:
<Id> The identifier of the video decoder.

Description: Use this command to pause the video.


Example: VID_PAUSE 0
Limits:

VID_RESUME
Usage: VID_RESUME <Id>
Parameters:
<Id> The identifier of the video decoder.

Description: Use this command to resume the video after it has been paused.
Example: VID_RESUME 0
Limits:

VID_SETFRAMERATE
Usage: VID_SETFRAMERATE <Id> <On/Off>
Parameters:
<Id> The identifier of the video decoder.
<On/Off> 0: Disable frame rate conversion
1: Enable frame rate conversion.

Description: Use this command to enable or disable frame rate conversion.


Example: VID_SETFRAMERATE 0 1
Limits:

VID_SETFORMAT
Usage: VID_SETFORMAT <Id> <Layer> <Format>
Parameters:
<Id> The identifier of the video decoder.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.
<Format> The permitted formats are V_AR_PANSCAN, V_AR_LBOX,
V_AR_COMBI or V_AR_NO.

Description: Use this command to change the video aspect ratio.


Example: VID_SETFORMAT 0 V_MAIN V_AR_LBOX
Limits:

8214357 Rev C 159/190


Testtool STAPI SDK

VID_SETMODE
Usage: VID_SETMODE <Id> <Mode>
Parameters:
<Id> The identifier of the video decoder.
<Mode> The permitted decoding picture modes are V_MODE_ALL,
V_MODE_I, V_MODE_IP or V_MODE_I_FIRST.

Description: Use this command to set the decoding picture mode.


Example: VID_SETMODE 0 V_MODE_ALL
Limits:

VID_SETSPEED
Usage: VID_SETSPEED <Id> <Speed>
Parameters:
<Id> The identifier of the video decoder.
<Speed> This is the speed to set, in the range of -3000 to 3000.
Description: Use this command to change the video speed.
Example: VID_SETSPEED 0 2000
Limits:

VID_SETWINAUTO
Usage: VID_SETWINAUTO <Id> <Layer>
Parameters:
<Id> The identifier of the video decoder.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.

Description: Use this command to set up a window in automatic mode.


Example: VID_SETWINAUTO 0 V_MAIN
Limits:

160/190 8214357 Rev C


STAPI SDK Testtool

VID_SETWINDOW
Usage: VID_SETWINDOW <Id> <InX> <InY> <InWidth> <InHeight> <OutX>
<OutY> <OutWidth> <OutHeight> <Layer>
Parameters:
<Id> The identifier of the video decoder.
<InX> The X co-ordinate of the corner of the input window.
<InY> The Y co-ordinate of the corner of the input window.
<InWidth> The width of the input window, in pixels.
<InHeight> The height of the input window, in pixels.
<OutX> The X co-ordinate of the corner of the output window.
<OutY> The Y co-ordinate of the corner of the output window.
<OutWidth> The width of the output window, in pixels.
<OutHeight> The height of the output window, in pixels.
<Layer> The permitted layers are V_MAIN, V_AUX or V_REMOTE.

Description: Use this command to set the parameters of a video window.


Example: VID_SETWINDOW 0
Limits:

VID_STATUS
Usage: VID_STATUS <Id> <Reset>
Parameters:
<Id> The identifier of the video decoder.
<Reset> 0: Do not reset the statistics.
1: Reset the statistics.
Description: Use this command to get the status of the video decoder identified by <Id>.
Example: VID_STATUS 0 1
Limits:

VID_STEP
Usage: VID_STEP <Id>
Parameters:
<Id> The identifier of the video decoder.

Description: Use this command to decode the next picture in the stream.
Example: VID_STEP 0
Limits:

8214357 Rev C 161/190


Testtool STAPI SDK

VID_SYNCHRO
Usage: VID_SYNCHRO <Id> <On/Off>
Parameters:
<Id> The identifier of the video decoder.
<On/Off> 0: Disable video synchronization
1: Enable video synchronization.

Description: Use this command to enable or disable video synchronization.


Example: VID_SYNCHRO 0 1
Limits:

8.3.41 Video capture commands

VIN_CLOSE
Usage: VIN_CLOSE <Id>
Parameters:
<Id> This is the identifier for the video capture, which is an integer
starting from 0.

Description: Use this command to close a video capture.


Example: VIN_CLOSE 0
Limits:

VIN_DISABLE
Usage: VIN_DISABLE <Id>
Parameters:
<Id> This is the identifier for the video capture, which is an integer
starting from 0.

Description: Use this command to disable video capture.


Example: VIN_DISABLE 0
Limits:

VIN_ENABLE
Usage: VIN_ENABLE <Id>
Parameters:
<Id> This is the identifier for the video capture, which is an integer
starting from 0.

Description: Use this command to enable video capture.


Example: VIN_ENABLE 0
Limits:

162/190 8214357 Rev C


STAPI SDK Testtool

VIN_INFO
Usage: VIN_INFO
Parameters: None.
Description: This command provides the revision number of the driver.
Example: VIN_INFO
Limits:

VIN_OPEN
Usage: VIN_OPEN <Id> <SrcName> <DstName>
Parameters:
<Id> This is the identifier for the video capture, which is an integer
starting from 0.
<SrcName> The source device, which is one of the following: "MAIN",
"AUX", "REMOTE", "EXT0", "EXT1" or "EXT2".
<DstName> The destination device, which is one of the following: "MAIN",
"AUX", "REMOTE", "GFX0", "GFX1" or "GFX2".

Description: Use this command to open a digital video capture stream.


Example: VIN_OPEN 0
Limits:

VIN_PAUSE
Usage: VIN_PAUSE <Id>
Parameters:
<Id> This is the identifier for the video capture, which is an integer
starting from 0.

Description: Use this command to pause video capture.


Example: VIN_PAUSE 0
Limits:

VIN_RESUME
Usage: VIN_RESUME <Id>
Parameters:
<Id> This is the identifier for the video capture, which is an integer
starting from 0.

Description: Use this command to resume video capture that is currently paused.
Example: VIN_RESUME 0
Limits:

8214357 Rev C 163/190


Testtool STAPI SDK

VIN_SETWINDOW
Usage: VIN_SETWINDOW <Id> <InX> <InY> <InWidth> <InHeight> <OutX>
<OutY> <OutWidth> <OutHeight>
Parameters:
<Id> This is the identifier for the video capture, which is an integer
starting from 0.
<InX> The X co-ordinate of the corner of the input window.
<InY> The Y co-ordinate of the corner of the input window.
<InWidth> The width of the input window, in pixels.
<InHeight> The height of the input window, in pixels.
<OutX> The X co-ordinate of the corner of the output window.
<OutY> The Y co-ordinate of the corner of the output window.
<OutWidth> The width of the output window, in pixels.
<OutHeight> The height of the output window, in pixels.

Description: Use this command to set the size of a digital video capture.
Example:
Limits:

8.3.42 Video mixer commands

VMIX_DISABLE
Usage: VMIX_DISABLE <Id>
Parameters:
<Id> The VMIX device identifier, which is an integer starting from 0.

Description: Use this command to disable the mixer identified by <Id>.


Example: VMIX_DISABLE 0
Limits: Software: None.
Hardware: None.

VMIX_ENABLE
Usage: VMIX_ENABLE <Id>
Parameters:
<Id> The VMIX device identifier, which is an integer starting from 0.

Description: Use this command to enable the mixer identified by <Id>.


Example: VMIX_ENABLE 0
Limits: Software: None.
Hardware: None.

164/190 8214357 Rev C


STAPI SDK Testtool

VMIX_GETBKCOLOR
Usage: MIX_GETBKCOLOR <Id>
Parameters:
<Id> The VMIX device identifier, which is an integer starting from 0.

Description: Use this command to get the background color specified by a combination of red,
green and blue values.
Example: VMIX_GETBKGROUND 0
Limits: Software: None.
Hardware: None.

VMIX_GETCAPABILITY
Usage: VMIX_GETCAPABILITY <Id>
Parameters:
<Id> The VMIX device identifier, which is an integer starting from 0.

Description: This command displays details of the capabilities of the mixer identified by <Id>.
Example: VMIX_GETCAPABILITY 0
Limits: Software: None.
Hardware: None.

VMIX_GETCONNLAYER
Usage: VMIX_GETCONNLAYER <Id> <Position>
Parameters:
<Id> The VMIX device identifier, which is an integer starting from 0.
<Position>

Description: Use this command to retrieve the layer connected to VMID <Id> at <Position>.
Example: VMIX_GETCONNLAYER 0 1
Limits: Software: None.
Hardware: None.

VMIX_INFO
Usage: VMIX_INFO
Parameters: None.
Description: This command displays the version number of the VMIX driver.
Example: VMIX_INFO
Limits: Software: None.
Hardware: None.

8214357 Rev C 165/190


Testtool STAPI SDK

VMIX_SETASPECTRATIO
Usage: VMIX_SETASPECTRATIO <ID> <AspectRatio>
Parameters:
<Id> The VMIX device identifier, which is an integer starting from 0.
<AspectRatio> The aspect ratio of the device, which is one of the following:
M_AR_16TO9, M_AR_4TO3, M_AR_221TO1, M_AR_SQUARE,
or M_AR_14TO9.

Description: Use this command to set the aspect ratio of the VMIX device <Id>.
Example: VMIX_SETASPECTRATIO 0 M_AR_16TO9
Limits: Software: None.
Hardware: None.

VMIX_SETBKCOLOR
Usage: VMIX_SETBKCOLOR <Id> <R> <G> <B>
Parameters:
<Device> This is the VMIX device identifier, which is an integer starting
from 0.
<R> Value for color Red.
<G> Value for color Green.
<B> Value for color Blue.
<Enable> 0: Disable the display of background plane.
1: Enable the display of the background plane.
Description: Use this command to set background color specified by values of red, green and blue.
Example: VMIX_SETBKGROUND 0 +100 0 0
Limits: Software: None.
Hardware: None.

166/190 8214357 Rev C


STAPI SDK Testtool

VMIX_SETOFFSET
Usage: VMIX_SETOFFSET <Id> <XPos> <YPos>
Description: Use this command to set an offset for the mixer identified by <Id>.
Parameters:
<Id> This is the VMIX device identifier, which is an integer starting
from 0.
<XPos> Apply this offset to the X axis. This is a value in the range -128
to +127.
<YPos> Apply this offset to the Y axis. This is a value in the range -128
to +127.

Example: VMIX_SETOFFSET
Limits: Software: None.
Hardware: None.

8.3.43 Video out commands

VOUT_DISABLE
Usage: VOUT_DISABLE <Id>
Description: Use this command to disable the video out (VOUT) stage.
Parameters: <Id> This is the identifier for VOUT, which is an integer starting from 0.
Example: VOUT_DISABLE 0
Limits:

VOUT_ENABLE
Usage: VOUT_ENABLE <Id>
Description: Use this command to enable the video out (VOUT) stage.
Parameters: <Id> This is the identifier for VOUT, which is an integer starting from 0.
Example: VOUT_ENABLE 0
Limits:

VOUT_INFO
Usage: VOUT_INFO
Description: This command displays the version of the video out (VOUT) driver.
Parameters: None.
Example: VOUT_INFO
Limits: Software: None.
Hardware: None.

8214357 Rev C 167/190


Testtool STAPI SDK

VOUT_GETCAPABILITY
Usage: VOUT_GETCAPABILITY <Id>
Description: Use this command to return details of the video out (VOUT) capabilities.
Parameters: <Id> This is the identifier for VOUT, which is an integer starting from 0.
Example: VOUT_GETCAPABILITY 0
Limits:

VOUT_GETSYNCCALIB
Usage: VOUT_GETSYNCCALIB <Id>
Description: Use this command to get the current analog synchronization calibration value.
Parameters: <Id> This is the identifier for VOUT, which is an integer starting from 0.
Example: VOUT_GETSYNCCALIB 0
Limits:

VOUT_SETBCS

Usage: VOUT_SETBCS <Id> <Brightness> <Contrast> <Saturation>


Description: Use this command to set the brightness, contrast and saturation values for the video
out (VOUT) stage.
Parameters:
<Id> This is the identifier for VOUT, which is an integer starting from
0.
<Brightness> This is the brightness level, where 0 is the lowest level and
128 is the highest.
<Contrast> This is the contrast level, where 0 is the lowest level and 128 is
the highest.
<Saturation> This is the saturation level, where 0 is the lowest level and 128
is the highest.

Example: VOUT_SETBCS 64 64 64
Limits:

168/190 8214357 Rev C


STAPI SDK Testtool

VOUT_SETSYNCCALIB

Usage: VOUT_SETSYNCCALIB <Id> <Scaling Factor> <Offset Value>


Description: Use this command to adjust the analog synchronization calibration
Parameters:
<Id> This is the identifier for VOUT, which is an integer starting from
0.
<Scaling factor> [Y] : For scaling factor Y
[Cb] : For scaling factor Cb
[Cr] : For scaling factor Cr
<Offset Value> [Y] : offset value of Y
[Cb] : Offset value of Cb
[Cr] : Offset value of Cr

Example: VOUT_SETSYNCCALIB 0 <Scaling Factor> <Offset Value>


Limits:

8.3.44 Video timing generator (VTG) commands

VTG_INFO
Usage: VTG_INFO
Parameters: None.
Description: This command displays the version number of the VTG driver.
Example: VTG_INFO
Limits: Software: None.
Hardware: None.

VTG_SETMODE
Usage: VTG_SETMODE <VtgId> <Mode>
Parameters:
<VtgId> 0: Main
1: Auxiliary
2: Remote.
<Mode> This parameter is the timing mode to set. See Table 8 for a full
list of timing modes
Description: Use this command to change the VTG timing mode.
Example: VTG_SETMODE 0 +5

8214357 Rev C 169/190


Testtool STAPI SDK

VTG_GETMODE
Usage: VTG_GETMODE <VtgId>
Parameters:
<VtgId> 0: Main
1: Auxiliary
2: Remote.

Description: Use this command to change the VTG timing mode.


Example: VTG_GETMODE 0

Table 8. List of timing modes accepted by VTG_SETMODE command


User Code <Mode> parameter Timing mode

1 STVTG_TIMING_MODE_480I60000_13514 NTSC 60Hz


2 STVTG_TIMING_MODE_480P60000_27027 ATSC 60P
3 STVTG_TIMING_MODE_480P30000_13514 ATSC 30P
4 STVTG_TIMING_MODE_480P24000_10811 ATSC 24P
5 STVTG_TIMING_MODE_480I59940_13500 NTSC PAL M
6 STVTG_TIMING_MODE_480P59940_27000 ATSC 60P/1.001
7 STVTG_TIMING_MODE_480P29970_13500 ATSC 30P/1.001
8 STVTG_TIMING_MODE_480P23976_10800 ATSC 24P/1.001
9 STVTG_TIMING_MODE_480I60000_12285 NTSC 60Hz square
10 STVTG_TIMING_MODE_480P60000_24570 ATSC 60P square
11 STVTG_TIMING_MODE_480P30000_12285 ATSC 30P square
12 STVTG_TIMING_MODE_480P24000_9828 ATSC 24P square
13 STVTG_TIMING_MODE_480I59940_12273 NTSC square, PAL M square
14 STVTG_TIMING_MODE_480P59940_24545 ATSC 60P/1.001 square
15 STVTG_TIMING_MODE_480P29970_12273 ATSC 30P/1.001 square
16 STVTG_TIMING_MODE_480P23976_9818 ATSC 24P/1.001 square
17 STVTG_TIMING_MODE_576I50000_13500 PAL B,D,G,H,I,N,SECAM
18 STVTG_TIMING_MODE_576I50000_14750 PAL B,D,G,H,I,N,SECAM square
19 STVTG_TIMING_MODE_1080P60000_148500 SMPTE 274M #1 P60
20 STVTG_TIMING_MODE_1080P59940_148352 SMPTE 274M #2 P60/1.001
21 STVTG_TIMING_MODE_1080P50000_148500 SMPTE 274M #3 P50
22 STVTG_TIMING_MODE_1080I60000_74250 EIA770.3 #3 I60 (or SMPTE274M #4 I60)
EIA770.3 #4 I60/1.001 (or SMPTE274M #5
23 STVTG_TIMING_MODE_1080I59940_74176
I60/1.001)
24 STVTG_TIMING_MODE_1080I50000_74250 SMPTE 295M #2 I50
25 STVTG_TIMING_MODE_1080I50000_74250_1 SMPTE 274M I50

170/190 8214357 Rev C


STAPI SDK Testtool

Table 8. List of timing modes accepted by VTG_SETMODE command (continued)


User Code <Mode> parameter Timing mode

26 STVTG_TIMING_MODE_1080P30000_74250 SMPTE 274M #7 P30


27 STVTG_TIMING_MODE_1080P29970_74176 SMPTE 274M #8 P30/1.001
28 STVTG_TIMING_MODE_1080P25000_74250 SMPTE 274M #9 P25
29 STVTG_TIMING_MODE_1080P24000_74250 SMPTE 274M #10 P24
30 STVTG_TIMING_MODE_1080P23976_74176 SMPTE 274M #11 P24/1.001
31 STVTG_TIMING_MODE_1035I60000_74250 SMPTE 240M #1 I60
32 STVTG_TIMING_MODE_1035I59940_74176 SMPTE 240M #2 I60/1.001
33 STVTG_TIMING_MODE_720P60000_74250 EIA770.3 #1 P60 = SMPTE 296M #1 P60
EIA770.3 #2 P60/1.001 = SMPTE 296M #2
34 STVTG_TIMING_MODE_720P59940_74176
P60/1.001
35 STVTG_TIMING_MODE_720P30000_37125 ATSC 720x1280 30P
36 STVTG_TIMING_MODE_720P29970_37088 ATSC 720x1280 30P/1.001
37 STVTG_TIMING_MODE_720P24000_29700 ATSC 720x1280 24P
38 STVTG_TIMING_MODE_720P23976_29670 ATSC 720x1280 24P/1.001
39 STVTG_TIMING_MODE_1080I50000_72000 AS 4933-1 200x 1080i(1250)
40 STVTG_TIMING_MODE_720P50000_74250
41 STVTG_TIMING_MODE_576P50000_27000 Australian mode
42 STVTG_TIMING_MODE_1152I50000_48000
43 STVTG_TIMING_MODE_480P60000_25200 VGA mode
44 STVTG_TIMING_MODE_480P59940_25175 VGA mode
45 STVTG_TIMING_MODE_768P75000_78750 VGA mode
46 STVTG_TIMING_MODE_768P60000_65000 VGA mode
47 STVTG_TIMING_MODE_768P85000_94500 VGA mode
48 STVTG_TIMING_MODE_480P60000_25250 VGA mode
49 STVTG_TIMING_MODE_480P50000_21042 VGA mode

8214357 Rev C 171/190


Testtool STAPI SDK

8.4 Testtool examples


This section describes many of the most common testtool commands that an application
developer is likely to need when testing the software and the board upon which it is running.

8.4.1 Displaying the denc colorbar


To enable the colorbar:
ST_xxxx> DENC_COLORBAR 0 1
To disable the colorbar:
ST_xxxx> DENC_COLORBAR 0 0
Note: The colorbar is displayed on the denc output. That means for systems such as STi7100 or
STi7109 using the display HD configuration (DVD_DISPLAY_HD = 1), the colorbar is
displayed only on the auxiliary display. For SD systems only (such as STi5100, STi5105,
STi5300 or STi5528), the colorbar is always available on the TV SCART.

8.4.2 Displaying a graphic plane


Depending upon the SoC in use, it is possible to have either one or two graphics planes. On
the STi7100, STi7109, STi7111, STi7200 or STi7710 SoCs, for example, the display HD
configuration (with the setting DVD_DISPLAY_HD = 1) has two graphics planes: one in
high definition on the main output (either HDMI or YPrPb) and one in standard definition on
the auxiliary output (SCART CVBS or RGB). When using the testtool commands, use the ID
parameter to select one or other of the two graphic planes:
● 0: main graphic plane
● 1: auxiliary graphic plane
Therefore, to enable the main graphic plane, use the command:
ST_xxxx> GFX_ENABLE 0
To disable the main graphic plane:
ST_xxxx> GFX_DISABLE 0
For the auxiliary graphic plane, replace the 0 with a 1.
For SD systems only (such as STi5100, STi5105, STi5300 or STi5528) there is only one
graphic plane. This has an ID parameter of 0.
By default, the the graphic planes are not initialized, which means that when a graphic plane
is first enabled it may contain random data, causing “garbage” to appear on the screen. This
can be overcome by using the BLIT_FILL command. The following example fills graphic
plane 0 with a random colored rectangle:
ST_xxxx> BLIT_FILL 0

172/190 8214357 Rev C


STAPI SDK Testtool

8.4.3 Decoding a video stream from memory


As the graphic plane always lies in front of the video layer, the first step is to remove the
graphic plane with the GFX_DISABLE command. (See Section 8.4.2)
Depending upon the board, the SoC and the amount of memory in use, it is possible to have
up to two instances of any video decoder. This means that it is possible for an SoC to
support two instances of MPEG2 decoder, two instances of H264 decoder and two
instances of DivX decoder. Each instance is referenced by its own unique ID number.
The following command to start running a video from an MPEG file works on all systems:
ST_xxxx> VID_INJSTART 0 "files/susie_es.mp1" 0 V_ES
ST_xxxx> VID_ENABLE 0
Use the following command to stop the video:
ST_xxxx> VID_INJSTOP 0
On STi7100 and STi7109, the video instance with the ID of 1 is currently dedicated to H264
decoding, so on these SoCs, it is possible to decode H264 streams from memory using the
commands:
ST_xxxx> VID_INJSTART 1 "files/teksoccer_pes.mp4" 0 V_PES
ST_xxxx> VID_ENABLE 1
Note: 1 This method works for both SD and HD streams. You can also play ES or PES streams from
the local hard disk drives (SATA, USB or ATAPI). For this usage, first mount some file system
partitions (see the testtool commands FS_FDISK on page 102 and FS_MOUNT on
page 104).
2 To play the transport stream, use the testtool command PLAY_START.

8.4.4 Decoding an audio stream from memory


As with video, it is possible to play audio from memory. The following command works on all
the platforms:
ST_xxxx> AUD_INJSTART 0 "files/piano_sample.mp1" 0 A_MP1 +44100 A_ES
ST_xxxx> AUD_ENABLE 0
In order to stop the audio, use the command:
ST_xxxx> AUD_INJSTOP 0
Note: Depending upon the capabilities of the system in use, it is possible to play MP2, MP3, AC3
and AAC format files. The stream originates on the host hard disk drive, the USB, SATA or
ATAPI local hard disk drive or an USB key.

8214357 Rev C 173/190


Testtool STAPI SDK

8.4.5 Transcoding support in STAPI SDK


Currently, STAPI SDK supports two types of transcoding: HEAAC-DTS and HEAAC-DD.

HEAAC-DTS
1. Define the AUD_TRANSCODE_SPDIF_TO_DTS_SUPPORT flag in
stapp/stapp_audio.h, then compile and run the application.
2. At the testtool prompt, enter the following command to observe the output on a S/PDIF
receiver:
ST_xxxx> AUD_SPDIF 0 a_compressed
3. Finally, start audio decoding with an appropriate AUD_INJSTART command:
ST_xxxx> AUD_INJSTART 0 "thetest.loas" 0 A_HEAAC +48000 A_ES

HEAAC-DD
1. Define the AUD_TRANSCODE_SPDIF_TO_DTS_SUPPORT flag in
stapp/stapp_audio.h and set the ENABLE_DD_TRANSCODING flag in the
environment window. Compile the audio driver and the application, and then run the
application.
2. At the testtool prompt, enter the following command to observe the output at S/PDIF
receiver.
ST_xxxx> AUD_SPDIF 0 A_COMPRESSED
3. Finally, start audio decoding with an appropriate AUD_INJSTART command:
ST_xxxx> AUD_INJSTART 0 "thetest.loas" 0 A_HEAAC +48000 A_ES

8.4.6 Tuning the demodulator


To receive a broadcast channel, use one of the following commands:
● For terrestrial reception:
ST_xxxx> TUNER_TUNE 0 +474 MOD_64QAM FEC_2_3
● For satellite reception:
ST_xxxx> TUNER_TUNE 0 +11034 +27500 MOD_QPSK FEC_3_4 POL_V
● For cable reception:
ST_xxxx> TUNER_TUNE 0 +706 +6875 MOD_64QAM
You can check the status of the demodulator with the following command:
ST_xxxx> TUNER_STA 0

174/190 8214357 Rev C


STAPI SDK Testtool

8.4.7 Getting the classical DVB-SI information


Testtool is able to provide PAT, PMT, SDT and NIT information. This is achieved with the
following set of commands. For example, to display the service description table, use the
command:
ST_xxxx> TABLE_SDT 0
Extract a summary of the program map table with the command:
ST_xxxx> TABLE_PMT 0
To extract the full details of the PMT (including the descriptor), use the command:
ST_xxxx> TABLE_PMT 0 1
To extract all the details of the PMT from a .trp file, use the command:
ST_xxxx> TABLE_PMT "/ATA00/stream.trp" 1

8.4.8 Decoding a live channel


There are two methods available to decode a live channel. The simplest is to use the
program ID, as in the following testtool command:
ST_xxxx> PLAY_PROG 0 "0" #<programID>
The <programID> parameter can be found in the service description table. For this case, it
is not necessary to enter the PIDs. Instead, the software locates the first entry of a video
PID, an audio PID and a PCR PID. When these are found, playback starts automatically.
The second method is by specifying all the PIDs. To do that, use the following testtool
command:
ST_xxxx> PLAY_START 0 “0” P_H264 #<pid> P_MP2A #<pid> P_PCR #<pid> P_END

For this command it is necessary to specify the type of each of the PIDs to play before
specifying the PID itself. In the above example, this is achieved with the tags P_H264,
P_MP2A and P_PCR.
There are other tags for defining PID types in addition to those given in the above example.
To display usage information, including a list of all the permitted PID type tags, replace any
argument in the command line with a “?”.
To stop playing the live channel, use the command:
ST_xxxx> PLAY_STOP 0

8214357 Rev C 175/190


Testtool STAPI SDK

8.4.9 Decoding a transport stream file


The first step is to mount the partition where the stream is stored. If this is the ATAPI or SATA
interface, use the commands:
ST_xxxx> FS_MOUNT "ATA0" "/volume0" "r"
ST_xxxx> FS_DIR "/ATA00"
The command to play a file stream is similar to the command to play a live stream, except
that you replace the string “0” by the name of the file. For example :
ST_xxxx> PLAY_START 0 "/ATA00/astrahd.trp" P_H264 #200 P_END
This command plays the video PID, which in this case is an H264 stream (as shown by the
P_H264 tag).
The following commands play a stream from a USB hard disk drive:
ST_xxxx> FS_MOUNT "/usb/hdisk0" "/volume0" "r"
ST_xxxx> FS_DIR "/USBHDISK00"
ST_xxxx> PLAY_START 0 "/USHBDISK00/astrahd.trp" P_H264 #200 P_END
If the stream is on a USB key, the commands are:
ST_xxxx> FS_MOUNT "/usb/rdisk0" "/volume0" "r"
ST_xxxx> FS_DIR "/USBRDISK00"
ST_xxxx> PLAY_START 0 "/USHRDISK00/astrahd.trp" P_H264 #200 P_END
The USB key version mounts the drive "/usb/rdisk0" instead of "/usb/hdisk0".

8.4.10 Decoding and recording a live IP unicast/multicast stream


1. The first step is to configure your IP settings. Use the IP_CONFIG command to list the
current settings, as follows:
ST_xxxx> IP_CONFIG 0
IP Address : 192.168.1.50
Netmask : 255.255.255.0
Gateway : 192.168.1.254
MAC Address : 00:FA:E0:00:FA:E0
2. You can now change the IP settings with the same command, adding the new settings
(IP Address, Netmask and Gateway in that order) as parameters:
ST_xxxx> IP_CONFIG 0 "164.129.62.12" "255.255.254.0" "164.129.62.1"
IP Address : 164.129.62.12
Netmask : 255.255.254.0
Gateway : 164.129.62.1
MAC Address : 00:FA:E0:00:FA:E0
3. To check that the connection is working correctly, use IP_PING:
ST_xxxx> IP_PING 0 "164.129.62.1"
4. Next, create an IP stream connection. Testtool allows the creation of up to four IP
connections in parallel. The following example creates a connection called “IP0”, which
collects all video packets on the 1234 port.
ST_xxxx> IP_STREAM 0 "IP0" "udp://@:1234" "r"
The following example creates an “IP0” connection which collects all multicast packets
from the 224.10.1.1:5555 server.

176/190 8214357 Rev C


STAPI SDK Testtool

ST_xxxx> IP_STREAM 0 "IP0" "udp://224.10.1.1:5555" "r"


Replace “udp” with “rtp” if the server sends RTP packets instead of UDP packets.
The final “r” parameter indicates that this stream connection is a source and not a
destination. Replace the “r” with “w” to broadcast the live channel over ethernet.
5. To play back the IP stream, use the command:
ST_xxxx> PLAY_START 0 "IP0" P_H264 #44 P_MP1A #45 P_END
Use the REC_START command to record the stream instead of playing it, as follows:
ST_xxxx> REC_START 0 "IP0" "/ATA00/stream.trp" P_H264 #44 P_MP1A #45 P_END

8.4.11 Broadcasting a live or file transport stream over IP (unicast only)


1. Configure the IP settings for the broadcast, as described in Section 8.4.10: Decoding
and recording a live IP unicast/multicast stream on page 176.
2. Create an IP connection to broadcast your stream:
ST_xxxx> ip_stream 0 "IP0" "udp://164.129.62.25:1234" "w"
3. At this stage, the receiver (164.129.62.25:1234 in this example) needs to be ready
to playback the stream. It is possible to use the VLC media player for this.
At this point there are two alternatives, to either broadcast a live stream or a file stream. For
both alternatives, use the REC_START command. For a live stream, use a set of parameters
such as the following to specify the PIDs:
ST_xxxx> rec_start 0 “0” IP0” 0 P_MP2V #100 P_MP1A #101 P_PID #0 P_PID #22 P_END

To broadcast a file, use a set of parameters to specify the file:


ST_xxxx> rec_start 0 “/ATA00/stream.trp” IP0” 0 P_PCR #100 P_END

Note: If using VLC media player to playback the stream, it is necessary to broadcast PAT and PMT
PIDs in addition to those specified above. This is so that VLC is able to detect the video and
audio stream PIDs.

8.4.12 Decoding a DirecTV stream


Basic DirecTV support on top of the standard STAPI-SDK release requires a DirecTV
enabled STPTI driver and (for A3 support) the ADV variant of STTUNER drivers. These
drivers are not part of the standard release, but are provided to the licensed user on
request.
To switch mode from default DVB to DirecTV, set the following environment variables:
Set DVD_SERVICE = DIRECTV
Set DVD_FRONTEND_TUNER = NONE
Set TUNER_VARIANT = ADV
Set the packet size on the packet injector to 130 bytes and then execute the testtool
command to play the stream. An example of a suitable command is given below:
PLAY_START 0 "0" P_MP2V #78 P_MP2A #79 P_PCR #78 P_END
The following commands give an example of how to decode the stream from the tuner.
TUNER_TUNE 0 +11250 +20000 MOD_QPSK FEC_6_7 POL_V DVBS1
PLAY_START 0 "1" P_MP2V #78 P_MP2A #79 P_PCR #78 P_END

8214357 Rev C 177/190


Testtool STAPI SDK

8.4.13 Decoding an A3 stream


Basic DirecTV support on top of the standard STAPI-SDK release requires a DirecTV
enabled STPTI driver and (for A3 support) the ADV variant of STTUNER drivers. These
drivers are not part of the standard release, but are provided to the licensed user on
request.
Set the environment variables to change the default service mode from DVB to A3.
Set DVD_SERVICE = A3
Set TUNER_VARIANT = ADV
Compile the STAPI SDK code, as described in Chapter 2 on page 14 or (for Linux) in
Chapter 3 on page 27.
Play the A3 stream through the packet injector.
Set the packet size on the packet injector to 188 bytes and then execute the testtool
command to play the stream. An example of a suitable command is given below:
PLAY_START 0 "0" P_H264 #1010 P_AC3 #1012 P_PCR #1010 P_END
The following commands give an example of how to decode the stream from the tuner. First,
configure the modulator as follows:
● modulation mod: DVB-S2
● special setting: On
● PL scrambling sequence id: 2 (This is a value between 0 and 255)
To select the stream and play it, execute the following commands from the testtool prompt :
TUNER_TUNE 0 +11250 +20000 MOD_QPSK FEC_2_3 POL_V DVBS2 0 2
PLAY_START 0 "1" P_H264 #1010 P_AC3 #1012 P_PCR #1010 P_END
Note: The PL scrambling sequence ID matches with the PLXIndex of the TUNER_TUNE
command

8.4.14 Decoding teletext data


Testtool includes commands for decoding teletext (VBI mode). The following sequence of
commands decodes a program on path 0 and then decodes teletext on PID 578 (decimal):
Testtool> PLAY_PROG 0 "0" 1
Testtool> TTX_START 0 +578
To stop teletext:
Testtool> TTX_STOP
Use the following command to decode teletext on path 1:
Testtool> TTX_START 1 +578
Note: 1 Teletext must always be stopped before restarting as only a single instance is supported.
2 Teletext output is captured on CVBS output.

178/190 8214357 Rev C


STAPI SDK Testtool

8.4.15 Decoding subtitle data


Testtool includes commands for decoding subtitles. The following sequence of commands
decodes a program on path 0 and then decodes the subtitles on PID 578 (decimal):
Testtool> PLAY_PROG 0 "0" 1
Testtool> SUBT_START 0 0 +578
Testtool> SUBT_ENABLE 0
Testtool> GFX_ENABLE 0
To stop subtitles:
Testtool> SUBT_STOP
Use the following command to display subtitles on AUX
Testtool> SUBT_START 0 1 +578
Testtool> SUBT_ENABLE 0
Testtool> GFX_ENABLE 1

8.4.16 Using the HD/SD capture features


To perform the High Definition or Standard Definition capture, perform following command
sequence :
To open a digital video capture :
Testtool> VIN_OPEN 0 "MAIN" "AUX"
Testtool> VIN_ENABLE 0
Testtool> GFX_ENABLE 0
Testtool> VIN_CLOSE 0

8.4.17 Using low power mode operation


Editing a profile
This powerful feature of the latest power design allows you to customize the power profile
state of different components in the system. The advantages of this feature become
apparent in cases when a component must be kept active even when the system is on
standby; for example, to get the service date, the TUNER0 must remain alive even if the rest
of the system enters standby.
This is achievable by editing the various existing power profiles to suit your requirements.
For example, to modify Profile 2 so that I2C0 and TUNER0 do not enter active standby mode
when Profile 3 (active standby) is selected, use the following testtool commands:
POWER_SETPROFILE 0 2 "I2C0" PM_NORMAL
POWER_SETPROFILE 0 2 "TUNER0" PM_NORMAL
Now, when you select profile 3, all components enter active standby except for I2C0 and
TUNER0.
Similarly, you can choose to put a device in standby when the system enters normal mode.
This is done as follows:
POWER_SETPROFILE 0 0 "I2C0" PM_ACTIVESTANDBY

8214357 Rev C 179/190


Testtool STAPI SDK

Now, when you select profile 0 (normal mode), I2C0 is put in standby mode.
A new device can be appended to the list of devices contained in a power profile with the
following commands:
POWER_SETPROFILE 0 1 "NEW_DEVICE" PM_NORMAL
POWER_SETPROFILE 0 2 "NEW_DEVICE" PM_ACTIVESTANDBY
The default settings of power profiles are designed to work without any changes having to
be made.

Retrieving profile details


To retrieve information on the present state of the system, enter the POWER_GETPROFILE
command at the testtool prompt without any additional parameters, as follows:
POWER_GETPROFILE
To retrieve information about other profiles, add the relevant parameters. For example, the
following command displays information relating to power profile 2:
POWER_GETPROFILE 0 2

Place STAPI and CPU into standby and wake up using default trigger
Tune the feed the following testtool commands:
TUNER_TUNE 1 +11018 +27500 MOD_QPSK FEC_3_4 POL_H
PLAY_PROGRAM 0 "1" 1f4
POWER_SETMODE 0 1 PM_CPU_SLEEP
The wake up is triggered using the default device, that is, the IR remote control.
POWER_SETMODE 0 1 PM_CPU_STANDBY

Place STAPI and CPU into standby and wake up using non-default trigger
To set up a wake up timer with a parameter of 2 seconds, enter the command:
POWER_SETMODE 0 1 PM_CPU_SLEEP PM_WAKEUP_TIMER 2
In this case, the wake up is triggered using either the default wakeup (IR) or by the timer
completion, whichever happens first.
Note: On the STi7111, using the timer to trigger wakeup does not currently work.
The wake up can also be triggered by IR or HDMI, depending on which occurs first.
POWER_SETMODE 0 1 PM_CPU_NORMAL FFFFFFFF PM_WAKEUP_HDMI 0 PM_WAKEUP_TIMER 2

On the STi7111, wake up from sleep mode can be achieved using the front panel key(c).
Wakeup from standby is currently under development.
For HDMI wakeup, please ensure you are using CEC capable TV Set.

c. Details of front panel key use will be published in the next release.

180/190 8214357 Rev C


STAPI SDK Glossary

9 Glossary

Table 9 gives a list of commonly used abbreviations.

Table 9. List of abbreviations used in this document


API Application programming interface
ATA AT attachment
ATSC Advanced Television Systems Committee
CAT Conditional access table
CRC Cyclic redundancy check
DTV Digital television
DVB Digital video broadcasting
ECM Entitlement control message
EIT Event information table
EMM Entitlement management message
EPG Electronic programme guide
ES Elementary stream
HDD Hard disk drive
MPEG Moving Pictures Experts Group
NIT Network information table
PAT Program association table
PCR Program clock reference
PES Packetized elementary stream
PID Packet identifier
PIO Programmed input/output for HDD data transfer
PMT Program map table
PSI Program specific information
PSIP Program and system information protocol
PTI Programmable transport interface
PTI4 Programmable transport interface architecture version 4
PTS Presentation Time Stamp
SI System information (ATSC) or Service information (DVB)
STAPI ST Application Programming Interface
STC System time clock

8214357 Rev C 181/190


Glossary STAPI SDK

Table 9. List of abbreviations used in this document


TC Transport controller
TS Transport stream

182/190 8214357 Rev C


STAPI SDK Revision history

Revision history

Table 10. Document revision history


Date Revision Changes

Minor corrections throughout.


Minor update to Section 1.2: Toolsets and other software on
page 10.
Corrected error regarding STWorkbench on-line help in
Section 1.6: Compilation on page 12.
Minor updates to Section 2.1: Board configuration for MS
Windows machine on page 14.
Corrected error regarding USE_TARGETPACK environment
variable in Table 3: Other environment variables on page 19.
Added Note concerning Windows DEP to Section 2.7.2:
Running the software on page 24
Added Section 2.8: Compiling STAPI SDK for DUAL CPU
(STi7108 SoC) on page 25.
Added Section 2.9: Running the software for dual CPUs
(STi7108 SoC) on page 25.
Updated Section 3.1: Clean current STLinux distribution on
page 27.
11-May-2010 C Update to Installing additional libraries on page 29.
Updated Section 3.3: Applying the patches on page 30.
Updated Section 3.4: Installation of Multicom on page 30.
Updated Section 3.5: Board configuration for STLinux on
page 31.
Added Section 3.8.1: Compiling the STAPI SDK tree for Linux
with uclibc on page 35.
Updated Section 3.9: Running STAPI SDK for STLinux on
page 36.
Added Section 7.2: Multimedia playback support on page 49.
Added Testtool configuration on page 52 and
CONFIG_TESTTOOL on page 56.
Added VMIX_GETCONNLAYER on page 165.
Added VOUT_GETSYNCCALIB on page 168 and
VOUT_SETSYNCCALIB on page 169.
Added Retrieving profile details on page 180.
Updated Place STAPI and CPU into standby and wake up using
non-default trigger on page 180
Modifications made to Section 3.2.1: Installation of STLinux on
page 27.
Modifications made to Section 8.3.24: Power management
12-Jan-2010 C.2
commands on page 134.
Added Section 8.4.17: Using low power mode operation on
page 179.

8214357 Rev C 183/190


Revision history STAPI SDK

Table 10. Document revision history (continued)


Date Revision Changes

Minor corrections made throughout.


Modifications made to Section 3.10: Frame buffer and directfb
support on Linux on page 37.
Added new testtool commands: AUD_SETSPEED on page 79,
BLAST_POLLKEY on page 82 and BLIT_FILL_JOB on
page 83.
14-Oct-2009 C.1
Added Section 8.3.24: Power management commands on
page 134 to the Testtool commands.
SYS_CACHEFLUSH, SYS_CACHEOF and SYS_CACHEON
have been removed from the testtool commands.
Corrections made to Section 8.4: Testtool examples on
page 172 in respect of language and style guide.
07-Sep-2009 B Added new section on Testtool examples
20-Aug-2009 A Initial release.

184/190 8214357 Rev C


STAPI SDK Index of Testtool commands

Index of Testtool commands

ALLOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 CURSOR_ENABLE . . . . . . . . . . . . . . . . . . . . . 89


ATAPI_BENCH . . . . . . . . . . . . . . . . . . . . . . . . .70 CURSOR_LOAD . . . . . . . . . . . . . . . . . . . . . . . 89
ATAPI_DRIVEINFO . . . . . . . . . . . . . . . . . . . . .70 CURSOR_SETPOS . . . . . . . . . . . . . . . . . . . . . 90
ATAPI_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . .71 DEFINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
AUD_BEEP . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
AUD_DISABLE . . . . . . . . . . . . . . . . . . . . . . . . .72 DEMUX_CONNECT. . . . . . . . . . . . . . . . . . . . . 91
AUD_ENABLE . . . . . . . . . . . . . . . . . . . . . . . . .73 DEMUX_DUPLICATE . . . . . . . . . . . . . . . . . . . 92
AUD_GETCAPABILITY . . . . . . . . . . . . . . . . . .73 DEMUX_INFO . . . . . . . . . . . . . . . . . . . . . . . . . 92
AUD_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 DEMUX_MUX. . . . . . . . . . . . . . . . . . . . . . . . . . 92
AUD_INJSTART . . . . . . . . . . . . . . . . . . . . . . . .74 DEMUX_PESSTART . . . . . . . . . . . . . . . . . . . . 93
AUD_INJSTOP . . . . . . . . . . . . . . . . . . . . . . . . .75 DEMUX_PESSTOP . . . . . . . . . . . . . . . . . . . . . 93
AUD_PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . .75 DEMUX_SETKEY . . . . . . . . . . . . . . . . . . . . . . 94
AUD_RESUME . . . . . . . . . . . . . . . . . . . . . . . . .76 DEMUX_STATUS . . . . . . . . . . . . . . . . . . . . . . 94
AUD_SETDYNAMIC . . . . . . . . . . . . . . . . . . . . .76 DENC_COLORBAR . . . . . . . . . . . . . . . . . . . . . 95
AUD_SETEFFECT . . . . . . . . . . . . . . . . . . . . . .77 DENC_GETCAPABILITY . . . . . . . . . . . . . . . . . 95
AUD_SETLATENCY . . . . . . . . . . . . . . . . . . . . .77 DENC_GETMODE . . . . . . . . . . . . . . . . . . . . . . 95
AUD_SETOFFSET . . . . . . . . . . . . . . . . . . . . . .78 DENC_INFO. . . . . . . . . . . . . . . . . . . . . . . . . . . 95
AUD_SETSPEED . . . . . . . . . . . . . . . . . . . . . . .79 DENC_SETMODE . . . . . . . . . . . . . . . . . . . . . . 96
AUD_SETSTEREO . . . . . . . . . . . . . . . . . . . . . .78 DISPLAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
AUD_SETVOLUME . . . . . . . . . . . . . . . . . . . . .79 DISPLAY_B . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
AUD_SPDIF . . . . . . . . . . . . . . . . . . . . . . . . . . .80 DMA_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
AUD_STATUS . . . . . . . . . . . . . . . . . . . . . . . . .80 DMA_SWTS . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
AUD_SYNCHRO. . . . . . . . . . . . . . . . . . . . . . . .81 DMA_TEST . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
BLAST_GETKEY . . . . . . . . . . . . . . . . . . . . . . .81 DUMPMEM. . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
BLAST_INFO . . . . . . . . . . . . . . . . . . . . . . . . . .81 END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
BLAST_POLLKEY . . . . . . . . . . . . . . . . . . . . . .82 EXIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
BLIT_CLEAR. . . . . . . . . . . . . . . . . . . . . . . . . . .82 FILL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
BLIT_COPY . . . . . . . . . . . . . . . . . . . . . . . . . . .82 FLASH_BLOWER . . . . . . . . . . . . . . . . . . . . . . 98
BLIT_FILL . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 FLASH_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . 99
BLIT_FILL_JOB . . . . . . . . . . . . . . . . . . . . . . . .83 FREE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
BLIT_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 FS_BENCH . . . . . . . . . . . . . . . . . . . . . . . . . . 100
BPEEK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 FS_COPY. . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
BPOKE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 FS_DEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
CC_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 FS_DIR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
CC_START . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 FS_FDISK . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
CC_STOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 FS_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
CLKRV_CHECKSTC . . . . . . . . . . . . . . . . . . . .85 FS_LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
CLKRV_DISABLE . . . . . . . . . . . . . . . . . . . . . . .85 FS_MKDIR . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
CLKRV_ENABLE . . . . . . . . . . . . . . . . . . . . . . .85 FS_MOUNT . . . . . . . . . . . . . . . . . . . . . . . . . . 104
CLKRV_GET . . . . . . . . . . . . . . . . . . . . . . . . . . .85 FS_RENAME . . . . . . . . . . . . . . . . . . . . . . . . . 106
CLKRV_INFO . . . . . . . . . . . . . . . . . . . . . . . . . .86 FS_RMDIR . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
CLKRV_INVALIDATE . . . . . . . . . . . . . . . . . . . .86 FS_UMOUNT . . . . . . . . . . . . . . . . . . . . . . . . . 107
CLKRV_SET . . . . . . . . . . . . . . . . . . . . . . . . . . .87 FSK_CHANGE_CHANNEL . . . . . . . . . . . . . . 107
CLKRV_SETOFFSET . . . . . . . . . . . . . . . . . . . .87 FSK_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
CONFIG_TESTTOOL . . . . . . . . . . . . . . . . . . . .56 FSK_TUNER_REGISTER . . . . . . . . . . . . . . . 108
COPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 FSK_TUNER_STATUS . . . . . . . . . . . . . . . . . 108
CRYPT_BENCH . . . . . . . . . . . . . . . . . . . . . . . .88 FSK_TUNER_UNREGISTER. . . . . . . . . . . . . 108
CRYPT_INFO . . . . . . . . . . . . . . . . . . . . . . . . . .88 GETKEY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
CURSOR_DISABLE . . . . . . . . . . . . . . . . . . . . .89 GFX_ALPHA . . . . . . . . . . . . . . . . . . . . . . . . . 109

8214357 Rev C 185/190


Index of Testtool commands STAPI SDK

GFX_BITMAP . . . . . . . . . . . . . . . . . . . . . . . . .110 PIP_ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . 127


GFX_DISABLE . . . . . . . . . . . . . . . . . . . . . . . .111 PIP_OPEN . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
GFX_ENABLE. . . . . . . . . . . . . . . . . . . . . . . . .111 PIP_PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . . 128
GFX_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . .111 PIP_RESUME . . . . . . . . . . . . . . . . . . . . . . . . 128
GFX_SETANTIFLICKER . . . . . . . . . . . . . . . .112 PIP_SETWINDOW . . . . . . . . . . . . . . . . . . . . . 128
GFX_SETWINDOW . . . . . . . . . . . . . . . . . . . .112 PLAY_AUDIO_SETOUTPUT . . . . . . . . . . . . . 129
GUI_COM . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 PLAY_CHANGEPIDS. . . . . . . . . . . . . . . . . . . 129
GUI_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 PLAY_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . 129
GUI_RESTORE . . . . . . . . . . . . . . . . . . . . . . .113 PLAY_PAUSE . . . . . . . . . . . . . . . . . . . . . . . . 129
GUI_SAVE . . . . . . . . . . . . . . . . . . . . . . . . . . .113 PLAY_PAUSERECORD. . . . . . . . . . . . . . . . . 130
GUI_SORT . . . . . . . . . . . . . . . . . . . . . . . . . . .113 PLAY_PROGRAM . . . . . . . . . . . . . . . . . . . . . 130
HDMI_DISABLE . . . . . . . . . . . . . . . . . . . . . . .114 PLAY_PROGRAM_A3 . . . . . . . . . . . . . . . . . . 130
HDMI_ENABLE . . . . . . . . . . . . . . . . . . . . . . . .114 PLAY_PROGRAM_DTV. . . . . . . . . . . . . . . . . 131
HDMI_INFO . . . . . . . . . . . . . . . . . . . . . . . . . .114 PLAY_RESUME . . . . . . . . . . . . . . . . . . . . . . . 131
HDMI_SETAVI . . . . . . . . . . . . . . . . . . . . . . . .115 PLAY_SEEK. . . . . . . . . . . . . . . . . . . . . . . . . . 131
HDMI_SETKEY . . . . . . . . . . . . . . . . . . . . . . . .116 PLAY_SPEED . . . . . . . . . . . . . . . . . . . . . . . . 132
HDMI_STATUS . . . . . . . . . . . . . . . . . . . . . . . .116 PLAY_START. . . . . . . . . . . . . . . . . . . . . . . . . 132
HELP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 PLAY_STATUS . . . . . . . . . . . . . . . . . . . . . . . 132
HISTORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 PLAY_STEP . . . . . . . . . . . . . . . . . . . . . . . . . . 132
I2C_DETECT . . . . . . . . . . . . . . . . . . . . . . . . .117 PLAY_STOP. . . . . . . . . . . . . . . . . . . . . . . . . . 133
I2C_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 PLAY_VIDEO_SETOUTPUT . . . . . . . . . . . . . 133
I2C_READ. . . . . . . . . . . . . . . . . . . . . . . . . . . .117 PLAY_WAIT_END . . . . . . . . . . . . . . . . . . . . . 133
I2C_READEXT . . . . . . . . . . . . . . . . . . . . . . . .118 POD_CONNECT . . . . . . . . . . . . . . . . . . . . . . 136
I2C_WRITE . . . . . . . . . . . . . . . . . . . . . . . . . . .118 POD_LOOPBACK_ADVANCE. . . . . . . . . . . . 136
IOBASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 POD_LOOPBACK_SIMPLE. . . . . . . . . . . . . . 136
IP_CONFIG . . . . . . . . . . . . . . . . . . . . . . . . . . .119 POD_MCARD_CP_TEST . . . . . . . . . . . . . . . 136
IP_FTP_START . . . . . . . . . . . . . . . . . . . . . . .119 POKE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
IP_FTP_STOP . . . . . . . . . . . . . . . . . . . . . . . .120 POWER_GETPROFILE . . . . . . . . . . . . . . . . . 134
IP_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 POWER_INFO . . . . . . . . . . . . . . . . . . . . . . . . 134
IP_PING . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 POWER_SETMODE . . . . . . . . . . . . . . . . . . . 135
IP_STATUS. . . . . . . . . . . . . . . . . . . . . . . . . . .120 POWER_SETPROFILE . . . . . . . . . . . . . . . . . 135
IP_STREAMS . . . . . . . . . . . . . . . . . . . . . . . . .121 PRINT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
KEYSCN_GETKEY . . . . . . . . . . . . . . . . . . . . .121 PWM_GET . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
KEYSCN_GETPARAMS . . . . . . . . . . . . . . . . .122 PWM_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . 137
KEYSCN_INFO . . . . . . . . . . . . . . . . . . . . . . . .121 PWM_SET . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
KEYSCN_SETDEBOUNCETIME . . . . . . . . . .122 RACK_OFF . . . . . . . . . . . . . . . . . . . . . . . . . . 140
LIST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 RACK_ON . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
LOADMEM . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 REC_INSERT_PMT . . . . . . . . . . . . . . . . . . . . 137
LOG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 REC_PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . 138
PEEK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 REC_PROGRAM . . . . . . . . . . . . . . . . . . . . . . 138
PIO_ATA_RESET . . . . . . . . . . . . . . . . . . . . . .122 REC_RESUME. . . . . . . . . . . . . . . . . . . . . . . . 138
PIO_CLEAR . . . . . . . . . . . . . . . . . . . . . . . . . .123 REC_START . . . . . . . . . . . . . . . . . . . . . . . . . 139
PIO_DAC_RESET . . . . . . . . . . . . . . . . . . . . .123 REC_STATUS . . . . . . . . . . . . . . . . . . . . . . . . 139
PIO_FE_RESET . . . . . . . . . . . . . . . . . . . . . . .124 REC_STOP . . . . . . . . . . . . . . . . . . . . . . . . . . 139
PIO_GET. . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 SAVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
PIO_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 SCART_INFO. . . . . . . . . . . . . . . . . . . . . . . . . 140
PIO_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 SCART_RATIO . . . . . . . . . . . . . . . . . . . . . . . 140
PIO_MODEM_RESET . . . . . . . . . . . . . . . . . .125 SCART_SET . . . . . . . . . . . . . . . . . . . . . . . . . 141
PIO_SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126 SEARCH. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
PIO_USB_RESET. . . . . . . . . . . . . . . . . . . . . .126 SHOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
PIP_CLOSE . . . . . . . . . . . . . . . . . . . . . . . . . .127 SMART_GETPARAMS . . . . . . . . . . . . . . . . . 141
PIP_DISABLE . . . . . . . . . . . . . . . . . . . . . . . . .127 SMART_INFO . . . . . . . . . . . . . . . . . . . . . . . . 141

186/190 8214357 Rev C


STAPI SDK Index of Testtool commands

SMART_READ . . . . . . . . . . . . . . . . . . . . . . . .141 USB_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . 156


SMART_RESET . . . . . . . . . . . . . . . . . . . . . . .142 USB_KEYB. . . . . . . . . . . . . . . . . . . . . . . . . . . 156
SMART_TRANSFER . . . . . . . . . . . . . . . . . . .142 USB_MOUSE . . . . . . . . . . . . . . . . . . . . . . . . . 156
SMART_WRITE . . . . . . . . . . . . . . . . . . . . . . .142 VID_BITMAP . . . . . . . . . . . . . . . . . . . . . . . . . 156
SOURCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 VID_CLEAR . . . . . . . . . . . . . . . . . . . . . . . . . . 157
SPEEK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 VID_DISABLE . . . . . . . . . . . . . . . . . . . . . . . . 157
SPI_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 VID_ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . 157
SPI_READ . . . . . . . . . . . . . . . . . . . . . . . . . . .143 VID_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
SPI_WRITE . . . . . . . . . . . . . . . . . . . . . . . . . . .143 VID_GETDISPLAYPARAMS . . . . . . . . . . . . . 158
SPOKE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 VID_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
SUBT_DISABLE . . . . . . . . . . . . . . . . . . . . . . .144 VID_INJSTART . . . . . . . . . . . . . . . . . . . . . . . 158
SUBT_ENABLE . . . . . . . . . . . . . . . . . . . . . . .144 VID_INJSTOP . . . . . . . . . . . . . . . . . . . . . . . . 158
SUBT_INFO . . . . . . . . . . . . . . . . . . . . . . . . . .144 VID_PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . . 159
SUBT_SETWINDOW . . . . . . . . . . . . . . . . . . .145 VID_RESUME . . . . . . . . . . . . . . . . . . . . . . . . 159
SUBT_START . . . . . . . . . . . . . . . . . . . . . . . . .144 VID_SETFORMAT . . . . . . . . . . . . . . . . . . . . . 159
SUBT_STOP . . . . . . . . . . . . . . . . . . . . . . . . . .145 VID_SETFRAMERATE . . . . . . . . . . . . . . . . . 159
SYS_CLOCK. . . . . . . . . . . . . . . . . . . . . . . . . .145 VID_SETMODE . . . . . . . . . . . . . . . . . . . . . . . 160
SYS_ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 VID_SETSPEED . . . . . . . . . . . . . . . . . . . . . . 160
SYS_IRQ. . . . . . . . . . . . . . . . . . . . . . . . . . . . .146 VID_SETWINAUTO . . . . . . . . . . . . . . . . . . . . 160
SYS_MEM. . . . . . . . . . . . . . . . . . . . . . . . . . . .146 VID_SETWINDOW. . . . . . . . . . . . . . . . . . . . . 161
SYS_PROF_FLUSH . . . . . . . . . . . . . . . . . . . .147 VID_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . 161
SYS_PROF_START . . . . . . . . . . . . . . . . . . . .146 VID_STEP . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
SYS_PROF_STOP . . . . . . . . . . . . . . . . . . . . .146 VID_SYNCHRO . . . . . . . . . . . . . . . . . . . . . . . 162
SYS_REV . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 VIN_CLOSE . . . . . . . . . . . . . . . . . . . . . . . . . . 162
SYS_TASK . . . . . . . . . . . . . . . . . . . . . . . . . . .147 VIN_DISABLE . . . . . . . . . . . . . . . . . . . . . . . . 162
SYS_WATCHMEM_START . . . . . . . . . . . . . .147 VIN_ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . 162
SYS_WATCHMEM_STOP . . . . . . . . . . . . . . .148 VIN_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
TABLE_EIT . . . . . . . . . . . . . . . . . . . . . . . . . . .148 VIN_OPEN . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
TABLE_FILTER . . . . . . . . . . . . . . . . . . . . . . .148 VIN_PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . . 163
TABLE_NIT . . . . . . . . . . . . . . . . . . . . . . . . . . .149 VIN_RESUME . . . . . . . . . . . . . . . . . . . . . . . . 163
TABLE_PAT . . . . . . . . . . . . . . . . . . . . . . . . . .149 VIN_SETWINDOW. . . . . . . . . . . . . . . . . . . . . 164
TABLE_PMT . . . . . . . . . . . . . . . . . . . . . . . . . .149 VMIX_DISABLE . . . . . . . . . . . . . . . . . . . . . . . 164
TABLE_SDT . . . . . . . . . . . . . . . . . . . . . . . . . .149 VMIX_ENABLE. . . . . . . . . . . . . . . . . . . . . . . . 164
TABLE_TDT . . . . . . . . . . . . . . . . . . . . . . . . . .150 VMIX_GETBKCOLOR . . . . . . . . . . . . . . . . . . 165
TEXT_CLEAR . . . . . . . . . . . . . . . . . . . . . . . . .150 VMIX_GETCAPABILITY. . . . . . . . . . . . . . . . . 165
TEXT_INFO . . . . . . . . . . . . . . . . . . . . . . . . . .150 VMIX_GETCONNLAYER . . . . . . . . . . . . . . . . 165
TEXT_PRINT . . . . . . . . . . . . . . . . . . . . . . . . .151 VMIX_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . 165
TRACE_HDDCLOSE . . . . . . . . . . . . . . . . . . .151 VMIX_SETASPECTRATIO . . . . . . . . . . . . . . 166
TRACE_HDDOPEN . . . . . . . . . . . . . . . . . . . .151 VMIX_SETBKCOLOR . . . . . . . . . . . . . . . . . . 166
TRACE_OFF . . . . . . . . . . . . . . . . . . . . . . . . . .151 VMIX_SETOFFSET . . . . . . . . . . . . . . . . . . . . 167
TRACE_ON. . . . . . . . . . . . . . . . . . . . . . . . . . .152 VOUT_DISABLE . . . . . . . . . . . . . . . . . . . . . . 167
TRACE_TEST . . . . . . . . . . . . . . . . . . . . . . . . .152 VOUT_ENABLE . . . . . . . . . . . . . . . . . . . . . . . 167
TTX_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . .152 VOUT_GETCAPABILITY . . . . . . . . . . . . . . . . 168
TTX_START . . . . . . . . . . . . . . . . . . . . . . . . . .152 VOUT_GETSYNCCALIB . . . . . . . . . . . . . . . . 168
TTX_STOP . . . . . . . . . . . . . . . . . . . . . . . . . . .153 VOUT_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . 167
TUNER_INFO . . . . . . . . . . . . . . . . . . . . . . . . .153 VOUT_SETBCS . . . . . . . . . . . . . . . . . . . . . . . 168
TUNER_LOOP . . . . . . . . . . . . . . . . . . . . . . . .153 VOUT_SETSYNCCALIB . . . . . . . . . . . . . . . . 169
TUNER_SCAN . . . . . . . . . . . . . . . . . . . . . . . .153 VTG_GETMODE . . . . . . . . . . . . . . . . . . . . . . 170
TUNER_SENDDISEQCCMD . . . . . . . . . . . . .154 VTG_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
TUNER_STATUS . . . . . . . . . . . . . . . . . . . . . .154 VTG_SETMODE . . . . . . . . . . . . . . . . . . . . . . 169
TUNER_SWITCH . . . . . . . . . . . . . . . . . . . . . .154 WAIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
TUNER_TUNE . . . . . . . . . . . . . . . . . . . . . . . .155 ZAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

8214357 Rev C 187/190


Index STAPI SDK

Index

A O
ATA interface . . . . . . . . . . . . . . . . . . . . . . . . . .70 OS21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

B P
Backus-Naur Form . . . . . . . . . . . . . . . . . . . . . . .8 packetized elementary stream . . . . . . . . . . . . 93
blower . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39, 98 playback driver . . . . . . . . . . . . . . . . . . . . . . . 129
blower tool . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
BNF. See Backus-naur Form.
R
bootrom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
romgen tool . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
C
S
command history . . . . . . . . . . . . . . . . . . . . . . .51
console debugger . . . . . . . . . . . . . . . . . . . . . . .24 SCART driver . . . . . . . . . . . . . . . . . . . . . . . . 140
cryptography benchmarks . . . . . . . . . . . . . . . .88 setenv.bat . . . . . . . . . . . . . . . . . . . . . . . . . 14-16
setenv.sh . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 31
Smartcard driver . . . . . . . . . . . . . . . . . . . . . . 141
D Software notation . . . . . . . . . . . . . . . . . . . . . . . 8
DAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 SPI driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Data Display Debugger . . . . . . . . . . . . . . . 35-36 ST Micro Connect . . . . . . . . . . . . . . . . . . . . 9, 98
denc colorbar . . . . . . . . . . . . . . . . . . . . . . . . .172 ST TargetPack . . . . . . . . . . . . . . . . . . . . . . . . 47
directfb support . . . . . . . . . . . . . . . . . . . . . . . .37 STATAPI driver . . . . . . . . . . . . . . . . . . . . . . . . 71
DirecTV . . . . . . . . . . . . . . . . . . . . . . . . . 177-178 STAUD driver . . . . . . . . . . . . . . . . . . . . . . . . . 74
DiSEqC command . . . . . . . . . . . . . . . . . . . . .154 STBLAST driver . . . . . . . . . . . . . . . . . . . . . . . 81
DVB-SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .175 STBLIT driver . . . . . . . . . . . . . . . . . . . . . . . . . 83
STCC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
STCRYPT/STTKDMA driver . . . . . . . . . . . . . . 88
F
STDENC driver . . . . . . . . . . . . . . . . . . . . . . . . 95
File system . . . . . . . . . . . . . . . . . . . . . . . . . . .102 STFLASH driver . . . . . . . . . . . . . . . . . . . . . . . 99
Flash memory . . . . . . . . . . . . . . . . . . . . . . . . .38 STFSK driver . . . . . . . . . . . . . . . . . . . . . . . . . 107
STHDMI driver . . . . . . . . . . . . . . . . . . . . . . . . 114
G STI2C driver . . . . . . . . . . . . . . . . . . . . . . . . . 117
STKEYSCN driver . . . . . . . . . . . . . . . . . . . . . 121
gmake . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-22 STLAYER/STBLIT driver . . . . . . . . . . . . . . . . 111
STPOWER driver . . . . . . . . . . . . . . . . . . . . . 134
H STWorkbench . . . . . . . . . . . . . . . . . . . . . . 21, 24
subtitle driver . . . . . . . . . . . . . . . . . . . . . . . . . 144
hardware blitter . . . . . . . . . . . . . . . . . . . . . . . .82
subtitles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

I T
IRQ settings . . . . . . . . . . . . . . . . . . . . . . . . . .146
targetpack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
TCP/IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
L TCP/IP driver . . . . . . . . . . . . . . . . . . . . . . . . . 120
Linux . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 27, 47 teletext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
LIRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 testtool . . . . . . . . . . . . . . . . . . . . . . . 9, 24, 41, 51
low power mode . . . . . . . . . . . . . . . . . . . . . . .179 scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
TEXT driver . . . . . . . . . . . . . . . . . . . . . . . . . . 150

188/190 8214357 Rev C


STAPI SDK Index

TTX driver . . . . . . . . . . . . . . . . . . . . . . . . . . .152

V
video capture . . . . . . . . . . . . . . . . . . . . . . . . .179
video driver . . . . . . . . . . . . . . . . . . . . . . . . . . .158
VMIX driver . . . . . . . . . . . . . . . . . . . . . . . . . .165
VOUT driver . . . . . . . . . . . . . . . . . . . . . . . . . .167
VTG driver . . . . . . . . . . . . . . . . . . . . . . . . . . .169

8214357 Rev C 189/190


STAPI SDK

Please Read Carefully:

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.

ST and the ST logo are trademarks or registered trademarks of ST in various countries.

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.

© 2010 STMicroelectronics - All rights reserved

STMicroelectronics group of companies


Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan -
Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America
www.st.com

190/190 8214357 Rev C

S-ar putea să vă placă și