ST200 Cross Dev Manual PDF
ST200 Cross Dev Manual PDF
7521642 Rev L
November 2006
BLANK
User manual
ST200 VLIW series
ST200 cross development manual
Overview
The ST200 development system is a set of tools used to create programs for the ST200
family of VLIW cores. It is a cross-development environment, in that the target machine for
which the code is developed (for example, ST220) is distinct from the host machine on
which the development tools run. As there are many situations in which the availability of a
target is not possible, a software simulator is provided on which to run and evaluate code.
This has the advantage of allowing software to be developed in parallel with the detailed
design of the hardware, as well as permitting software considerations to exert a reciprocal
effect on hardware design (in cases where the hardware architecture has not been
finalized).
November 2006
7521642 Rev L
1/170
www.st.com
Contents
ST200
Contents
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
ST200 document identification and control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
ST200 documentation suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Conventions used in this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Acknowledgements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.1
1.2
Supported targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3
Connecting to a target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4
1.5
st200run tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.6
1.7
1.8
1.9
2/170
1.6.1
Simulator options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.6.2
Board options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
st200gdb debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.7.1
1.7.2
1.7.3
1.7.4
1.8.2
1.8.3
1.8.4
1.8.5
1.8.6
1.8.7
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Initialization sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.9.2
Initialization hook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7521642
ST200
Contents
1.10
1.11
1.10.2
1.11.2
1.12
1.13
1.13.2
1.13.3
STWorkbench installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.1.1
2.2
2.3
Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.2.2
2.2.3
ST200 preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.3.2
ST Profiler preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.3.3
2.3.4
Library names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.3.5
Project properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.3.6
2.3.7
Running a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.3.8
Analyzing a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.3.9
2.3.10
Debugging a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2.3.11
Debugging tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
ST200 simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.1
3.2
3.2.2
3/170
Contents
ST200
3.3
Setting up a board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.1
4.2
4.3
4.4
4.5
4.6
4.2.1
Toolset partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.2.2
Toolset configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.2.3
Configuration matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Supported configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.3.1
4.3.2
SoC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.3.3
4.4.2
Initialization sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.5.2
4.5.3
Debug facilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Bring up operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
4.6.1
4.6.2
4.6.3
4.6.4
4.6.5
4.6.6
5.2
4/170
5.3
5.4
Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.4.1
5.4.2
ST200
Contents
5.5
5.5.2
5.6
5.7
5.8
5.9
A.2
A.3
A.4
A.5
A.6
A.1.2
Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
A.2.1
A.2.2
A.3.2
A.3.3
A.3.4
A.4.2
A.4.3
A.4.4
Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
A.5.1
A.5.2
A.5.3
A.5.4
A.5.5
A.7
A.7.2
7521642
5/170
Contents
ST200
A.8
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
A.8.1
A.8.2
A.9
A.10
A.11
A.12
6/170
7521642
ST200
Preface
Preface
ST200 document identification and control
Each book in the ST200 documentation suite carries a unique ADCS identifier of the form:
ADCS nnnnnnnx
where nnnnnnn is the document number, and x is the revision.
Whenever making comments on an ST200 document, the complete identification
ADCS nnnnnnnx should be quoted.
7/170
Preface
ST200
code comments,
instructions.
Hardware notation
The following conventions are used for hardware notation:
Software notation
Syntax definitions are presented in a modified Backus-Naur Form (BNF). Briefly:
1.
Terminal strings of the language, that is, strings not built up by rules of the language,
are printed in teletype font. For example, void.
2.
Nonterminal strings of the language, that is, strings built up by rules of the language,
are printed in italic teletype font. For example, name.
3.
4.
Each phrase definition is built up using a double colon and an equals sign to separate
the two sides (::=).
5.
6.
7.
Mathematical notation
A range of values can be shown using square braces, [], and round braces, (). Square
braces mean the nearest value is included, and round braces mean the nearest value is not
included.
For example:
8/170
[1 .. 3]
is the values 1, 2, 3,
[1 .. 3)
is the values 1, 2,
(1 .. 3]
is the values 2, 3,
(1 .. 3)
7521642
ST200
Preface
Acknowledgements
Microsoft, Visual Studio and Windows are registered trademarks of Microsoft
Corporation in the United States and/or other countries.
SolarisTM is a trademark of Sun Microsystems, Inc. in the US and other countries.
CygwinTM and InsightTM are trademarks of Red Hat Software, Inc.
Linux is a registered trademark of Linus Torvalds.
7521642
9/170
Getting started
ST200
Getting started
1.1
1.2
Supported targets
Different versions of the ST200 Micro Toolset support different targets.
The R5.0 toolset supports the ST220 and ST231 cores on the following targets: ST220 and
ST231 Simulator, STm8000-Demo Board (mb379), STm5700-Demo Board (mb385),
ST230EMU-PCI Board (mb388a), STm8010-Mboard (mb421), ST231-EVAL board
(mb424), STm8010-REF Traviata (mb426), STb5525-Mboard (mb428) and STb7100/09-Ref
board (mb442).
1.3
Connecting to a target
Figure 1 shows how to connect to a target from an ethernet based host via an ST Micro
Connect(a).
10/170
7521642
ST200
Getting started
Figure 1.
Connecting to a target
ST Micro Connect
Ethernet
network
(working at 10 MBaud)
Silicon target
1.4
7521642
11/170
Getting started
Figure 2.
ST200
0x00000000
RESET_ADDRESS
.bootreset
0x00010000
BOOT_ADDRESS
0x08000000
TEXT_BASE
Comments
Section loaded, and executed only if reset
mode is specified from st200run or st200gdb.
This is the section where execution starts after
RESET signal is released.
.boot
.text
Section loaded.
It contains the __start() entry point of the program.
.data
.bss
stack_pt -->
scratch area
copy of args
kernel stack
scratch area
RAMEND
kstack_pt -->
0x08800000
_ramend
0xffffffff
12/170
7521642
ST200
1.5
Getting started
st200run tool
st200run enables the connection of an execution target, and enables an ST200 program to
load and execute. Moreover, while the program is executing on the target, st200run is able
to emulate some system calls (syscall) on the host machine.
The system calls emulated are:
If the - character precedes a program argument, it must be back-slashed twice (\\-) in order
to not be interpreted by st200run and sent to the target program.
Binary files are checked at load time to ensure they match one of the core versions
supported by the target. An error is displayed if they do not match.
A complete example of how to operate the st200run tool is provided in
<tools-dir>/samples/hello.
The --target (or -t) option is a compulsory option and should specify the alias name of a
predefined target. The predefined targets are configured in the target description file. See
Section 1.6 on page 19 for a full description of targets.
Two types of target are supported by the toolset: the simulator targets, based on the ST200
cycle accurate reference simulator models, and real silicon targets. Section 1.2: Supported
targets on page 10 details the targets supported by each toolset release.
There are three basic modes that can be used to run a simulation. They reflect the trade off
in simulation accuracy against simulation speed.
In Reference (or cycle accurate) mode, the pipeline is modelled, and by default, the
caches are configured to be at the highest level of detail. The memory subsystem/bus
is also faithfully modelled (including the write buffer and prefetch buffer), as are all the
relevant protection/translation units (for example, IPU, DPU on the earlier ST200 cores
and the UTLB + micro TLBs on the ST231 cores onwards). This mode is guaranteed to
execute code in a similar manner to the hardware, that is, it behaves as expected in all
exceptional circumstances. This includes the modelling of all types of bus errors,
interrupts, debug interrupts and exceptions. Consequently, it has the lowest
performance of the three modes.
In ISS (or instruction set accurate) mode, each instruction is run to completion before
the next instruction begins (that is, it does not model the pipeline, latencies, interlocking
and so on). It does model the caches (basic versions) and the protection/translation
units (IPU/DPU/UTLB), so (as with reference mode) in terms of exceptional
circumstances, it behaves in a manner similar to the hardware.
7521642
13/170
Getting started
ST200
In Fast (functional) mode, only the minimal set of components required to run correct
code correctly are modelled. This mode does not model any of the memory
subsystem, caches, protection units (the UTLB however is present in the ST231
model), bus errors, external interrupts or provide the device plug-in functionality.
Therefore, it has the highest performance, but the lowest accuracy.
st200run options
Option
14/170
Short form
Description
Display the st200run help and exit.
For example:
st200run -h
st200run --help
--help
-h
--after_exec=
<STRING>
--before_exec=
<STRING>
7521642
ST200
Getting started
Table 1.
Option
Short form
Description
-D
--detach
-P
--dll=<STRING>
--debug
--env
-e
7521642
15/170
Getting started
ST200
Table 1.
Option
Description
--force
-f
--ignore_cache
-c
--loaded
-l
--mtargetdir=
<STRING>
-B
--noncacheable_
size=<INT>
-n<INT>
--pc=<INT>
-p<INT>
--no_clear_bss
16/170
Short form
7521642
ST200
Getting started
Table 1.
Option
--ramend=<INT>
--reset
Short form
Description
-r<INT>
-R
--timeout=<INT>
-o<INT>
7521642
17/170
Getting started
ST200
Table 1.
Option
--verbose
--version
Short form
Description
-v
-V
1. The full list of direct commands can be obtained by typing gdi help at the gdb command prompt after
connecting to the dll.
18/170
7521642
ST200
Getting started
1.6
Note:
1.6.1
For the Windows toolset, the path defined with the -mtargetdir option must be set using
the format DRIVE:\Directory\ (for example C:\mytarget\).
Simulator options
By default, two simulator targets are predefined in <tools-dir>/target/targets.cfg.
They are:
simprof: the simulator target, generating profiling data files in gprof format.
19/170
Getting started
ST200
The first item after the target identifier is the name of the dynamic library (.dll or .so)
used to specify the execution model. st200sim indicates the simulator. The remaining
items are referred to as target options and are specific to the target concerned.
There are three ways to specify target options:
include the options on a line defining a distinct target in the targets.cfg file,
list the options in double quotes, along with the dynamic library name, as an argument
to the st200run dll option (see Table 1 on page 14),
list the options in a textual configuration file and specify the filename using a single
CONFIG_FILE option.
The basic simulator options are listed in Table 2, further options are given in Section 3.1 on
page 67. The first two target options are used to control the use of the configuration file
itself.
Table 2.
Option
Description
Default value
CONFIG_FILE
<filename>
DUMP_CONFIG_FILE
<filename>
MODE [FAST|ISS
|REFERENCE|REF]
REFERENCE
EXTERNAL_MEMORY_
SIZE <number>
0x800000 for
ST220
0x4000000 for
ST231
EXTERNAL_MEMORY_
BASE <number>
0x08000000
TRACING_ON <bool>
""
TRACE_START_CYCLE
Cycle on which to start tracing.
<number>
TRACE_END_CYCLE
<number>
20/170
7521642
ST200
Getting started
Table 2.
Option
PROFILING <bool>
Description
When this is set to true the simulator will produce the
following (gprof-style) output files(3):
gmon.out - standard execution profile.
gmon.outDCACHE - time spent in each function waiting
on dcache stalls.
gmon.outICACHE - time spent in each function waiting
on icache stalls.
Default value
false
1.6.2
Board options
Silicon targets are predefined in <tools-dir>/target/targets.cfg, for example,
mb379. By default this is commented out in the targets.cfg file. When a silicon target is
connected, the definition must be uncommented and the IP address must be modified.
The following syntax is used in the targets file:
<target name> <dll name> [dll options ...]
For example:
mb379 st200emu HTI_ID tcp:<IP address>
The first item after the target identifier is the name of the dynamic library (.dll or .so)
used to specify the execution model. st200emu indicates a silicon target. The remaining
items are referred to as target options and are specific to the target concerned.
There are two ways to specify target options:
include the options on a line defining a distinct target in the targets.cfg file,
list the options in double quotes, along with the dynamic library name, as an argument
to the st200run dll option (see --dll in Table 1 on page 14).
7521642
21/170
Getting started
Table 3.
ST200
Silicon target configuration options
Option
22/170
Description
Default value
BOARD <boardname>
BOARD_TXT_FILE
<filename>
BOOTRAM= <address>
CLOCK_D= <num>
CONFIG_FILE
<boarddir>
CPU_RESET_ADDRESS=
<address>
DISABLE_MPOKE
7521642
board.txt
0x0
ST200
Getting started
Table 3.
Description
Default value
DSU_TEST
EMU_SAFE_TRACE
EMU_TRACE
HTI_ID tcp:
<IP_ADDRESS>
HTI_MODE
[st200|tap|st20]
st200
ID2KEY_FILE
<filename>
id2key.txt
NO_CHIP_RESET
NO_TAP_CTRL
This sets the mode where the tap controller is not used
to access taplink.
This option does not have to be used for ST220 cores
with taplink.
7521642
The CLOCK_D
option is used
to specify the
connection
speed.
23/170
Getting started
Table 3.
ST200
Silicon target configuration options (continued)
Option
OS21_OSCALL
24/170
Description
Default value
7521642
ST200
Getting started
Table 3.
Description
Default value
PURE_JTAG(2)
ST231_CUT6(2)
7521642
25/170
Getting started
ST200
Table 3.
Description
Default value
VERBOSITY=n
VIRTUAL_DEBUG
The debugger
accesses the
physical
address space.
Table 4.
PURE_JTAG
JTAG_REMOTE_
X
CLOCK
ST231_CUT6
Note:
JTAG
signal
JTAG
signal
ST20
ARM
CLOCK_D
as index
Remote
clock
CLOCK_D
as divider
N-2
response
X
X
X
X
26/170
7521642
ST200
1.7
Getting started
st200gdb debugger
The st200gdb debugger provided is an ST200 retargeting of the GNU gdb-6.4 standard
debugger which comes with a GUI. This gdb-6.4 is sometimes called Insight-6.4. Insight is
the name chosen by Red Hat for the software made from gdb plus the added GUI. Refer to
the standard GNU gdb documentation for information about the st200gdb features and
commands. Refer to the Insight home page (http://sources.redhat.com/insight) for additional
information about the GUI.
To launch an st200gdb session in the command line interface, type:
<tools-dir>/bin/st200gdb
The basic gdb commands to perform in command line mode in order to execute a program
are:
file <program_name>
target gdi -t <target_alias_name>
load
run
The file command is not required if <program_name> is specified on the st200gdb
launch line.
The target command connects to a target, either a simulator or a board.
The load command can be omitted if the application is already loaded in memory. In this
case, the pc value has to be initialized before running:
set $pc=__text_start
The load command can also be omitted if the application has been burnt in Flash and the
user wants to start the execution from the reset address located in Flash. In this case a
special debugging mode is required before running:
startmode -set reset
The run command starts the execution of the program.
While the target remains connected, it is possible to restart the execution of the program in
RAM, providing that the .data section has been reinitialized, for example by reloading it:
load
run
The ST200 specific features are described in the following sections.
Note:
The st200gdb debugger supports OS21 threads. If you are using the GUI (see Section 1.8
on page 35) the threads are listed in the Processes window.
7521642
27/170
Getting started
1.7.1
ST200
The targets are defined in the targets.cfg file supplied with the standard toolset release.
The location of the target description file is determined in accordance with the strategy
defined in Search strategy for dynamic libraries on page 18.
1.7.2
At the first level, pure st200gdb commands allow access to generic GDI targets.
At the second level, a set of target specific commands are available as soon as the GDI
target has been connected. They are also called the GDI direct access commands.
The available commands are described in Table 5. Additional information is provided in the
online help available within st200gdb using the help st-gdi command.
Note:
All values (for example, address and length) can be an expression using the following
operators:
(, +, -, *, /, ~, &, | or a variable.
Table 5.
Description
st200gdb commands
28/170
gdi
mcumap
mcuname
reset
pmblock
7521642
ST200
Getting started
Table 5.
Description
Simulator commands
gdi bus-trace-off
gdi bus-trace-on
gdi flush
gdi help
gdi profile-off
gdi profile-on
gdi reset-statistics
gdi set-bus-trace-file
gdi set-trace-file
gdi start-statistics
gdi statistics
gdi stop-statistics
gdi trace-off
gdi trace-on
Board commands
gdi
gdi
gdi
gdi
dbreak
dbreak
dbreak
dbreak
7521642
29/170
Getting started
ST200
Table 5.
30/170
Description
gdi fhalt
gdi file_exit
gdi halt
gdi help
gdi
gdi
gdi
gdi
ibreak
ibreak
ibreak
ibreak
gdi if exp
gdi command
gdi ....
[gdi else
gdi command
gdi ...]
gdi endif
7521642
ST200
Getting started
Table 5.
Description
gdi print_verified
gdi reset_taplink
-nochipreset|-chipreset
gdi reset_verified
gdi restart
7521642
31/170
Getting started
ST200
Table 5.
Description
gdi version
gdi
gdi
gdi
gdi
while exp
command
...
endwhile
# any_text
32/170
-start
-stop
-reset
-setevent <counter_number> <event_type>
-setcounter <counter_number> <value>
-setclock <value>
-showcounter <counter_number>
-showclock
-show
-resetidle
7521642
ST200
Getting started
Basic parameters
1.7.3
-start
Starts the event counting. During the following execution, events are
counted.
-stop
Stops the event counting. During the following execution, events are
not counted.
-reset
Resets to zero all the event counters and the clock counter.
-setevent
-setcounter
-setclock
-showcounter
-showclock
-show
Description
startramend
startenv
startbss
startramend
Display or set the startup location of the RAMEND.
Note:
When using a simulator target, any changes made to the RAMEND must be matched by a
change to the configuration option EXTERNAL_MEMORY_SIZE, see Table 7: Target
configuration options on page 67. If the -reset option is used the -ramend option is
ignored.
Usage
startramend -show
-set <memory description>
7521642
33/170
Getting started
ST200
Basic parameters
-show
-set
startenv
Display or set whether host environment variables are passed.
Usage
startenv
-show
-set yes|no
Basic parameters
-show
-set
Changes the setting for whether the host environment variables are
passed to the program (yes or no).
startbss
Display or set the BSS clear variable.
Usage
startbss
-show
-set yes|no
Basic parameters
1.7.4
-show
-set
34/170
7521642
ST200
1.8
Getting started
1.8.1
Select Target Settings... from the File menu. The Selecting an ST2x0 Target window
is displayed, see Figure 3.
The ST2x0 Target list contains the set of execution targets found by the GUI in the
visible targets.cfg files. The targets.cfg files are searched for successively in:
The target file defined by the -mtargetdir option could also be selected from the
GUI using the Browse button.
Note:
The search strategy for the target configuration file is shown in Search strategy for dynamic
libraries on page 18.
Figure 3.
When a target is found more than once, the first definition is used. This allows you to
use overridden definitions for some targets. The origin of the used definition is shown
between parentheses in the list. See Section 1.6: Targets and target options on
page 19 for details.
7521642
35/170
Getting started
Note:
ST200
2.
3.
the program stops on the main breakpoint (unless the Set breakpoint at main
option is deselected in the target selection pane).
If the user runs an application without selecting the target, the Selecting an ST2x0 Target
window is displayed to let the user to choose the target.
Continue the debugging session using the st200gdb commands to which the GUI provides
access. Select Help Topics from the Help menu to access a basic online manual.
Note:
It is possible to enable or disable the printing of the string pointed by an address in the Local
Variables and Watch windows, by selecting the Print the string pointed by an address
box. For example, the address 0xFFFFFFFF cannot be dereferenced as it is out of memory
on ST200 cores. In this case, ensure the box is unchecked.
1.8.2
2.
3.
4.
Type the set args, st200gdb command. For example (on Windows):
set args D:\myhome\mydata.txt 43
Continue the debugging session using the st200gdb commands to which the GUI provides
access.
Note:
36/170
It is also possible to pass arguments to the program using the GUI. Enter the arguments in
the Parameters to the application field as shown in Figure 4.
7521642
ST200
Getting started
Figure 4.
1.8.3
click on the
icon.
7521642
37/170
Getting started
ST200
Figure 5.
The Start button calls the gdi start-statistics command. It starts the statistics
counters for the ST200 processor. By default, the counting is enabled.
The Stop button calls the gdi stop-statistics command. It stops the statistics
counters for the ST200 processor.
The Reset button calls the gdi reset-statistics command. It may typically be used
before executing a sequence of code in order to compute the statistics.
1.8.4
38/170
click on the
icon.
7521642
ST200
Getting started
Figure 6.
Any changes made in the editable fields become effective whenever the Apply button is
pushed. The buttons in the Switches area of the window are active immediately. The Start
button toggles to Stop when the counting of the events is enabled and vice versa.
1.8.5
clicking on the
icon, or
7521642
39/170
Getting started
ST200
Figure 7.
1.8.6
40/170
7521642
ST200
Getting started
Figure 8.
1.8.7
Watch window
Troubleshooting
Unexpected failure during a simulation
During a simulation session, in cases where the operating tool (st200gdb or st200run)
crashed, failed unexpectedly, or was killed by the user, a gdiserv process may remain
executing on the host machine. It is recommended that any remaining process is killed
before attempting to run a new tool session with the simulator.
7521642
41/170
Getting started
ST200
1.9
1.9.1
Initialization sequence
After the program is loaded and before the program execution is started, a few core registers
and software parameters are expected to be initialized. They are passed as parameters of
the __start() entry point function. This configuration is done according to st200run
options or st200gdb commands and is described below.
Note:
In reset mode, these parameters take the value set up by the boot code, regardless of the
tool options.
After the program is started and before the main() function is called, the program executes
the internal real time run-time initialization.
Start parameters
int argc
char **argv
These are the arguments passed to the st200 program from the st200run command
line (st200run [OPTIONS]) or st200gdb commands (set args). The boot code
setup for these parameters is argc=0, argv=0.
char **env
This is the full system environment variable from the host machine, copied into the
ST200 program (st200run -env option, or st200gdb startenv command). The
boot code setup for this parameter is env=0.
char *ramend
This is an absolute address passed to the program, indicating the end of the RAM
(that is, the first non-RAM address) where some internal data and the stack pointer are
to be initialized. The default value is defined in the board.ld linker script dedicated to
the programs target and can be changed by modifying the DEFAULT_RAMEND_VALUE
in this file (recommended). It can be overridden by the user (st200run --ramend
option or st200gdb startramend command).
From this address, the stack grows toward the program text and data normally loaded
in LMI RAM. The boot code setup for this parameter is ramend=0x08800000.
char *noncacheable_start
This option is a boolean indicating to the run-time the way that the system calls
parameters have to be exchanged with the tool able to emulate the system calls.
If noncacheable_start equals 0, the tool emulating the oscall accesses the
parameters wherever they are provided by the run-time, this could be in ST200 internal
registers or data caches. The st200run and st200gdb tools are designed to work in
this mode by default. This is also the mode setup by default by the boot code.
If noncacheable_start does not equal 0, care is taken by the run-time to have all
the system call parameters accessible in external RAM by the tool able to emulate
system calls. Although this mode is not relevant for the st200run tool, the st200run
option --ignore_cache enables this mode to be setup for test purposes.
42/170
7521642
ST200
Getting started
The C run-time initialization sequence is located in the crti.o module linked with the
program.
The C run-time initialization invokes the BSP initialization (calling the three hooks
__init_core(), __init_board() and __init_soc()) before calling main().
the memory protection units and dismissible loads behavior are set to a default value.
The setting for the memory protection unit is by default adjusted to your program needs.
This enables the use of the data cache for all memory access between __text_start and
_ramend, and prevents any dismissible load in the peripheral control register area.
The default initialization sequence is located in the libcore.a, libboard.a and
libsoc.a modules linked with the program, and source code for the initialization sequence
is visible in the following directories:
<tools-dir>/target/core/<st2xy>/src
<tools-dir>/target/board/<board>/src
<tools-dir>/target/soc/<soc>/src
1.9.2
Initialization hook
If, for some reason (for example, peripheral initialization or target environment setup), it is
necessary to change the behavior of the init sequence before main(), the recommended
method is to use the hook mechanism put in place in the startup phase of the run-time.
Two types of hooks are available for the user in the run-time to enable user initialization of
hardware or software before executing the main program.
The bsp_user_start_handle() and bsp_user_end_handle() are invoked from the
libcore.a library in the BSP initialization respectively at the start and the end of the BSP
initialization (see Appendix A: ST200 board support package (BSP) on page 114).
The __init_soc() and __init_board() functions are located in the libsoc.a and
libboard.a libraries respectively.
7521642
43/170
Getting started
1.10
ST200
This level must contain all the settings which are related to a core
and independent of either the SoC in which the core is embedded, or
the board on which the SoC is used.
SoC level
This level is related to all the settings necessary for a given SoC
independent of any board.
Board level
This level covers all the settings needed to configure a given board
independent of the core or the SoC.
To configure the execution of the user program to be specific for the board target, the
run-time must be aware of the sysconf parameters. These parameters are hardware
parameters (such as the core and bus clock frequency) which, together with the handling of
their access, are found in the sysconf.c module.
By default, the sysconf module linked with the application fits the needs of all simulator
targets. This means that for hardware boards, a dedicated sysconf module specific to
each board must override the default sysconf.
It is exactly the same for the boot code. By default, a boot program is linked with the
application, however, it can be overridden with a boot program dedicated to a given target
board, see Section 1.11.
Caution:
A correct run-time configuration is required to get valid results on the time functions such as
clock(), and for benchmarking purposes.
1.10.1
src/sysconf.c
board.ld
board.txt
makefile
44/170
7521642
ST200
Getting started
A template directory within the board directory contains a template for sysconf.c and
boot.S in order to demonstrate where code should be added in order to create a new
target board that will be supported in the toolset.
The sysconf parameters can be accessed directly from a user program. For example:
#include <stdio.h>
#include <machine/sysconf.h>
main()
{
unsigned int fclock,pclock,ramsize,rambase;
fclock = sysconf(_SC_LX_CORE_CLOCK_FREQ);
pclock = sysconf(_SC_LX_PERIPH_CLOCK_FREQ);
ramsize = sysconf(_SC_LX_RAMSIZE);
rambase = sysconf(_SC_LX_RAMBASE);
printf("cpu clock %dMhz periph clock %dMhz ramsize 0x%8.8x
rambase 0x%8.8\n", clock/1000000, pclock/1000000, ramsize,
rambase);
}
1.10.2
7521642
45/170
Getting started
ST200
<tools-dir>/bin/st200cc -o hello \
-EL \
-nostdlib \
-Wl,-L<tools-dir>/target/core/st220/le/bare \
-Wl,-L<tools-dir>/target/soc/default/st220/le/bare \
-Wl,-L<tools-dir>/target/board/mb379_audioenc/st220/le/bare \
-Wl,-L<tools-dir>/lib/st220/le/bare \
<tools-dir>/lib/st220/le/bare/crt1.o \
<tools-dir>/lib/st220/le/bare/crti.o \
<tools-dir>/lib/st220/le/bare/crtbegin.o \
<tools-dir>/target/core/st220/le/bare/bootcore.o \
<tools-dir>/target/soc/default/st220/le/bare/bootsoc.o \
<tools-dir>/target/board/mb379_audioenc/st220/le/bare/bootboard.o \
-I<tools-dir>/target/core/st220 \
-I<tools-dir>/target/soc/default \
-I<tools-dir>/target/board/mb379_audioenc hello.c \
-lcore -lsoc -lboard \
-lc -lgloss -lgcc \
<tools-dir>/lib/st220/le/bare/crtend.o \
<tools-dir>/lib/st220/le/bare/crtn.o \
-T <tools-dir>/target/platform.ld
1.11
1.11.1
Note:
46/170
7521642
ST200
Getting started
Assuming that an ST220 core is on <my_board>, the application can then be built from the
boot code object file with the following command:
<tools-dir>/bin/st200cc -mtargetdir=<new_target_dir> -EL
-mcore=st220 -msoc=default -mboard=my_board -o hello hello.c
For ST200 environments where the reset address is not 0, it is possible to ensure that the
boot section is linked at a new address in the program, using the linker RESET_ADDRESS
variable by modifying board.ld and editing the DEFAULT_RESET_ADDRESS value.
Memory map settings and some run-time settings such as DEFAULT_RAMEND or
DEFAULT_TEXT_BASE can also be modified in board.ld (see Section 4.3: Supported
configurations on page 81).
1.11.2
1.12
7521642
47/170
Getting started
Note:
ST200
The default memory protection unit settings differ between ST220 and ST231 onward. For
ST220, all the address space is accessible for data read or write access in supervisor mode.
For ST231 onward, an explicit mapping is required of any address area unknown to the core
and outside the program RAM usage (from __text_start to _ramend). For example,
before accessing the 0x08900000 device address, use the following C code:
int * device_control = 0x08900000;
#if defined (__ST220__)
/* nothing to do */
#else
#include <machine/mmu.h>
bsp_mmu_memory_map(0x08900000, 0x100,
PROT_SUPERVISOR_WRITE|PROT_SUPERVISOR_READ, 0,
0x08900000);
#endif
*device_control = 0 ;
1.13
for debug purpose to be able to use st200gdb at source level inside the libc.a to
chase a problem inside a libc call,
for reverse engineering purposes, to follow step by step with st200gdb at source level,
the code that is executed from the entry point until the main() call,
for very advanced users that want to improve or implement new run-time features.
There are three kinds of run-time libraries and target modules, each having their own rebuild
methodology.
1.13.1
48/170
7521642
ST200
1.13.2
Getting started
libgprof, libgcc and libst200-instrC compiler libraries for which rebuild is not
relevant (mainly assembly code),
1.13.3
7521642
49/170
ST200
2.1
ST200 plug-in,
Visual Prof.
STWorkbench installation
The instructions for installing STWorkbench, the ST200 Eclipse plug-in and the Visual Prof
plug-in can be found in the HTML introduction pages (index.htm) of the STWorkbench
installation CD.
2.1.1
Documentation
The STWorkbench installation CD includes several documents.
2.2
The STWorkbench User Manual. This is available online, it is accessible from the Help
drop down menu by selecting Help Contents and then STWorkbench Help.
The CDT FAQ is provided in html format in the file cdt_faq.html located in the doc
directory.
ST200 plug-in documentation is available online. It is accessible from the Help drop
down menu by selecting Help Contents and then ST200 Embedded Toolset.
Visual Prof documentation is available online. It is accessible from the Help drop down
menu by selecting Help Contents and then ST Profiling and Coverage.
50/170
7521642
ST200
Workspace Launcher
perspectives,
views,
editors.
A perspective is a group of views and editors in the Workbench window. One or more
perspectives can exist in a single workbench window. Each perspective contains one or
more views and editors. Within a window, each perspective may have a different set of views
but all perspectives share the same set of editors.
A view is a visual component within the workbench. It is typically used to navigate through a
hierarchy of information (such as the resources in the workbench), open an editor, or display
properties for the active editor. Modifications made in a view are saved immediately.
Normally, only one instance of a particular type of view may exist within a Workbench
window.
The title bar of the Workbench window indicates which perspective is active. In Figure 10,
the Resource perspective is in use.
7521642
51/170
ST200
2.2.1
52/170
7521642
ST200
2.2.2
Right-click in the Navigator view and select New | Project. The New Project dialog is
displayed.
2.
3.
4.
5.
Click on Finish.
Because you have just created a C project, the workbench prompts you to switch to the
C/C++ Perspective. Click on Yes.
The hello project is now visible as a folder in the Navigator view.
6.
7.
8.
9.
2.2.3
Click on the drop-down menu of the Debug icon (symbolized by a bug) and select
Debug. The Debug dialog box is displayed.
2.
3.
Click on New.
4.
5.
6.
7.
8.
Click on the Debug button and click on Yes when asked whether to switch to the
Debug perspective.
7521642
53/170
ST200
The Debug perspective (shown in Figure 11) manages debugging or running an application
in the workbench. The execution of the application can be controlled by setting breakpoints,
suspending launched programs, stepping through code and examining the contents of
variables.
The Debug perspective also drives the editor. As an application is stepped through, the
editor highlights the location of the execution pointer.
Figure 11. Debug perspective
54/170
7521642
ST200
2.3
2.3.1
ST200 preferences
ST200 preferences are set in the ST200 Preferences section of the Preferences dialog,
see Figure 12. To display this dialog, select Preferences from the Windows menu.
Figure 12. Preferences dialog - ST200 Preferences
Use the ST200 toolchain root path field to enter or browse for the location of the ST200
toolset.
Selecting the Target description file path sets the default path in which STWorkbench
searches for the targets.cfg target description file. This gives STWorkbench a default
location to propose to the user whenever a new run or debug configuration is created. A
specific location can subsequently be chosen in the run or debug configurations.
Check the Do not use --mtargetdir for st200run/st200gdb check box if the ST200 toolset
does not have the --mtargetdir command switch implemented in the st200run and the
st200gdb tools.
7521642
55/170
2.3.2
ST200
ST Profiler preferences
ST Profiler preferences are set in the ST Profiler preferences section of the Preferences
dialog, see Figure 13. To display this dialog, select Preferences from the Windows menu.
Figure 13. Preferences dialog - ST Profiler preferences
From this section, the user can set the progress bar features.
2.3.3
Note:
When creating a new project, the Next button must be clicked at every step after entering
the project name, otherwise STWorkbench creates a project for the native system instead of
ST200.
The project type must be an ST200 project type, the project types on which the new project
is being created are specified at the last step of the new project creation. The available
project types are ST200 embedded executable, static library and shared library.
Once a project has been created, its source files can be created using the Project button.
To import a tree of source files, select File System. The next stages allow you to select the
file extensions and choose each file in a subdirectory.
2.3.4
Library names
If the project is for an ST200 library, do not use the prefix lib in the project name.
STWorkbench adds a lib prefix to the library filename, also adding a .a suffix in the
traditional POSIX fashion. For example, if the project library name is trig, the output file
created by STWorkbench is libtrig.a.
56/170
7521642
ST200
2.3.5
Project properties
The project properties can be customized and modified in the Properties window. To
display this window, right-click on the project icon in the Navigator view of the Workbench
and select Properties.
Figure 14. Properties window
The C/C++ Build properties are the most important project properties. Different
configurations can be created for Release and Debug.
The Tool Settings tab sets all the switches and commands passed to the ST200 tools,
including:
the compiler,
the assembler,
the linker or the archiver (which appear respectively if the target of the project is an
executable or a library),
the shared options, for consistency, the options passed to the linker are also passed to
every call to the compiler.
The ST200 Shared Options section selects the run-time model (bare mode or OS21) for
the output file to be built.
7521642
57/170
ST200
The Libraries field of the ST200 Linker section is very important. The name of the library to
be linked must be put in the -l space (related to the -l option of the ST200 linker) by entering
only the name of the library in the usual POSIX mode. For example, if the desired library to
be linked in the project is libfoo.a, the name of the library entered in the library name list
should be foo, without the lib prefix, and without the .a extension. Unfortunately
STWorkbench does not handle this well, the file search window does not strip the prefix and
suffix after the file choice. Conversely, the -L switch, which adds a path to the list of paths
searched by the linker for libraries, works as expected, adding the path chosen through the
popup window.
In the Build Settings tab, the name of the output file to be produced can be selected. For
executables, any name and extension can be used. For libraries, the lib prefix is
prepended by STWorkbench whatever name is entered. This is for consistency with the
traditional libmyname.a UNIX naming pattern.
In the Build Step tab, the pre-build and post-build commands can be set.
In the Environment tab, user variables and view system variables can be created, edited
and deleted.
In the Macros tab, user macros and view system macros can be created, edited and
deleted.
2.3.6
2.3.7
Running a program
To run a program, select Run... from the Run button drop down menu. The Run dialog is
displayed (see Figure 15). Use this dialog to create a new ST200 Run C/C++ Local
Application by right clicking the corresponding line in the Configurations area.
Three tabs control the execution of the Run configuration.
Main
Arguments
ST200 Run
When these three tabs have been correctly configured, clicking the Run button starts the
execution of the application. The Console tab can be used to interact with the application.
58/170
7521642
ST200
2.3.8
Analyzing a program
The Visual Prof plug-in can be used to analyze a program. The features of the Visual Prof
plug-in can be accessed by selecting Run... from the Run button drop down menu. The Run
dialog is displayed (see Figure 16).
Figure 16. Run dialog - ST200 Analysis
7521642
59/170
ST200
The ST200 Analysis configuration allows the user to select in which way the application
must be profiled.
There are two possible choices:
Application Analysis
STgcov is a refined test coverage program based on the GNU gcov tool. It
provides profiling results integrated into the Eclipse workbench. STgcov explores
a programs test coverage data to provide performance statistics for software
developers.
OS Analysis
Note:
OS21Profiler analysis shows the time a program spent executing each function,
task and interrupt level.
STgprof and OS21Profiler analysis are mutually exclusive. These analysis cannot be
performed together.
To enable the analysis process we have to provide at least one gmon file.
A gmon file is the result of a previously profiled application. To be profiled, an application
must be compiled with the -pg switch and, if the debug information is also required, the -g
switch must also be used.
The result of this stage is a directory located under the analysis directory with the
following template: yy_mm_dd__xxhxxmxxsxxx.
This directory contains the text document AnalysisInfo.txt, and a series of fxml files
which are representations of the flat profile, the function call graph, the function
statistics and so on.
An example of a flat profile diagram is shown in Figure 17.
60/170
7521642
ST200
7521642
61/170
ST200
For more detailed information, please, refer to the online Visual Prof documentation.
62/170
7521642
ST200
2.3.9
At this point, it is not necessary to explicitly set a gmon file, but the user can set a Source
Lookup Path.
The profiling process is the same as the one described in Section 2.3.8 on page 59.
7521642
63/170
2.3.10
ST200
Debugging a program
To debug a program, select Debug... from the Debug button drop down menu. The Debug
dialog is displayed (see Figure 20). Use this dialog to create a new ST200 Debug C/C++
Local Application by right clicking the corresponding line in the Configurations area.
Figure 20. Debug dialog
Arguments
Source
Debugger
Common
When these tabs have been correctly configured, click on the Run button to start debugging
the application. The Console view can be used to interact with the application. If the Debug
perspective is not already set, a message is displayed asking whether it should be used.
Click on Yes to continue.
It is important to choose a target alias coherent with the application to be debugged.
Figure 21 displays the STWorkbench GUI in a debug perspective.
64/170
7521642
ST200
During debugging, the tabs in the Window | Show view subpanel contain the following
information:
Breakpoints
Console
Expressions
Disassembly
Error log
Memory
ST200 Statistics
ST Profile
STWorkbench
Variables
7521642
65/170
2.3.11
ST200
Debugging tips
During a debugging session, the user might want to view the Performance Monitor window
or the Statistics window.
Each of these windows is supported by the GDB console that is accessible through the
Debugger Process item of the ST200 GDB Debugger session, as shown in Figure 22 by
the red ellipse.
There is another type of console, the applications output, that is accessible through the item
inside the blue ellipse.
The user can choose to view one of the mentioned consoles by clicking the Pin console
button, as shown in the green ellipse.
Figure 22. Debugging tips
66/170
7521642
ST200
ST200 simulator
ST200 simulator
3.1
Table 7.
Option
CONFIG_FILE
<filename>
Description
Default value
DUMP_CONFIG_FILE
Dump all user definable options to the specified file.
<filename>
MODE [FAST|ISS
|REFERENCE|REF]
The operation mode, the options are FAST, ISS and REFERENCE (or
REF). See Section 1.5 on page 13.
REFERENCE
ICACHE_MODEL
<string>
See Table 8 on
page 71
DCACHE_MODEL
<string>
CORE_MHZ
<number>
400
133
7521642
67/170
ST200 simulator
Table 7.
ST200
Option
Description
Default value
MEMSYSTEM_
Internal latency of memory subsystem (in processor cycles).
LATENCY <number>
BUS_LATENCY
<number>
40
PERIPHERAL_
Memory latency for peripheral register accesses (in bus cycles).
LATENCY <number>
15
BUS_BYTES_PER_
CYCLE <number>
8 bytes
TRANSACTION_
SETUP_CYCLES
<number>
BUS_BYTES_PER_
TRANSACTION
<number>
32
0x800000 for
ST220
0x4000000 for
ST231
EXTERNAL_MEMORY_
Byte address of the base of external memory.(1)
BASE <number>
0x8000000
0x0
0x0
NONCACHEABLE_
MEM_SIZE
<number> (2)
The size (in bytes) of noncacheable memory. Buffers associated with a 0x4000
number of I/O related system calls are copied into this area.
(16 Kbytes)
KERNEL_STACK_
SIZE <number> (2)
BOOT_FROM_RESET
<bool> (2)
68/170
7521642
0x4000
(16 Kbytes)
ST200
ST200 simulator
Table 7.
Option
Description
Default value
(2)
RESET_ADDRESS
<number> (2)
RESET_DELAY_
CYCLES <number>
512
BOOT_ROM_BASE
<number>
0x0
BOOT_ROM_SIZE
<number>
0x10000
(64 Kbytes)
PERIPHERAL_BASE
<number>
0x1F000000
TRACING_ON
<bool>
false
OUTPUT_TRACE_
FILE
<"filename">
This item only takes effect when TRACING_ON is set to true. Its effect
is to output the trace to the specified filename. If the string is empty or ""
the file cannot be opened, the trace is output to stdout.
TRACE_START_
CYCLE <number>
TRACE_END_CYCLE
<number>
BUS_TRAFFIC_
TRACING_ON
<bool>
false
BUS_TRAFFIC_
OUTPUT_TRACE_
FILE
<"filename">
BUS_TRAFFIC_
TRACE_START_
CYCLE <number>
BUS_TRAFFIC_
TRACE_END_CYCLE
<number>
BOOT_RTL <bool>
7521642
69/170
ST200 simulator
Table 7.
ST200
Option
OUTPUT_LOG_FILE
<"filename">
Description
Default value
true
BUNDLE_CHECKING_ Setting this item to true prints an error message to the screen when
RE_ON <bool>
the simulators bundle-checking mode detects an illegal bundle.
false
PROFILING <bool>
PROFILING_
OUTPUT_FILE
"filename"
DEVICE_PLUGIN_
MODULES
<"filename">
[;"filename"]
DSU_DEFAULT_
MODULE_ENABLED
<bool>
70/170
7521642
false
ST200
ST200 simulator
Table 7.
Option
Description
DSU_ROM_IMAGE
<"filename">
Default value
Allows the user to specify their own debug support code module, thus
""
overriding the default one.
STIMULATION_FILE
Path of pin stimulation data file.
<"filename">
""
EXTERNAL_MEMORY_ If set, this option initializes the whole of memory to the 4 byte pattern
PATTERN <number> specified.
0xBADDBABE
CLEAR_MEMORY
<bool>
true
1. EXTERNAL_MEMORY_SIZE and EXTERNAL_MEMORY_BASE can be used to model additional blocks of memory if desired.
2. Note that the st200run and st200gdb tools are insensitive to these options. These options are only meaningful for
cosimulation environments.
3. The gmon format employs 16-bit numbers to represent time intervals. As this gives insufficient dynamic range for typical
simulations, time values have had to be scaled. In consequence, the column headers produced by gprof (specifying the
underlying unit of time) are incorrect. It is recommended that analysis of execution profiles is restricted to consideration of
relative times.
See the gprof documentation for information on the interpretation of the output files.
Table 8 shows the default values for the architecture dependent options.
Table 8.
Target option
MODE FAST
MODE ISS
MODE REFERENCE/REF
ICACHE_MODEL
(see Note)
ICACHE_MODEL_BASIC
ICACHE_MODEL_DETAILED
DCACHE_MODEL
(see Note)
DCACHE_MODEL_BASIC
DCACHE_MODEL_DETAILED
Note:
The FAST mode of simulation does not model the caches but accesses the memory directly.
Nevertheless, if the configuration is dumped to file, the cache model options correspond to
those used in reference mode.
3.2
DevInitialise
DEVICE_API void DevInitialise(
void *pinout,
void *pinoutStruct,
char *args)
This function is called at startup to allow the plug-in to initialize any state it holds. The
CPinout reference (pinout) should be stored so that the other API functions can use it
later. See Section 3.2.1: Callbacks into the simulator for an explanation of the parameters.
7521642
71/170
ST200 simulator
ST200
DevTerminate
DEVICE_API void DevTerminate()
This function is called at shutdown so that the plug-in can release any resources held.
DevClock
DEVICE_API void DevClock()
This function is called once per core clock cycle to allow the plug-in to account for time.
DevRead
DEVICE_API
unsigned
unsigned
unsigned
bool DevRead(
char *to,
int address,
int numBytes)
This function is called whenever a read is requested on the STBus. The plug-in returns
true if a read at the given address is handled. It returns false if it does not map the
address. If the plug-in decides to handle the request, it completes the to array with
numBytes of data. The data should be written in the endianness of the ST200 being
modelled.
DevWrite
DEVICE_API bool DevWrite(
const unsigned char *from,
unsigned int address,
unsigned int numBytes,
const char* byteEnables)
This function is called whenever a write is requested on the STBus. The plug-in returns
true if a write at the given address is handled. It returns false if it does not map the
address. If the plug-in handles the request, it reads numBytes of data from the from array
and deals with it appropriately. If byteEnables is not NULL, then it specifies which of the
numBytes are valid. The data is given in the endianness of the ST200 being modelled.
3.2.1
72/170
7521642
ST200
3.2.2
ST200 simulator
Note:
Note:
The Windows version requires the Microsoft development environment for Windows.
On Solaris:
On Linux:
The Solaris and Linux versions require the GNU development environment for the host
platform.
LE should be substituted with BE to build a big-endian version. The .dll (or .so) is created
in the ReleaseLE directory.
In order to tell the simulator to use a specific device plug-in, specify a configuration item to
the simulator in the usual way (either on the command line or in a configuration file). The
ST231-EVAL board (mb424) plug-in sources provided with the toolset (see Section 3.3), can
be used as a starting point to customize the sample plug-in.
3.3
3.3.1
7521642
73/170
ST200 simulator
ST200
The same executable can be run on the simulation target mb424_sim_EXT (which uses the
ST231-EVAL board simulation plug-in), contained in the targets.cfg file, where:
EXT is chosen according to the host platform (see the comments in the targets.cfg
file),
the path containing the simulator plug-in is customized by the user according to the
<tools-dir> location in which the ST200 toolset has been installed.
74/170
7521642
ST200
Setting up a board
Setting up a board
4.1
4.2
4.2.1
Toolset partitioning
The toolset contains three distinct levels of target system partition; core, SoC and board
(board is the most commonly used level). The partition information is target dependent and
is located in the directory <tools-dir>/target.
Core level
This level is almost empty as it is provided for future use. Boot contributions and
__init_core routines are the most relevant. It is not possible to add a supplementary core
description at core level (however it is possible for board and SoC).
The core level information is located in the directory <tools-dir>/target/core.
SoC level
This level is almost empty as it is provided for future use. Boot contribution and
__init_soc routines are the most relevant.
The SoC level information is located in the directory <tools-dir>/target/soc.
7521642
75/170
Setting up a board
ST200
Board level
This level contains information specific to a given board, such as:
the initialization to be performed at the board level (for example, clock generator
settings or board memory initialization),
4.2.2
Toolset configuration
There are three options to control the executable generation and execution:
When one of the options is not defined, the default value is used.
The configuration data related to the target configuration is located in the <tools-dir>/
target directory.
Table 9 lists the parameters managed by the toolset and how they interact with each other.
Table 9.
76/170
Set-up by
Used by
Compiler driver
C Preprocessor
Compiler driver
C Preprocessor
Compiler driver
C Preprocessor
Macros
Compiler driver
C Preprocessor
crt1.o
Compiler driver
Linker
crti.o
Compiler driver
Linker
crtn.o
Compiler driver
Linker
crtbegin.o
Compiler driver
Linker
crtend.o
Compiler driver
Linker
Compiler driver
Linker
Compiler driver
Linker
Compiler driver
Linker
Compiler driver
Linker
Compiler driver
Linker
Compiler driver
Linker
7521642
ST200
Setting up a board
Table 9.
Set-up by
Used by
DEFAULT_RESET_ADDRESS
linker script
Linker
DEFAULT_BOOT_ADDRESS
linker script
Linker
DEFAULT_TEXT_BASE
linker script
Linker/loader
DEFAULT_RAMEND
linker script
Linker/loader
RESET_ADDRESS
linker script
Linker/Run-time
BOOT_ADDRESS
linker script
Linker/Run-time
TEXT_BASE
linker script
Linker/Run-time
cpuclock
Run-time/simulator
Run-time
busclock
Run-time/simulator
Run-time
RESET_ADDRESS
Linker
BOOT_ADDRESS
Linker
TEXT_BASE
Linker
bootcore.o
Compiler driver
Linker
bootsoc.o
Compiler driver
Linker
bootboard.o
Compiler driver
Linker
linker script
Linker/Loader
board.txt
Loader
The following sections describe the toolset target dependent settings and how and where to
configure them.
In the tables provided, <endianness> is either le or be, <run-time> is either bare or
os21 and <my_core> is the core name.
Core contribution
The core contribution is controlled with the -mcore=<my_core> option. Only cores
delivered in the toolset can be referenced using the -mcore option.
Table 10.
Core contribution
Item
Value
Parameter location
-I<tools-dir>/target/
core/<my_core>
Macros
-D__<my_core>__
-D__<MY_CORE>__
crt1.o
crt1.o
<tools-dir>/lib/<my_core>/
<endianness>/<run-time>/crt1.o
crti.o
crti.o
<tools-dir>/lib/<my_core>/
<endianness>/<run-time>/crti.o
7521642
77/170
Setting up a board
ST200
Table 10.
Item
Value
Parameter location
crtn.o
crtn.o
<tools-dir>/lib/<my_core>/
<endianness>/<run-time>/crtn.o
crtbegin.o
crtbegin.o
<tools-dir>/lib/<my_core>/
<endianness>/<run-time>/crtbegin.o
crtend.o
crtend.o
<tools-dir>/lib/<my_core>/
<endianness>/<run-time>/crtend.o
-L<tools-dir>/lib/
Core library search <my_core>/
path
<endianness>/
<run-time>
Core initialization
library
-lcore
(libcore.a)
<tools-dir>/target/core/<my_core>/
<endianness>/<run-time>
<tools-dir>/target/core/<my_core>/
<endianness>/<run-time>/bootcore.o
bootcore.o
Core initialization
__init_core routine
<tools-dir>/target/core/<my_core>/
<endianness>/<run-time>/libcore.a
SoC contribution
The SoC contribution is controlled with the -msoc=<my_soc> option.
Table 11.
SoC contribution
Item
Value
-I<tools-dir>/target/
soc/<my_soc>
-L<tools-dir>/target/
soc/<my_soc>/
<my_core>/
<endianness>/
<run-time>
SoC initialization
library
-lsoc
(libsoc.a)
<tools-dir>/target/soc/<my_soc>/
<my_core>/<endianness>/<run-time>
<tools-dir>/target/soc/<my_soc>/
<my_core>/<endianness>/<run-time>/
bootsoc.o
bootsoc.o
SoC initialization
78/170
Parameter location
__init_soc routine
7521642
<tools-dir>/target/soc/<my_soc>/
<my_core>/<endianness>/<run-time>/
libsoc.a
ST200
Setting up a board
Board contribution
The board contribution is controlled with the -mboard=<my_board> option.
Table 12.
Board contribution
Item
Value
-I<tools-dir>/target/
board/<my_board>
Board library
search path
-L<tools-dir>/target/
board/<my_board>/
<my_core>/
<endianness>/
<run-time>/
Board initialization
library
-lboard
(libboard.a)
Parameter location
<tools-dir>/target/board/
<my_board>/<my_core>/<endianness>/
<run-time>
<tools-dir>/target/board/
<my_board>/<my_core>/<endianness>/
<run-time>/bootboard.o
bootboard.o
Board initialization
__init_board routine
<tools-dir>/target/board/
<my_board>/<my_core>/<endianness>/
<run-time>/libboard.a
Hardware memory
map
<tools-dir>/target/board/
<my_board>/board.ld
DEFAULT_RESET_
ADDRESS
Definition is mandatory
<tools-dir>/target/board/
<my_board>/board.ld
DEFAULT_BOOT_
ADDRESS
Definition is mandatory
<tools-dir>/target/board/
<my_board>/board.ld
DEFAULT_TEXT_
BASE
Definition is mandatory
<tools-dir>/target/board/
<my_board>/board.ld
DEFAULT_RAMEND
Definition is mandatory
<tools-dir>/target/board/
<my_board>/board.ld
cpuclock
400 MHz
busclock
133 MHz
.bootreset section
address
DEFAULT_RESET_ADDRESS
<tools-dir>/target/board/
<my_board>/board.ld
.boot section
DEFAULT_BOOT_ADDRESS
<tools-dir>/target/board/
<my_board>/board.ld
Program sections
address
(.text, .rodata,
.data, .bss)
DEFAULT_TEXT_BASE
<tools-dir>/target/board/
<my_board>/board.ld
Early hardware
initialization
board.txt
<tools-dir>/target/board/
<my_board>/board.txt
7521642
79/170
Setting up a board
4.2.3
ST200
Configuration matrix
Table 13 summarizes the interaction between -mcore, -msoc, -mboard option and the
different level of contribution in the <tools-dir>/target directory.
Table 13.
Configuration matrix
Item
Default
-mcore
-msoc
-mboard
N/A
N/A
N/A
Macros
ST220
Compiler driver
crt1.o
ST220
Compiler driver
crti.o
ST220
Compiler driver
crtn.o
ST220
Compiler driver
crtbegin.o
ST220
Compiler driver
crtend.o
ST220
Compiler driver
N/A
libcore.a
N/A
Compiler driver
N/A
libsoc.a
N/A
Compiler driver
N/A
libboard.a
N/A
Compiler driver
DEFAULT_RESET_
ADDRESS
N/A
board.ld
DEFAULT_BOOT_
ADDRESS
N/A
board.ld
DEFAULT_TEXT_BASE
N/A
board.ld
DEFAULT_RAMEND
N/A
board.ld
RESET_ADDRESS
N/A
platform.ld
BOOT_ADDRESS
N/A
platform.ld
TEXT_BASE
N/A
platform.ld
cpuclock
400 MHz
bootboard.o (or
simulator parameter)
busclock
133 MHz
bootboard.o (or
simulator parameter)
N/A
board.ld
N/A
board.ld
Start at
0x08000000
board.ld
bootcore.o
N/A
80/170
Location
Compiler driver
Compiler driver
X
Compiler driver
bootcore.o
7521642
ST200
Table 13.
Setting up a board
Configuration matrix (continued)
Item
Default
-mcore
-msoc
-mboard
Location
bootsoc.o
N/A
bootboard.o
N/A
bootboard.o
FLASH
(0x00000000 to
0x00010000)
RAM (0x08000000
to 0x0A000000)
board.ld
N/A
board.txt
4.3
Supported configurations
4.3.1
bootsoc.o
Table 14 and Table 15 show the supported configurations for the ST220 and ST231 cores
respectively. In the tables, <endianness> is either le or be and <run-time> is either
bare or os21.
Table 14.
Item
Value
Parameter location
-I<tools-dir>/target/
core/st220
Macros
-D__st220__
-D__ST220__
crt1.o
crt1.o
<tools-dir>/lib/st220/
<endianness>/<run-time>
crti.o
crti.o
<tools-dir>/lib/st220/
<endianness>/<run-time>
crtn.o
crtn.o
<tools-dir>/lib/st220/
<endianness>/<run-time>
crtbegin.o
crtbegin.o
<tools-dir>/lib/st220/
<endianness>/<run-time>
crtend.o
crtend.o
<tools-dir>/lib/st220/
<endianness>/<run-time>
-L<tools-dir>/lib/
st220/<endianness>/
<run-time>
Core initialization
library
-lcore
(libcore.a)
<tools-dir>/target/core/st220/
<endianness>/<run-time>
<tools-dir>/target/core/st220/
<endianness>/<run-time>/bootcore.o
bootcore.o
Core initialization
__init_core routine
7521642
<tools-dir>/target/core/st220/
<endianness>/<run-time>/libcore.a
81/170
Setting up a board
ST200
Table 15.
Item
Value
-I<tools-dir>/target/
core/st231
Macros
-D__st231__
-D__ST231__
crt1.o
crt1.o
<tools-dir>/lib/st231/
<endianness>/<run-time>
crti.o
crti.o
<tools-dir>/lib/st231/
<endianness>/<run-time>
crtn.o
crtn.o
<tools-dir>/lib/st231/
<endianness>/<run-time>
crtbegin.o
crtbegin.o
<tools-dir>/lib/st231/
<endianness>/<run-time>
crtend.o
crtend.o
<tools-dir>/lib/st231/
<endianness>/<run-time>
-L<tools-dir>/lib/
st231/<endianness>/
<run-time>
Core initialization
library
-lcore
(libcore.a)
<tools-dir>/target/core/st231/
<endianness>/<run-time>
<tools-dir>/target/core/st231/
<endianness>/<run-time>/bootcore.o
bootcore.o
Core initialization
4.3.2
Parameter location
__init_core routine
<tools-dir>/target/core/st231/
<endianness>/<run-time>/libcore.a
SoC
Since SoC level contribution to toolset configuration is almost empty, only the STm8000
supported configuration is presented as an example.
In Table 16, <endianness> is either le or be, <run-time> is either bare or os21 and
<my_core> is the core name.
Table 16.
Item
82/170
Value
-I<tools-dir>/target/
soc/stm8000
-L<tools-dir>/target/
stm8000/<my_core>/
<endianness>/
<run-time>
SoC initialization
library
-lsoc
(libsoc.a)
Parameter location
<tools-dir>/target/stm8000/
<my_core>/<endianness>/<run-time>/
libsoc.a
7521642
ST200
Setting up a board
Table 16.
Item
Value
<tools-dir>/target/stm8000/
<my_core>/<endianness>/<run-time>/
bootsoc.o
bootsoc.o
SoC initialization
4.3.3
Parameter location
__init_soc routine
<tools-dir>/target/stm8000/
<my_core>/<endianness>/<run-time>/
libsoc.a
Item
Include search path
Value
Parameter location
-I<tools-dir>/target/
board/mb428_host
-L<tools-dir>/target/
Board library search
mb428_host/st231/le/
path
<run-time>
Board initialization
library
-lboard
(libboard.a)
<tools-dir>/target/mb428_host/
st231/le/<run-time>
<tools-dir>/target/mb428_host/
st231/le/<run-time>
bootboard.o
Board initialization
__init_board routine
<tools-dir>/target/mb428_host/
st231/le/<run-time>/libboard.a
Hardware memory
map
<tools-dir>/target/mb428_host/
board.ld
DEFAULT_RESET_
ADDRESS
Definition is mandatory
<tools-dir>/target/mb428_host/
board.ld
DEFAULT_BOOT_
ADDRESS
Definition is mandatory
<tools-dir>/target/mb428_host/
board.ld
DEFAULT_TEXT_
BASE
Definition is mandatory
<tools-dir>/target/mb428_host/
board.ld
DEFAULT_RAMEND
Definition is mandatory
<tools-dir>/target/mb428_host/
board.ld
cpuclock
400 MHz
busclock
170 MHz
.bootreset section
address
DEFAULT_RESET_ADDRESS
<tools-dir>/target/mb428_host/
board.ld
.boot section
DEFAULT_BOOT_ADDRESS
<tools-dir>/target/mb428_host/
board.ld
7521642
83/170
Setting up a board
ST200
Table 17.
Item
4.4
Value
Parameter location
Program sections
address
DEFAULT_TEXT_BASE
(.text, .rodata, .data,
.bss)
<tools-dir>/target/mb428_host/
board.ld
Early hardware
initialization
<tools-dir>/target/mb428_host/
board.txt
board.txt
4.4.1
Create the directory my_board to contain the target settings. For example:
cd my_target
mkdir my_board
2.
Copy the target information from the template directory, preserving the symbolic
links:
cp -a <tools-dir>/target/board/template/* my_board
3.
In the my_board directory, amend the files to specify the board you are setting up.
a)
b)
The following files are necessary for the first phase of the board bring up.
-
The following files are necessary in the second phase of the bring up, that is, when
running any C program.
-
84/170
7521642
ST200
Setting up a board
-
src/boot.S specifies the application needs. This file holds two sections:
.boot_reset and .boot.
The .boot section code is mapped to the boot address. The usage of the
.boot section is application dependent but its primary destination is the flash
memory on the board. It may be set once in order to start any C code
program already loaded in RAM. The default boot.S (<tools-dir>/
target/board/template/src/boot.S) shows how to setup the start
parameters before jumping to the C program. It can be updated with board
specific initialization like RAM access setup.
These two files can be compiled using the makefile provided in the directory.
4.4.2
A template for the critical test suite is delivered in the toolset as well as the shell script
instantiating it.
In order to generate the test suite you need to know:
The --help option can be used to view detailed help information. For example:
> gentestsuite --help
This script is a bournshell script generating critical testsuite for
ST2XX core from a template file
Usage:
-----gentestsuite --periph=<periph base addr> --ram=<ram base addr>
--src=<template file> --dest=<destination file>
7521642
85/170
Setting up a board
ST200
Parameter description:
---------------------- periph: 2 MSB of peripheral base address (0x1f000000 then
periph_base = 0x1f00 )
- ram: 2 MSB of RAM base address (0x80000000 then ram_base = 0x8000
)
Once this test suite has been generated, modify testcst.gdb so that the expected test
suite version of test 1 (CTS1, gdi dpeek 0) reads the expected core version number
(0x02020202 for ST220).
The critical test suite for my_board is now ready to be executed.
4.5
4.5.1
Initialization sequence
Several default actions are carried out by the silicon back-end component when connecting
to the silicon target. Table 18 shows these default actions together with the options that can
be used to disable them.
Table 18.
Initialization actions
Executed operation
4.5.2
None
None
DSU_TEST
DSU_TEST
DSU_TEST, DISABLE_MPOKE
4.5.3
Debug facilities
In the targets.cfg file, add EMU_SAFE_TRACE to the option string of the alias defined for
my_board.
This ensures that all commands and answers sent from the host machine to ST Micro
Connect are stored in a log file, emutrace.log, where st200gdb has been launched.
86/170
7521642
ST200
4.6
Setting up a board
Bring up operations
This section describes the procedure leading up to the execution of a simple C program.
4.6.1
2.
The beginning of the debug area in the board.ld file for this target.
3.
The beginning of the ram or RAM area (only ram or RAM, not ramemi) in the
board.ld file for this target.
The recommended way to manage the BOOTRAM information for a target board is to ensure
that a ram area name is present in the board.ld file and to not use the BOOTRAM option
on the target description line. This area can then be used at connection time for temporary
needs and can be safely reused to load and execute the program.
4.6.2
7521642
87/170
Setting up a board
4.6.3
ST200
4.6.4
4.6.5
88/170
7521642
ST200
4.6.6
Setting up a board
7521642
89/170
ST200
5.1
Note:
rl_lib can be used as an alternative to the standard ELF System V Dynamic Loader
(libdl.so) for applications that do not rely on advanced OS features such as file systems,
virtual memory management, and multi process segment sharing.
5.1.1
Run-time models
Run-time model
90/170
Description
R_Absolute
R_Relocatable
Relocatable run-time model. The application has a main module and several
load modules. The main module is statically linked and loaded as for an
R_Absolute application. The load modules are loaded on demand (by
explicit calls to the loader) at run-time. The load modules are loaded at an
arbitrary address and dynamic symbol binding is applied by the loader for
symbols undefined in the load modules. The dynamic symbol binding
traverses the modules, bottom up in the hierarchy of loaded modules. See
Section 5.2 on page 91 for details.
R_PIC
System V run-time model. The application has a main module and several
load modules. The main module is typically statically linked but may have
references to symbols in the load modules. The main module is loaded with
support from the dynamic loader that also loads load modules and binds
symbols before the application starts. At run-time, the application may also
load other modules on demand. The dynamic symbol binding traverses the
load modules in an order which is defined by the static link order and the
run-time loading order. In addition to dynamic loading and linking, the load
modules segments can be shared between several applications in a
multi-process environment. This model usually relies on file system support
and virtual memory management.
7521642
ST200
Supported features
5.2
R_Absolute
R_Relocatable
R_PIC
Application partitioning
1 single program
1 main program +
N load modules
1 main program +
N load modules
Yes
Yes
Yes
Dynamic loading
No
Startup time: No
Run-time: Yes
Dynamic symbol
binding
No
Main program: No
Load modules: Yes
Explicit module
dependencies
N/A
No
Yes
Symbol preemption
N/A
No
Yes
Segment sharing
(across processes)
N/A
No
Yes
Performance impact
N/A
Minimal
Yes
N/A
Minimal
Yes
Application writer
impact
N/A
No change by default
N/A
Compiler options
Load modules build
Compiler options
Load modules build
several load modules that can be loaded at run-time and unloaded after use,
a loaded module, as for the main module, can load and unload other load modules,
access to symbols in loaded modules from the loader through a call to the loader
library,
dynamic symbol binding is performed by the loader when loading a module and
symbols are searched in the load modules hierarchy bottom-up (to the main module),
sharing of code and data objects between modules is achieved by linking to the objects
in a common ancestor,
generally, system support archive library should be linked with the main module.
The example in Figure 23 shows an application that has four load modules A, B, C and D.
7521642
91/170
ST200
*exec_B
malloc
main
printf
malloc
*exec_A
*exec_D
*exec_C
malloc
Module C
printf
malloc
Module D
In Figure 23, curved arrows (from load modules to parent module) represent load time
symbol binding performed while the load module is loaded. Straight arrows (from loader
module to loaded module) represent explicit symbol address resolution performed through
the loader library API.
The following points describe a possible scenario.
92/170
At run-time, the main module loads the module A in to memory through the
rl_load_file() function.
The loader, in the process of loading A into memory, binds the symbol printf
undefined in A to the printf function defined in main.
The main program then retrieves a pointer to the function symbol exec_A in A using
the rl_sym() function.
As for A, the main program loads the module D and references to printf are resolved
to the printf in main. In addition, references to malloc in D are also resolved to the
malloc in main. The main program then retrieves a pointer to exec_D in D using the
rl_sym() function.
The main program then, at some point, invokes the function exec_A.
The undefined reference to printf in B is resolved to the printf in main (the loader
searches first in A, and then in main).
Module A may in turn indirectly call functions or reference data in B and C after
retrieving symbol addresses using the rl_sym() function.
At any time, the main module or the module A may unload one of the loaded modules.
7521642
ST200
5.2.1
5.3
No symbol can be preempted. Dynamic symbol binding always searches the current
module first. This has the effect that a module containing a symbol definition can be
sure that it will use this definition. This allows inlining in load modules for example.
Weak references are treated the same way as undefined references in load modules.
Therefore, when traversing the module tree bottom-up, the first definition seen is taken.
rl_handle_t type
All the functions manipulating a load module use a pointer to the rl_handle_t type. This
is an abstract type for a load module handle.
A load module handle is allocated by the rl_handle_new() function and deallocated by
the rl_handle_delete() function.
The main module handle is statically allocated and initialized in the startup code of the main
module.
A module handle references one loaded module at a time. To load another module from the
same handle, the previous module must first be unloaded.
7521642
93/170
ST200
rl_handle_new
Allocate and initialize a new handle
Definition:
rl_handle_t *rl_handle_new(
const rl_handle_t *parent,
int mode);
Arguments:
parent
mode
Returns:
Description:
The rl_handle_new() function allocates and initializes a new handle that can be
used for loading and unloading a load module.
The handle of the parent module to which the loaded module will be connected is
specified by the parent argument.
The mode argument is reserved for future extensions and must always be 0.
Generally, a load module will be attached to the module using this function, therefore
a handle will typically be allocated as follows:
rl_handle_t *new_handle = rl_handle_new(rl_this(), 0);
rl_handle_delete
Finalize and deallocate a module handle
Definition:
int rl_handle_delete(
rl_handle_t *handle);
Arguments:
handle
Returns:
Description:
94/170
7521642
ST200
rl_this
Return the handle for the current module
Definition:
rl_handle_t *rl_this(void);
Arguments:
None.
Returns:
Description:
The rl_this() function returns the handle for the current module. If called from the
main module, it returns the handle of the main module. If called from a loaded
module, it returns the handle that holds the loaded module.
This function is used when allocating a handle with rl_handle_new(). It can also
be used, for example, to retrieve a symbol in the current module:
void *symbol_ptr = rl_sym(rl_this(), "symbol");
rl_parent
Return the handle for the parent of the current handle
Definition:
rl_handle_t *rl_parent(void);
Arguments:
None.
Returns:
Description:
The rl_parent() function returns the handle for the parent of the current handle
(as returned by rl_this()).
It may be used, for example, to find a symbol in one of the parent modules:
void *symbol_in_parents = rl_sym_rec(rl_parent(), "symbol");
rl_load_addr
Return the memory load address of a loaded module
Definition:
Arguments:
handle
Returns:
Description:
7521642
95/170
ST200
rl_load_size
Return the memory load size of a loaded module
Definition:
Arguments:
handle
Returns:
Description:
The rl_load_size() function returns the memory load size of a loaded module. It
returns 0 if the handle does not hold a loaded module or if the handle passed is the
main program handle.
rl_file_name
Return the filename associated with the loaded module handle
Definition:
Arguments:
handle
Returns:
Description:
The rl_file_name() function returns the filename associated with the loaded
module handle. It returns NULL if no filename is associated with the current loaded
module, if the handle does not hold a loaded module or if the handle passed is the
main program handle.
rl_set_file_name
Specify a filename for the handle
Definition:
int rl_set_file_name(
rl_handle_t *handle,
const char *f_name);
Arguments:
handle
f_name
Returns:
Description:
96/170
7521642
ST200
rl_load_buffer
Load a relocatable module into memory
Definition:
int rl_load_buffer(
rl_handle_t *handle,
const char *image);
Arguments:
handle
image
Returns:
Description:
The rl_load_buffer() function loads a relocatable module into memory from the
image referenced by image.
It allocates the space for the loaded module in the heap, loads the segments from the
memory image of the loadable module, links the module to the parent module of the
handle and relocates and initializes the loaded module.
This function calls the action callback functions for RL_ACTION_LOAD after loading
and before executing any code in the loaded module.
The value 0 is returned if the loading was successful. The value -1 is returned on
failure and the error code returned by rl_errno() is set accordingly.
rl_load_file
Load a relocatable module into memory from a file
Definition:
int rl_load_file(
rl_handle_t *handle,
const char *f_name);
Arguments:
handle
f_name
Returns:
Description:
The rl_load_file() function loads a relocatable module into memory from the file
specified by f_name.
It opens the specified file with an fopen() call, allocates the space for the loaded
module in the heap, loads the segments from the file, links the module to the parent
module of the handle, relocates and initializes the loaded module. The file is closed
with fclose() before returning. This function calls the action callback functions for
the RL_ACTION_LOAD after loading and before executing any code in the loaded
module.
0 is returned if the load was successful, -1 is returned on failure and the error code
returned by rl_errno() is set accordingly.
7521642
97/170
ST200
rl_load_stream
Load a relocatable module into memory from a byte stream
Definition:
Arguments:
handle
stream_func
stream_cookie
Returns:
Description:
98/170
7521642
ST200
rl_unload
Unload a previously loaded relocatable module
Definition:
int rl_unload(
rl_handle_t *handle);
Arguments:
handle
Returns:
Description:
7521642
99/170
ST200
rl_sym
Return a pointer reference to the symbol in the loaded module
Definition:
void *rl_sym(
rl_handle_t *handle,
const char *name);
Arguments:
handle
name
Returns:
Description:
The rl_sym() function returns a pointer reference to the symbol named name in the
loaded module specified by handle. It searches the dynamic symbol table of the
loaded module and returns a pointer to the symbol. The handle parameter can be
the handle of any currently loaded module, or the handle of the main module.
If the symbol is not defined in the loaded module, NULL is returned. It is not generally
an error for this function to return NULL. For example, the user may conditionally call a
specific function only if it is defined in the module.
In this function, as well as in the rl_sym_rec() function, the name parameter must
be the mangled symbol name. For instance, on some targets, C names are mangled
by prefixing the name with an underscore (_). For example, to return a reference to
the printf() function, the symbol name passed to rl_sym() will be _printf.
Also, to access C++ symbols, the fully mangled name must be passed. The C++
mangling scheme is dependent on the processor specific C++ ABI implemented.
100/170
7521642
ST200
rl_sym_rec
Return a pointer reference to the symbol in the loaded module or
one of its ancestors
Definition:
void *rl_sym_rec(
rl_handle_t *handle,
const char *name);
Arguments:
handle
name
Returns:
Description:
The rl_sym_rec() function returns a pointer reference to the symbol named name
in the loaded module specified by handle or one of its ancestors.
This function searches the dynamic symbol table of the loaded module and returns a
pointer to the symbol if found. If the symbol is not found, the function iteratively
searches in the dynamic symbol table of the parent module until the symbol is found.
The handle parameter can be the handle of any currently loaded module, or the
handle of the main module.
If the symbol is not defined in the loaded module or one of its ancestors, NULL is the
returned. It is not generally an error for this function to return NULL.
The name parameter must be the mangled symbol name as for the rl_sym()
function.
7521642
101/170
ST200
rl_foreach_segment
Iterate over all the segments of loaded module and call the
supplied function
Definition:
Arguments:
handle
callback_fn
callback_cookie
The argument to pass to the function.
Returns:
Description:
The rl_foreach_segment() function iterates over all the segments of the loaded
module handle and calls back the user supplied function. For each segment, the
function callback_fn is called with the following parameters.
handle
seg_info
cookie
102/170
7521642
ST200
rl_add_action_callback
Add a user action callback function to the user action callback list
Definition:
typedef
#define
#define
#define
callback_fn
callback_cookie
The argument to pass to the function.
Returns:
Description:
The callback is called just after the module has been loaded in
memory and cache has been synchronized. No module code
has been executed.
RL_ACTION_UNLOAD The callback is called just before the module is unloaded from
memory. No module code will be executed after this point.
RL_ACTION_ALL
7521642
103/170
ST200
The type for the user action callback function is rl_action_func_t. The
parameters passed to the callback function when it is called are:
handle
action
cookie
The callback function returns 0 on success and -1 on failure. In the case of failure, the
loading (or unloading) of the module is undone and the error code returned by
rl_errno() is set to RL_ERR_ACTIONF.
rl_delete_action_callback
Remove the given function from the action callback list
Definition:
int rl_delete_action_callback(
rl_action_func_t *callback_fn);
Arguments:
callback_fn
Returns:
Returns 0 for success, -1 if the callback was not present in the callback list.
Description:
104/170
7521642
ST200
rl_errno
Return the error code for the last failed function
Definition:
int rl_errno(
rl_handle_t *handle);
Arguments:
The handle for the module.
handle
Returns:
Description:
The rl_errno() function returns the error code for the last failed function. Table 21
lists the possible codes.
Table 21.
Error code
Diagnostic
RL_ERR_NONE
RL_ERR_MEM
rl_load_buffer(),
rl_load_file(),
rl_load_stream(),
rl_set_file_name()
RL_ERR_ELF
rl_load_buffer(),
rl_load_file(),
rl_load_stream(),
rl_set_file_name()
RL_ERR_DYN
rl_load_buffer(),
rl_load_file(),
The load module is not a dynamic library.
rl_load_stream(),
rl_set_file_name()
RL_ERR_SEG
rl_load_buffer(),
rl_load_file(),
rl_load_stream(),
rl_set_file_name()
RL_ERR_REL
rl_load_buffer(),
rl_load_file(),
rl_load_stream(),
rl_set_file_name()
RL_ERR_RELSYM
rl_load_buffer(),
rl_load_file(),
rl_load_stream(),
rl_set_file_name()
RL_ERR_SYM
RL_ERR_FOPEN
rl_load_file()
RL_ERR_FREAD
rl_load_file()
7521642
105/170
ST200
Errors returned by rl_errno() (continued)
Error code
Diagnostic
rl_load_stream()
RL_ERR_LINKED
rl_load_file(),
rl_load_buffer(),
rl_load_stream(),
rl_handle_delete()
RL_ERR_NLINKED
rl_unload(), rl_sym(),
rl_sym_rec(),
rl_foreach_segment()
RL_ERR_SEGMENTF
rl_foreach_segment()
RL_ERR_ACTIONF
rl_load_file(),
rl_load_buffer(),
rl_load_stream()
RL_ERR_STREAM
rl_errarg
Return the name of the symbol that could not be resolved
Definition:
Arguments:
handle
Returns:
Description:
106/170
7521642
ST200
rl_errstr
Return a string for an error code
Definition:
Arguments:
handle
Returns:
Description:
The rl_errstr() function returns a readable string for the error code reported by
rl_errno(). For example:
...
void *sym = rl_sym(handle, "symbol");
if (sym == NULL) fprintf(stderr, "failed: %s\n",
rl_errstr(handle));
...
If symbol is not defined in the module referenced by handle then the following
message is displayed:
failed: symbol not found: symbol
7521642
107/170
5.4
ST200
Customization
The relocatable loader library defines a number of functions that it uses internally for
providing services such as heap memory management and file access. These functions
may be overridden by the application in the main module to provide custom implementations
of these functions.
5.4.1
Memory allocation
void *rl_malloc(int size);
void *rl_memalign(int align, int size);
void rl_free(void *ptr);
These functions are used to allocate free space for the load module image and for the
handle objects.
The default behavior for these functions is to call the standard C library functions
malloc(), memalign() and free() respectively.
Note:
5.4.2
File management
void *rl_fopen(const char *f_name, const char *mode);
int rl_fclose(void *file);
int rl_fread(char *buffer, int eltsize, int nelts, void *file);
These functions are used by the rl_load_file() function to open, read and close a file
handle.
The default behavior for these functions is to call the standard C library functions fopen(),
fread() and fclose() respectively.
Note:
All three functions must be overridden and linked with the main program if providing a
custom implementation.
5.5
108/170
7521642
ST200
5.5.1
when the required services are well defined, the list of symbols can be passed to the
st200rltool utility to generate an import script,
when the list of services is not defined but the load modules are available, the load
modules can be passed to st200rltool so that an import script may be generated from
the set of symbols that are required by the load modules.
To generate an import script from a list of symbols specified in the file prog_import.lst
(one symbol per line):
st200rltool -i -s -o prog_import.ld prog_import.lst
To generate an import script from a list of load modules, liba.rl and libb.rl, that may
be loaded by the main module:
st200rltool -i -o prog_import.ld liba.rl libb.rl
When the import script is created, the main module can then be linked using it, for example:
st200cc -o prog.exe --rmain object_files.o prog_import.ld
In addition to import scripts, the st200rltool utility can also generate export scripts that can
be used to reduce the size of the dynamic symbol table in the main module or the load
modules. The export script defines the set of symbols (and only these) that must be
exported to the other modules through the dynamic symbol table. These symbols are then
accessible by the load time symbol binding process and by the calls to rl_sym() and
rl_sym_rec(). The export script is not mandatory as, by default, all global symbols are
exported.
There are two common cases for generating export scripts.
When an import script is required for the module, the export script can be generated at
the same time. This is because the symbols to export are generally those that are
imported,
For a load module that has a well known external interface, the export script can be
generated from a list of symbols to export.
The following example shows how to generate an export script and import script for a list of
modules that is then used when linking the main module. Only the symbols from liba.rl
and libb.rl are imported into the main module and exported by it.
st200rltool -i -e -o prog_import_export.ld liba.rl libb.rl
st200cc -o prog.exe --rmain object_files.o prog_import_export.ld
7521642
109/170
ST200
To generate an export script for a load module with a well defined interface specified in the
file liba_export.lst (one symbol per line):
st200rltool -e -s -o liba_export.ld liba_export.lst
st200cc -o liba.rl --rlib *.o liba_export.ld
5.5.2
Optimization options
When compiling a load module with the -fpic option, some overhead occurs in the
generated code to access functions and data objects. Compiler options and C language
extensions can be used to reduce this overhead.
As relocatable libraries are not subject to symbol preemption, the
-fvisibility=protected option can be used in addition to -fpic when generating
position independent code. This option allows the inlining of global functions. It can be used
as a default option for compiling relocatable libraries:
st200cc -o a.o -fpic -fvisibility=protected a.c
In addition to this option, fine grain visibility can be specified with the
__attribute__((visibility(...)) GNU C extension at the source code level.
For example, if the external interface of a load module is well defined in a header file, the
__attribute__((visibility("protected")) can be attached to each function of
the external interface and on the command line the -fvisibility=hidden option can be
given to specify that all other defined functions are internal to the load module. The main
effect of this combination of options is that references from the same file to global objects
that are not part of the interface will be optimized.
The -mvisibility-decl=<file> option can be used to specify the visibility of each
symbol externally with the given <file>. In the case where the external services required
by a module (default visibility) and the external services provided by the module (protected
visibility) are known, all other functions or data objects can be declared as internal (hidden
visibility). This option can be used to specify these visibility declarations. In this case, only
the functions that are external have an associated overhead. The other internal functions
have a very reduced overhead.
The -ipa option can be used for a full inter procedural optimization of the relocatable
library. In this case, when combined with the declaration of external functions, the library is
generated with a minimal overhead for the dynamic linking support.
For detailed information on the visibility specification, refer to the compiler options
documentation and to the ELF System V Dynamic Linking ABI.
110/170
7521642
ST200
5.6
Debugging support
The debugging of dynamically loaded modules is possible in the same way as for System V
dynamic shared objects. The main module debugging information is loaded at load time of
the application. The load modules debugging information is loaded at load time of the load
modules.
In order to update debugging information, the loader maintains a list of loaded modules
together with their filenames (the file contains the debugging information) and the load
address of the module. Each time a new module is loaded the loader calls a specific
function. The debugger has to set a breakpoint on this specific function and, when the
breakpoint is hit, traverse the list to find new loaded modules and load the debugging
information.
For the ST200 toolset, the debugger implements the required mechanism for the automatic
debugging of loaded modules.
In order to find the file that contains the debug information, the loader must know the path to
the load module. This is automatic in the case of rl_load_file() as the filename is
specified in the interface. For the rl_load_buffer() and rl_load_stream()
functions, the user must set the filename with a call to the rl_set_file_name()
function.
For example, the following code enables automatic debugging of a load module loaded with
rl_load_buffer():
{
int status;
rl_handle_t *handle = rl_handle_new(rl_this(), 0);
if (handle == NULL) { /* error */ }
#ifdef DEBUG_ENABLED
rl_set_filename(handle, "path_to_the_file_for_the_module");
#endif
status = rl_load_buffer(handle, module_image);
if (status == -1) { /* error */ }
...
}
7521642
111/170
5.7
ST200
Profiling support
The action callbacks may be used with a profiling support library, or alternatively, a user
defined package can be informed that a segment has just been loaded or is on the point of
being unloaded by using the user action callback interface.
Below is an example that iterates over the segment list and declares the executable
segments to a profiling support library on the loading/unloading of a module.
static int segment_profile(rl_handle_t *handle, rl_segment_info_t
*info,
void *cookie)
{
rl_action_t action = *((rl_action_t *)cookie);
const char *file_name = handle_file_name(handle);
if (file_name != NULL && (info->seg_flags & RL_SEG_EXEC) {
if (action == RL_ACTION_LOAD) {
/* Call profiling interface for adding a code region. */
profiler_add_region(file_name, info->seg_addr,
info->seg_size);
}
if (action == RL_ACTION_UNLOAD) {
/* Call profiling interface for removing a code region. */
profiler_remove_region(file_name, info->seg_addr,
info->seg_size);
}
}
return 0;
}
static int module_profile(rl_handle_t *handle, rl_action_t action,
void *cookie)
{
rl_foreach_segment(handle, segment_profile, (void *)&action);
return 0;
}
int main()
{
...
if (rl_add_action_callback(RL_ACTION_ALL, module_profile,
NULL)==-1){
fprintf(stderr, "rl_add_Action_callback failed\n");
exit(1);
}
...
status = rl_load_file(handle, file_name);
...
return 0;
}
112/170
7521642
ST200
5.8
5.9
7521642
113/170
Appendix A
A.1
ST200
A.1.1
Backward compatibility
The R4.0 toolset is compatible with the run-time calls and BSP provided in previous
releases, however this compatibility will disappear in the R4.1 toolset. The compatibility
change will be announced in an engineering release between the R4.0 and R4.1 toolsets.
Caution:
Any bare run-time functionality not specified as described in this document will not be
available in the releases following the R4.0 toolset.
User handles
_sys_install_debug_stub() has been renamed bsp_debug_stub().
_sys_user_start_stub() has been renamed bsp_user_start_handle() and now
returns an int value (RESUME || OVERWRITE). See Section A.11: User handles on
page 129.
A.1.2
Error handling
All BSP functions, not directly returning a value, return an error condition that assumes one
of the following values:
BSP_OK
BSP_FAILURE
if an error occurred.
When an error is detected the global variable unsigned int bsp_errno is set to the
appropriate value at the exit of each BSP call. If there are no errors, bsp_errno is set to
BSP_OK, otherwise it is set to the appropriate error code, as given in Table 22.
114/170
7521642
ST200
BSP errors
Error
Description
BSP_OK
No errors.
BSP_FAILURE
BSP_EINVAL
BSP_ECONTEXT
BSP_EINTR
BSP_EBUSY
BSP_EMAPFAIL
BSP_EMFILE
No TLB is available.
BSP_EINTNOTHNDL
BSP_EINTNOTPENDING
A.2
Caches
All variants of the ST200 processor use caches to reduce the time taken for the CPU to
access memory and greatly increase system performance.
The ST200 provides an instruction cache (I-cache) and a data or operand cache (D-cache).
The I-cache is read only, while the D-cache is read/write. Writes are performed using a
write-back method.
There is a risk when using a data cache that it can become incoherent with main memory,
meaning that the contents of the cache conflicts with the contents of main memory. For
example, devices that perform direct memory access (DMA) modify the main memory
without updating the contents of the cache, potentially leaving its contents invalid. For this
reason extra care should be taken when performing DMA.
On the ST200, the I-cache cannot be disabled, however the D-cache can be selectively
disabled for specific regions of memory. It is also possible to flush specific blocks of memory
from either cache. In this way, application software can safely manage the cache.
A.2.1
7521642
115/170
ST200
DMA device. BSP provides the user with the ability to manipulate shared data either
avoiding the cache altogether, or through the cache with software cache coherency support.
This allows users maximum flexibility.
In a similar way, the read-only I-cache can be invalidated in order to safely handle dynamic
code loading.
A.2.2
Description
bsp_cache_invalidate_instruction()
bsp_cache_invalidate_instruction_
all()
bsp_cache_purge_data()
bsp_cache_purge_data_all()
A.3
A.3.1
A.3.2
116/170
7521642
ST200
A.3.3
A.3.4
Description
bsp_dpu_enable()
bsp_dpu_disable()
bsp_ipu_enable()
bsp_ipu_disable()
bsp_dpu_region_get()
bsp_dpu_region_set()
bsp_ipu_region_get()
bsp_ipu_region_set()
Description
dpu_config()
ipu_config()
Table 26.
A.4
Description
protection_list_t
protection_flags_t
Memory management
Some variants of the ST200 processor (ST231 onwards) support a memory management
unit (MMU) and a speculative load control unit (SCU). The MMU provides hardware which
controls the D-cache behavior across address ranges, as well as performing the traditional
role of controlling virtual address translation and protection. The MMU contains a fixed
number of translation look aside buffers (TLBs) which describe and control the virtual
address space on the system.
The SCU controls whether or not speculative (sometimes called dismissible) loads from
physical address ranges are allowed. The SCU contains a fixed number of entries which are
used to enable speculative loads for certain physical address ranges.
7521642
117/170
A.4.1
ST200
Start address
A.4.2
Size
Supervisor /
User priv.
Cacheable
Description
__text_start
8 MBytes
rwx/rwx
Yes
RAM read/write/execute.
0x00000000
8 KBytes
rwx/rwx
No
boot ROM
Peripheral_base
16 KBytes
rw--/----
No
Peripheral registers.
Peripheral_base +
0x4000
8 KBytes
r--x/----
No
DSU ROM
A.4.3
Description
bsp_mmu_reset()
bsp_mmu_memory_map()
bsp_mmu_memory_unmap()
bsp_mmu_dump_TLB_Settings()
All the definitions relating to virtual memory accessible using the OS21 BSP are in the
header file os21/st200/mmap.h, see Table 29. These are explained in the OS21 for
ST200 User Manual.
118/170
7521642
ST200
A.4.4
Description
mmap_create()
mmap_delete()
mmap_disable_speculation()
mmap_enable_speculation()
mmap_pagesize()
mmap_translate_cached()
mmap_translate_physical()
mmap_translate_uncached()
mmap_translate_writecombined()
Description
bsp_scu_read()
bsp_scu_write()
bsp_scu_disable()
Disable a region
bsp_scu_dump_SCU_Settings()
The functions bsp_scu_read() and bsp_scu_write() use a struct to define start and
end addresses.
7521642
119/170
ST200
typedef struct
{
void * start_address;
void * end_address;
} bsp_scu_entry_t;
The two addresses are rounded to be aligned to the smallest TLB page size.
A.5
Timers
The ST200 has three independent timers. Each is capable of running as a free running
auto-reload 32-bit counter, with interrupt on underflow. Each can be programmed to count
some fraction of the input clock. Time is represented in clock ticks, with the bsp_clock_t
type. This is defined to be a signed 64-bit integer.
A.5.1
A.5.2
Tick duration
ST200 BSP establishes the period of one tick when it boots. Based on the input clock
frequency it selects an appropriate divisor to yield a tick which is approximately
1 microseconds.
A.5.3
A.5.4
BSP usage
TIMER_SYSTEM
System timer
TIMER_PROFILER
Profiling timer
TIMER_USER1
User timer 1
TIMER_USER2
The system timer is left free running and is used by bsp_timer_now() to return the
system time. On ST200, the system time (bsp_clock_t) is a 64-bit value. ST200 BSP
maintains the top 32 bits of the 64-bit time via an interrupt handler which is called each time
120/170
7521642
ST200
Description
bsp_timer_start()
bsp_timer_start_all()
bsp_timer_stop()
bsp_timer_divide_set()
bsp_timer_divide_get()
bsp_timer_count_set()
bsp_timer_count_get()
bsp_timer_reload_set()
bsp_timer_reload_get()
bsp_timer_interrupt_enable()
bsp_timer_interrupt_disable()
bsp_timer_interrupt_clear()
7521642
121/170
A.5.5
ST200
Description
bsp_timer_now()
bsp_timer_user()
bsp_timer_ticks_per_sec()
bsp_timer_count_mode()
Table 34.
Description
Number of processor clock ticks
bspclock_t
All the definitions relating to virtual memory accessible using the OS21 BSP are in the
header file os21/ostime.h, see Table 35. These are explained in the OS21 for ST200
User Manual.
Table 35.
122/170
Description
time_after()
time_minus()
time_now()
time_plus()
time_ticks_per_sec()
7521642
ST200
A.6
PM HAL macros
Events
Comment
ST220
ST231
DHIT
DMISS
DMISSCYCLES
PFTISSUED
PFTHITS
WBHITS
IHIT
IMISS
IMISSCYCLES
IBUFINVALID
BUNDLES
Bundles executed.
LDST
TAKENBR
NOTTAKENBR
EXCEPTIONS
INTERRUPTS
Number of interrupts.
BUSREADS
BUSWRITES
OPERATIONS
7521642
123/170
ST200
A.6.1
Comment
ST220
ST231
WBMISSES
NOPBUNDLES
LONGIMMEDIATES
Long immediates.
ITLBMISS
ITLB misses.
DTLBMISS
DTLB misses.
UTLBHITS
ITLBWAITCYCLES
DTLBWAITCYCLES
UTLBARBITRATIONCYCLES
124/170
Description
bsp_pm_reset()
bsp_pm_start()
bsp_pm_stop()
bsp_pm_clock_get()
bsp_pm_clock_set()
bsp_pm_count_mode()
bsp_pm_counter_get()
bsp_pm_counter_set()
bsp_pm_event_get()
bsp_pm_event_set()
7521642
ST200
A.7
Exception handling
Exceptions on the ST200 can occur for the following reasons:
external interrupt,
program error (such as, misaligned access, bad instruction, failed protection check).
A.7.1
Exceptions types
The exceptions that can occur for an ST220 core are given in Table 38 and the exceptions
that can occur for ST231 cores are given in Table 39.
Table 38.
BSP_CORE_STBUS_IC_ERROR
BSP_CORE_STBUS_DC_ERROR
BSP_CORE_EXTERN_INT
BSP_CORE_IBREAK
BSP_CORE_IPU_NO_TRANSLATION
BSP_CORE_IPU_ACCESS_VIOLATION
BSP_CORE_SBREAK
BSP_CORE_ILL_INST
BSP_CORE_DBREAK
BSP_CORE_MISALIGNED_TRAP
BSP_CORE_CREG_NO_MAPPING
BSP_CORE_CREG_ACCESS_VIOLATION
BSP_CORE_DPU_NO_TRANSLATION
BSP_CORE_DPU_ACCESS_VIOLATION
BSP_CORE_SDI_TIMEOUT
7521642
125/170
ST200
BSP_CORE_STBUS_IC_ERROR
BSP_CORE_STBUS_DC_ERROR
BSP_CORE_EXTERN_INT
BSP_CORE_IBREAK
BSP_CORE_ITLB
BSP_CORE_SBREAK
BSP_CORE_ILL_INST
BSP_CORE_SYSCALL
BSP_CORE_DBREAK
BSP_CORE_MISALIGNED_TRAP
BSP_CORE_CREG_NO_MAPPING
BSP_CORE_CREG_ACCESS_VIOLATION
BSP_CORE_DTLB
BSP_CORE_SDI_TIMEOUT
126/170
7521642
ST200
A.7.2
A.8
Description
bsp_core_interrupt_install()
bsp_core_interrupt_lock()
bsp_core_interrupt_unlock()
Interrupts
Interrupts are events external to the CPU that are signaled to it via sampled lines. When an
interrupt occurs, an interrupt handler is executed, interrupting the normal flow of execution of
the CPU. The normal execution flow is resumed after the interrupt handler terminates. This
BSP provides means of interrupt management that is intended to be used solely in absence
of the OS21 real time operating system.
The ST200 cores have 64 lines of external interrupts. A subset of these lines can be masked
(that is, disabled) individually. The first three lines are connected to the three system timers
0, 1 and 2. The remaining 61 lines are connected to system specific subsystems.
The system specific (core, SoC, board) datasheets must be referred to for specific
information about the maskable interrupt lines and other information.
A.8.1
A.8.2
Description
bsp_itc_interrupt_clear()
Clears an interrupt
bsp_itc_interrupt_disable()
Disable an interrupt
bsp_itc_interrupt_enable()
Enable an interrupt
bsp_itc_interrupt_install()
bsp_itc_interrupt_poll()
Polls an interrupt
7521642
127/170
ST200
A.9
Description
bsp_itc_interrupt_raise()
Raises an interrupt
bsp_itc_interrupt_uninstall()
A.10
Description
bsp_ffs_dir()
bsp_ffs_fopen()
bsp_ffs_fclose()
bsp_ffs_fread()
bsp_ffs_showboot()
128/170
7521642
ST200
A.11
User handles
User handles are used to give to the user code the capability to modify the BSP initialization
behavior. These handles are optional and can be omitted if standard behavior is in line with
user expectation.
The available user handles are listed in Table 43.
Table 43.
User handles
User handle
Description
bsp_user_start_handle
bsp_user_end_handle
bsp_user_start_handle
User handle called at the start of the BSP initialization
Definition:
int (* bsp_user_start_handle)(void);
Arguments:
None.
Returns:
RESUME
OVERWRITE
Description:
If this function is defined by the user it is invoked at the start of the BSP initialization.
At this stage, this function is in supervisor mode and nothing of the BSP has been
initialized (no memory management and timer initialization).
Example:
7521642
129/170
ST200
bsp_user_end_handle
User handle called at the end of the BSP initialization
Definition:
void (* bsp_user_end_handle)(void);
Arguments:
None.
Returns:
None.
Description:
If this function is defined by the user it is invoked at the end of the BSP initialization.
At this stage, this function is in the mode requested (the default is supervisor) and the
BSP has been initialized. This function is called before main().
Note: This function is only invoked in the standard flow of BSP initialization, this means that
if bsp_user_start_handle() has been used it returns the RESUME value.
Example:
130/170
7521642
ST200
A.12
bsp_cache_invalidate_instruction
Invalidate addresses within the specified range from the
instruction cache
Definition:
#include <platform.h>
int bsp_cache_invalidate_instruction (
void * base_address,
size_t length);
Arguments:
base_address
length
Returns:
Errors:
None.
Context:
Callable from bare machine run-time and OS21 run-time. In OS21, this function
directly invokes the cache_invalidate_instruction() function provided from
OS21 BSP.
Description:
This function invalidates any valid instruction cache lines that fall within the address
range specified. If it is not possible to flush individual cache lines, then the entire
instruction cache is invalidated.
See also:
bsp_cache_invalidate_instruction_all
bsp_cache_invalidate_instruction_all
Invalidate the entire instruction cache
Definition:
#include <platform.h>
int bsp_cache_invalidate_instruction_all (void);
Arguments:
None.
Returns:
Errors:
None.
Context:
Callable from bare machine run-time and OS21 run-time. In OS21, this function
directly invokes the cache_invalidate_instruction_all() function provided
from OS21 BSP.
Description:
See also:
bsp_cache_invalidate_instruction
7521642
131/170
ST200
bsp_cache_purge_data
Purge addresses within the specified range from the data cache
Definition:
#include <platform.h>
int bsp_cache_purge_data(
void * base_address,
size_t length );
Arguments:
base_address
length
Returns:
Errors:
None.
Context:
Callable from bare machine run-time and OS21 run-time. In OS21, this function
directly invokes the cache_purge_data() function provided from OS21 BSP.
Description:
This function purges any valid data cache lines which fall within the address range
specified. Any dirty cache lines are first written back to memory, and then the cache
lines are invalidated.
See also:
bsp_cache_purge_data_all
bsp_cache_purge_data_all
Purge the entire data cache
Definition:
#include <platform.h>
int bsp_cache_purge_data_all (void);
Arguments:
None.
Returns:
Errors:
None.
Context:
Callable from bare machine run-time and OS21 run-time. In OS21, this function
directly invokes the cache_purge_data_all() function provided from OS21 BSP.
Description:
This function purges any valid data cache lines within the D-cache. Any dirty cache
lines are first written back to memory, and then the cache lines are invalidated.
See also:
bsp_cache_purge_data
132/170
7521642
ST200
bsp_core_interrupt_install
Install an exception handler for a specified exception cause
Definition:
#include <platform.h>
int bsp_core_interrupt_install (
InterruptVector_t* NewExceptionHandler,
InterruptVector_t* OldExceptionHandler,
int ExceptionNumber );
Arguments:
Returns:
NewExceptionHandler
OldExceptionHandler
ExceptionNumber
Errors:
BSP_ECONTEXT
BSP_EINVAL
Context:
Callable only from bare machine run-time. In the OS21 environment, the exceptions
are handled exclusively through the OS21 interface.
Description:
This function installs the exception handler for the exception specified in
ExceptionNumber.
See also:
bsp_core_interrupt_lock, bsp_core_interrupt_unlock
bsp_core_interrupt_lock
Disable external interrupts at core level
Definition:
#include <platform.h>
int bsp_core_interrupt_lock (void);
Arguments:
None.
Returns:
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. In the OS21 environment, the exceptions
are handled exclusively through the OS21 interface.
Description:
See also:
bsp_core_interrupt_install, bsp_core_interrupt_unlock
7521642
133/170
ST200
bsp_core_interrupt_unlock
Enable external interrupts at core level
Definition:
#include <platform.h>
int bsp_core_interrupt_unlock (void);
Arguments:
None.
Returns:
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. In the OS21 environment, the exceptions
are handled exclusively through the OS21 interface.
Description:
See also:
bsp_core_interrupt_install, bsp_core_interrupt_lock
bsp_dpu_disable
Disable the Data Protection Unit
Definition:
#include <platform.h>
int bsp_dpu_disable(void);
Arguments:
None.
Returns:
Errors:
BSP_ECONTEXT
Context:
Description:
See also:
bsp_dpu_enable
134/170
7521642
ST200
bsp_dpu_enable
Enable the Data Protection Unit
Definition:
#include <platform.h>
int bsp_dpu_enable(void);
Arguments:
None
Returns:
Errors:
BSP_ECONTEXT
Context:
Description:
See also:
bsp_dpu_disable
bsp_dpu_region_get
Return the settings for a region
Definition:
#include <platform.h>
int bsp_dpu_region_get(
unsigned int regno,
void **base,
unsigned int *logsize,
unsigned int *mode );
Arguments:
Returns:
regno
base
logsize
log2 of the size of the data region to be protected integer in the range of 12 to 32 (corresponding to
4 Kbytes to 4 Gbytes).
mode
Errors:
BSP_ECONTEXT
BSP_EINVAL
Context:
Callable only from bare machine run-time. OS21 run-time uses dpu_config().
Description:
7521642
135/170
ST200
See also:
Description
Notes
DPU_REGION_ENABLED
Region enabled
DPU_SPECULATIVE_RETURN_ZERO
DPU_REGION_CACHEABLE
Region cacheable
DPU_SUPERVISOR_RDWR
If unset, an access
violation exception is
raised on access
DPU_USER_READ
Implies
DPU_SUPERVISOR_RDWR
DPU_USER_WRITE
Implies DPU_USER_READ
and
DPU_SUPERVISOR_RDWR
bsp_dpu_region_set
bsp_dpu_region_set
Write the settings for a region
Definition:
#include <platform.h>
int bsp_dpu_region_set(
unsigned int regno,
void *base,
unsigned int logsize,
unsigned int mode);
Arguments:
Returns:
regno
base
logsize
log2 of the size of the data region to be protected integer in the range 12 to 32 (corresponding to 4 Kbytes
to 4 Gbytes).
mode
Errors:
Context:
136/170
BSP_ECONTEXT
BSP_EINVAL
Callable only from bare machine run-time. OS21 run-time uses dpu_config().
7521642
ST200
bsp_ffs_dir
List the information available for the modules stored in Flash
Definition:
#include <platform.h>
int bsp_ffs_dir(void);
Arguments:
None.
Returns:
Returns BSP_OK.
Context:
Description:
The bsp_ffs_dir() function lists the information available for the modules stored in
Flash.
bsp_ffs_fclose
Deallocates the Flash file descriptor and closes the associated file
Definition:
#include <platform.h>
int bsp_ffs_fclose(
ffsHndl_t stream);
Arguments:
stream
Returns:
Returns BSP_OK.
Context:
Description:
7521642
137/170
ST200
bsp_ffs_fopen
Open a file and associate a stream with it
Definition:
#include <platform.h>
ffsHndl_t bsp_ffs_fopen(
constant char *f_name,
unsigned int mode);
Arguments:
Returns:
f_name
mode
Returns a Flash file descriptor for the named file or BSP_FAILURE in case of errors.
This descriptor is unique and has to be used in the next calls to bsp_ffs_fread()
and bsp_ffs_fclose().
Errors:
BSP_EINVAL
BSP_FAILURE
Context:
Description:
The bsp_ffs_fopen() function opens the file whose identifier is the string pointed
to by f_name, and associates a stream with it.
138/170
7521642
ST200
bsp_ffs_fread
Accesses rl_lib to read an array from the flash file system.
Definition:
#include <platform.h>
int bsp_ffs_fread
void *cookie,
char *buffer,
int nbytes);
Arguments:
cookie
buffer
nbytes
Returns:
Context:
Description:
The bsp_ffs_fread() function is a callback function defined in the BSP support for
Flash file systems. The format of this function, type and sequence of arguments and
return value, is defined in the relocatable loader library (rl_lib 1.6 onwards), see
Chapter 5: Relocatable loader library on page 90. The bsp_ffs_fread() function
provides a way to access rl_lib for reading in to the array pointed to by buffer,
nbytes of data from the Flash file system regardless if the original file is stored in
flash as compressed or not.
The Flash file descriptor received from the bsp_ffs_fopen() is passed to the
rl_load_stream() function in its cookie argument (cast to a void *); this
function then passes this cookie to the bsp_ffs_fread().
The following fragment of code shows how to use this callback.
file = bsp_ffs_fopen((const char *)Id1, FFS_O_RDONLY);
if ( BSP_FAILURE == (int)file )
{
fprintf(stderr,"Error: bsp_ffs_fopen failed: \n");
exit(-1);
}
res=rl_load_stream(rlHndl,(rl_stream_func_t *) bsp_ffs_fread,
(void *)file);
if (res == -1)
{
fprintf(stderr,"Error: rl_load_stream failed: %s %d\n",
rl_errstr(rlHndl),rl_errno(rlHndl));
exit(-1);
}
bsp_ffs_close(file);
7521642
139/170
ST200
bsp_ffs_showboot
List the boot information available in Flash
Definition:
#include <platform.h>
int bsp_ffs_showboot(void);
Arguments:
None.
Returns:
Returns BSP_OK.
Context:
Description:
bsp_ipu_disable
Disable the Instruction Protection Unit
Definition:
#include <platform.h>
int bsp_ipu_disable(void);
Arguments:
None.
Returns:
Errors:
BSP_ECONTEXT
Context:
Description:
See also:
bsp_ipu_enable
bsp_ipu_enable
Enable the Instruction Protection Unit
Definition:
#include <platform.h>
int bsp_ipu_enable(void);
Arguments:
None.
Returns:
Errors:
BSP_ECONTEXT
Context:
Description:
See also:
bsp_ipu_disable
140/170
7521642
ST200
bsp_ipu_region_get
Return the settings for a region
Definition:
#include <platform.h>
int bsp_ipu_region_get(
unsigned int regno,
void **base,
unsigned int *logsize,
unsigned int *mode);
Arguments:
Returns:
regno
base
logsize
log2 of the size of the data region to be protected integer in the range 12 to 32 (corresponding to 4 Kbytes
to 4 Gbytes).
mode
Errors:
BSP_ECONTEXT
BSP_EINVAL
Context:
Callable only from bare machine run-time. OS21 run-time uses ipu_config().
Description:
Description
IPU_REGION_ENABLED
Region enabled
IPU_REGION_CACHEABLE
Cacheable region
IPU_SUPERVISOR_EXEC
Supervisor executable
IPU_USER_EXEC
User executable
7521642
Notes
Implies
IPU_SUPERVISOR_EXEC
141/170
ST200
bsp_ipu_region_set
Write the settings for a region
Definition:
#include <platform.h>
int bsp_ipu_region_set(
unsigned int regno,
void *base,
unsigned int logsize,
unsigned int prot );
Arguments:
Returns:
regno
base
logsize
log2 of the size of the data region to be protected integer in the range 12 to 32 (corresponding to 4 Kbytes
to 4 Gbytes).
mode
Errors:
Context:
BSP_ECONTEXT
BSP_EINVAL
Callable only from bare machine run-time. OS21 run-time uses ipu_config().
bsp_itc_interrupt_clear
Clear a specific interrupt
Definition:
#include <platform.h>
int bsp_itc_interrupt_clear(
int interrupt_number);
Arguments:
interrupt_number
Returns:
Errors:
BSP_EBUSY
BSP_ECONTEXT
Context:
Callable only from simple bare machine run-time. In the OS21 environment, the
interrupts are handled exclusively through the OS21 interface.
Description:
142/170
7521642
ST200
bsp_itc_interrupt_disable
Disable a specific interrupt
Definition:
#include <platform.h>
int bsp_itc_interrupt_disable(
int interrupt_number);
Arguments:
interrupt_number
Returns:
Errors:
BSP_EBUSY
BSP_ECONTEXT
Context:
Callable only from simple bare machine run-time. In the OS21 environment, the
interrupts are handled exclusively through the OS21 interface.
Description:
bsp_itc_interrupt_enable
Enable a specific interrupt
Definition:
#include <platform.h>
int bsp_itc_interrupt_enable(
int interrupt_number);
Arguments:
interrupt_number
Returns:
Errors:
BSP_EBUSY
BSP_ECONTEXT
Context:
Callable only from simple bare machine run-time. In the OS21 environment, the
interrupts are handled exclusively through the OS21 interface.
Description:
7521642
143/170
ST200
bsp_itc_interrupt_install
Install an interrupt handler
Definition:
#include <platform.h>
int bsp_itc_interrupt_install(
int interrupt_number,
int (*handler_function)(void* param_ptr),
int (**old_handler_function)(void* param_ptr),
void* stack_base,
int stack_size );
Arguments:
interrupt_number
handler_function
Returns:
stack_base
stack_size
Errors:
BSP_EBUSY
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. In the OS21 environment, the interrupts
are handled exclusively through the OS21 interface.
Description:
This function installs a new interrupt handler, returning the handler installed
previously.
144/170
7521642
ST200
bsp_itc_interrupt_poll
Poll a specific interrupt
Definition:
#include <platform.h>
int bsp_itc_interrupt_poll(
int interrupt_number,
int* value);
Arguments:
Returns:
interrupt_number
value
Errors:
BSP_ECONTEXT
Context:
Callable only from simple bare machine run-time. In the OS21 environment, the
interrupts are handled exclusively through the OS21 interface.
Description:
This function informs the user whether an interrupt has been raised.
bsp_itc_interrupt_raise
Raises a specific interrupt
Definition:
#include <platform.h>
int bsp_itc_interrupt_raise(
int interrupt_number);
Arguments:
interrupt_number
Returns:
Errors:
BSP_EBUSY
BSP_ECONTEXT
Context:
Callable only from simple bare machine run-time. In the OS21 environment, the
interrupts are handled exclusively through the OS21 interface.
Description:
7521642
145/170
ST200
bsp_itc_interrupt_uninstall
Uninstalls an interrupt handler
Definition:
#include <platform.h>
int bsp_itc_interrupt_uninstall(
int interrupt_number);
Arguments:
interrupt_number
Returns:
Errors:
BSP_EBUSY
BSP_ECONTEXT
Context:
Callable only from simple bare machine run-time. In the OS21 environment, the
interrupts are handled exclusively through the OS21 interface.
Description:
bsp_mmu_dump_TLB_Settings
Write TLBs settings on the stdio
Definition:
#include <platform.h>
int bsp_mmu_dump_TLB_Settings (void);
Arguments:
None.
Returns:
Returns BSP_OK.
Context:
Description:
146/170
Size
8KB
8KB
8KB
8KB
4MB
4MB
Vaddr
0x1F004000
0x1F002000
0x1F000000
0x00000000
0x08400000
0x08000000
7521642
Paddr Partition
0x1F004000 WAY0-3
0x1F002000 WAY0-3
0x1F000000 WAY0-3
0x00000000 WAY0-3
0x08400000 WAY0-3
0x08000000 WAY0-3
Policy
UNCACHED
UNCACHED
UNCACHED
UNCACHED
CACHED
CACHED
ST200
bsp_mmu_memory_map
Create a memory mapping and return a virtual address range
Definition:
#include <platform.h>
void * bsp_mmu_memory_map (void * address,
size_t length,
int prot,
int flags,
void * phaddr);
Arguments:
Returns:
address
length
prot
flags
phaddr
Errors:
BSP_EMAPFAIL
BSP_EINVAL
BSP_EMFILE
BSP_ECONTEXT
Context:
Callable only from bare machine run-time or before OS21 is started. In OS21, this
function only returns BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
147/170
ST200
PROT_SUPERVISOR_WRITE
The address can be written in supervisor mode.
PROT_USER_EXECUTE
PROT_SUPERVISOR_EXECUTE
The address can be executed in supervisor mode.
PROT_NONE
PROT_CACHEABLE
POLICY_UNCACHEABLE
PART_WAY1
PART_WAY2
PART_WAY3
PAGE_DIRTY
PAGE_VALID
Writes to this page are allowed.
If an implementation of bsp_mmu_memory_map() for a specific platform cannot
support the combination of access types specified by prot, the call to
bsp_mmu_memory_map() fails.
148/170
7521642
ST200
MAP_LOCKED
MAP_OVERRIDE
MAP_SPARE_RESOURCES
When MAP_FIXED is set in the flags argument, the system is informed that the
value of va must be addr exactly. If MAP_FIXED is set, bsp_mmu_memory_map()
may return MAP_FAILED and set bsp_errno to BAP_EINVAL. If a MAP_FIXED
request is successful, the mapping established by bsp_mmu_memory_map()
replaces any previous mappings for the programs pages in the range
[va, va + length).
When MAP_FIXED is set and the requested address is the same as previous
mapping, the previous address is unmapped and the new mapping is created on top
of the old one.
When MAP_FIXED is not set, the system uses addr to arrive at va. The va is an area
of the address space that the system deems suitable for a mapping of length bytes
to the physical address phaddr. The value of addr is taken to be a suggestion of a
program address near which the mapping should be placed.
When the system selects a value for va and MAP_OVERRIDE is not set, existing
mappings are not overridden. This includes the mapping set at program initialization
time in BSP-like code.
When MAP_SPARE_RESOURCES is set, the hardware resources are spared so that a
reasonable amount of hardware resources remain available for further
bsp_mmu_memory_map() usage. The implementation of this flag is ST200
architecture dependent.
When MAP_LOCKED is set, the LIMIT field of the TLB REPLACE register is changed.
To avoid this, TLB could be impacted from random TLB replacement routines.
bsp_mmu_memory_unmap()
7521642
149/170
ST200
bsp_mmu_memory_unmap
Delete a memory mapping
Definition:
#include <platform.h>
int bsp_mmu_memory_unmap (
void *address,
size_t length);
Arguments:
Returns:
address
length
Errors:
BSP_EINVAL
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. After OS21 start-up, this function only
returns BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
See also:
bsp_mmu_memory_map
bsp_mmu_reset
Reset TLBs settings
Definition:
#include <platform.h>
int bsp_mmu_reset (void);
Arguments:
None.
Returns:
Errors:
BSP_ECONTEXT
Context:
150/170
Callable only from bare machine run-time. In OS21, this function only returns
BSP_FAILURE and sets the error to BSP_ECONTEXT.
7521642
ST200
bsp_pm_clock_get
Read the PM Clock counter
Definition:
#include <platform.h>
unsigned int bsp_pm_clock_get(void);
Arguments:
None.
Returns:
Errors:
None.
Context:
Description:
This function reads the PM Clock counter and returns its current value.
See also:
bsp_pm_clock_set
bsp_pm_clock_set
Write the PM Clock counter
Definition:
#include <platform.h>
int bsp_pm_clock_set(
unsigned int value);
Arguments:
value
Returns:
Errors:
BSP_EBUSY
Context:
Description:
See also:
bsp_pm_clock_get
7521642
151/170
ST200
bsp_pm_count_mode
Change the suspension behavior of PM counters during oscalls
and debug events
Definition:
#include <platform.h>
int bsp_pm_count_mode(
unsigned int mode);
Arguments:
mode
Returns:
Returns BSP_OK.
Errors:
None.
Context:
Description:
See also:
PM_DEFAULT
PM_FREE_RUN
PM_SUSPEND_OSCALL
PM_SUSPENDED_DEBUG
PM_SUSPENDED_ALL
bsp_timer_count_mode
bsp_pm_counter_get
Read the current value of a PM counter
Definition:
#include <platform.h>
unsigned int bsp_pm_counter_get(
int counter);
Arguments:
counter
Returns:
Errors:
BSP_EINVAL
Context:
Description:
This function reads the PM counter and returns its current value.
See also:
bsp_pm_counter_set
152/170
7521642
ST200
bsp_pm_counter_set
Write/change the value of a PM counter
Definition:
#include <platform.h>
int bsp_pm_counter_set(
int counter,
unsigned int value);
Arguments:
Returns:
counter
value
Errors:
BSP_EINVAL
Context:
Description:
See also:
bsp_pm_counter_get
bsp_pm_event_get
Returns the event monitored by the PM counter
Definition:
#include <platform.h>
unsigned int bsp_pm_event_get(
int counter);
Arguments:
counter
Returns:
Errors:
BSP_EINVAL
Context:
Description:
This function reads the PM counter specified in counter and returns the event with
which it is associated.
See also:
bsp_pm_event_set
7521642
153/170
ST200
bsp_pm_event_set
Set the event being monitored by a PM counter
Definition:
#include <platform.h>
int bsp_pm_event_set(
int counter,
unsigned int event);
Arguments:
Returns:
counter
event
Errors:
BSP_EINVAL
Context:
Description:
This function sets the PM counter specified in counter to monitor the event specified
in event.
See also:
bsp_pm_event_get
bsp_pm_reset
Reset all counters
Definition:
#include <platform.h>
int bsp_pm_reset(void);
Arguments:
None.
Returns:
Returns BSP_OK.
Errors:
None.
Context:
Description:
bsp_pm_start
Start all the event counters
Definition:
#include <platform.h>
int bsp_pm_start(void);
Arguments:
None.
Returns:
Returns BSP_OK.
Errors:
None.
Context:
Description:
See also:
bsp_pm_stop
154/170
7521642
ST200
bsp_pm_stop
Stop all the event counters
Definition:
#include <platform.h>
int bsp_pm_stop(void);
Arguments:
None.
Returns:
Returns BSP_OK.
Errors:
None.
Context:
Description:
See also:
bsp_pm_start
bsp_scu_disable
Disable an SCU region
Definition:
#include <platform.h>
unsigned int bsp_scu_disable(
unsigned int regno);
Arguments:
regno
Returns:
Errors:
Context:
BSP_ECONTEXT
BSP_EINVAL
Callable only from bare machine run-time. If OS21 is started, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
bsp_scu_dump_SCU_Settings
Dump on the I/O a list of the SCU regions
Definition:
#include <platform.h>
int bsp_scu_dump_SCU_Settings(void);
Arguments:
None.
Returns:
Returns BSP_OK.
Errors:
None.
Context:
Description:
7521642
155/170
ST200
bsp_scu_read
Read the start and stop address of an SCU region
Definition:
#include <platform.h>
unsigned int bsp_scu_read(
unsigned int regno,
bsp_scu_entry_t *sect);
Arguments:
Returns:
regno
sect
Errors:
BSP_EINVAL
Context:
Description:
The bsp_scu_read() function reads the start and stop address of the SCU region
specified by regno. The addresses are returned in the structure sect.
bsp_scu_write
Set the start and stop address of an SCU region
Definition:
#include <platform.h>
unsigned int bsp_scu_write(
unsigned int regno,
bsp_scu_entry_t *sect);
Arguments:
Returns:
regno
sect
Errors:
BSP_EINVAL
BSP_ECONTEXT
Context:
Description:
The bsp_scu_write() function sets the start and stop address of the SCU region
specified by regno to the addresses specified in the structure sect.
156/170
7521642
ST200
bsp_timer_count_get
Get the initial value of the counter of the specific timer
Definition:
#include <platform.h>
unsigned int bsp_timer_count_get(
int timer);
Arguments:
timer
Returns:
The timer for which to get the initial counter value, see
Table 31: ST200 timer assignments on page 120.
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
See also:
bsp_timer_count_set
bsp_timer_count_mode
Change the suspension behavior of the timers during oscalls and
debug events
Definition:
#include <platform.h>
int bsp_timer_count_mode(
unsigned int mode);
Arguments:
mode
Returns:
Returns BSP_OK.
Errors:
None.
Context:
Description:
This function defines if timer counters have to stopped during oscalls (I/O) and debug
events. The argument mode can assume any of the following values.
TIMER_DEFAULT
TIMER_FREE_RUN
bsp_pm_count_mode
7521642
157/170
ST200
bsp_timer_count_set
Set the initial value of the counter of the specific timer
Definition:
#include <platform.h>
int bsp_timer_count_set(
int timer,
unsiged int value);
Arguments:
Returns:
timer
value
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
This function initializes the counter of a given timer. It should only be used with
TIMER1 and TIMER2, however TIMER2 should only be used if the profiler is not
enabled. Do not use this function with TIMER_SYSTEM.
bsp_timer_interrupt_clear
Clear the timer interrupt
Definition:
#include <platform.h>
int bsp_timer_interrupt_clear(
int timer);
Arguments:
timer
Returns:
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
This function clears the interrupt of a given timer. It should only be used with TIMER1
and TIMER2, however TIMER2 should only be used if the profiler is not enabled. Do
not use this function with TIMER_SYSTEM.
158/170
7521642
ST200
bsp_timer_interrupt_enable
Enable the timer interrupt
Definition:
#include <platform.h>
int bsp_timer_interrupt_enable(
int timer);
Arguments:
timer
Returns:
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
This function enables the interrupt for the given timer. It should only be used with
TIMER1 and TIMER2, however TIMER2 should only be used if the profiler is not
enabled. Do not use this function with TIMER_SYSTEM.
bsp_timer_now
Return the current time
Definition:
#include <platform.h>
bspclock_t bsp_timer_now(void);
Arguments:
None.
Returns:
Errors:
None.
Context:
Callable from task or interrupt handler. If OS21 is enabled, this function directly
invokes the corresponding OS21 time_now() function.
Description:
bsp_timer_now() returns the number of ticks since the system started running.
The exact time at which counting starts is implementation specific, but is done in the
core initialization.
The units of ticks is an implementation dependent quantity, but it is approximately
1 microseconds, see bsp_timer_ticks_per_sec on page 162.
7521642
159/170
ST200
bsp_timer_reload_get
Get the reload value of the specific timer
Definition:
#include <platform.h>
unsigned int bsp_timer_reload_get(
int timer);
Arguments:
timer
Returns:
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
bsp_timer_reload_set
Set the value to be reloaded into the specific timer on reaching
zero
Definition:
#include <platform.h>
int bsp_timer_reload_set(
int timer,
unsigned int reload);
Arguments:
Returns:
timer
value
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
This function initializes the reload register of a given timer. It should only be used with
TIMER1 and TIMER2, however TIMER2 should only be used if the profiler is not
enabled. Do not use this function with TIMER_SYSTEM.
160/170
7521642
ST200
bsp_timer_start
Start the timer
Definition:
#include <platform.h>
int bsp_timer_start(
int timer);
Arguments:
timer
Returns:
Errors:
BSP_ECONTEXT
Context:
Callable only from simple bare machine run-time. If OS21 is enabled, this function
returns BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
This function starts the timer. It should only be used with TIMER1 and TIMER2,
however TIMER2 should only be used if the profiler is not enabled. Do not use this
function with TIMER_SYSTEM.
bsp_timer_stop
Stop the timer
Definition:
#include <platform.h>
int bsp_timer_stop(
int timer);
Arguments:
timer
Returns:
Errors:
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
This function stops the timer. It should only be used with TIMER1 and TIMER2,
however TIMER1 should only be used if the profiler is not enabled. Do not use this
function with TIMER_SYSTEM.
7521642
161/170
ST200
bsp_timer_ticks_per_sec
Return the number of clock ticks per second
Definition:
#include <platform.h>
bspclock_t bsp_time_ticks_per_sec(void);
Arguments:
None.
Returns:
Errors:
None.
Context:
Callable from task or interrupt handler. If OS21 is enabled, this function directly
invokes the corresponding OS21 function time_ticks_per_sec().
Description:
bsp_timer_user
Set a user timer, attach an interrupt handle and enable the
corresponding interrupt
Definition:
#include <platform.h>
int bsp_timer_user(
int timer,
unsigned int const,
unsigned int reload,
int (* interrupt_handle)(void *param),
int (** old_handler)(void *param));
Arguments:
Returns:
timer
const
reload
interrupt_handle
old_handle
Errors:
BSP_EINVAL
BSP_EBUSY
BSP_ECONTEXT
Context:
Callable only from bare machine run-time. If OS21 is enabled, this function returns
BSP_FAILURE and sets bsp_errno to BSP_ECONTEXT.
Description:
This function set a user timer, attaches an interrupt handle and enables the
corresponding interrupt.
162/170
7521642
ST200
Revision history
Revision history
Table 46.
Date
Changes
24-Mar-06
16-Jul-05
03-Nov-06
14-Jul-06
24-Jun-05
7521642
163/170
Revision history
ST200
Table 46.
Date
17-Jun-05
28-Nov-04
12-Jun-04
18-Dec-03
164/170
Changes
7521642
ST200
Revision history
Table 46.
Date
Revision
Changes
21-Jun-03
02-Jun-03
28-May-03
Initial release.
7521642
165/170
Index
ST200
Index
Symbols
.bss initialization . . . . . . . . . . . . . . . . . . . . . . . .16
.gdbtkinit file . . . . . . . . . . . . . . . . . . . . . . . . . . .41
A
address
end of RAM . . . . . . . . . . . . . . . . . . . . . . . . . .17
address space usage . . . . . . . . . . . . . . . . . . . .11
B
back-end component . . . . . . . . . . . . . . . . . . . .86
Backus-Naur Form . . . . . . . . . . . . . . . . . . . . . . .8
BNF. See Backus-Naur Form.
BOARD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
board
bring up . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
board file . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
BOARD_TXT_FILE . . . . . . . . . . . . . . . . . . . . .22
boot code . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
BOOT_FROM_RESET . . . . . . . . . . . . . . . . . .68
BOOT_ROM_BASE . . . . . . . . . . . . . . . . . . . . .69
BOOT_ROM_SIZE . . . . . . . . . . . . . . . . . . . . . .69
BOOT_RTL . . . . . . . . . . . . . . . . . . . . . . . . . . .69
BOOTRAM . . . . . . . . . . . . . . . . . . . . . . . . .22, 87
bring up procedure . . . . . . . . . . . . . . . . . . . . . .87
bsp_cache_invalidate_instruction . . . . . . . . .131
bsp_cache_invalidate_instruction_all . . . . . . .131
bsp_cache_purge_data . . . . . . . . . . . . . . . . .132
bsp_cache_purge_data_all . . . . . . . . . . . . . .132
bsp_core_interrupt_install . . . . . . . . . . . . . . .133
bsp_core_interrupt_lock . . . . . . . . . . . . . . . . .133
bsp_core_interrupt_unlock . . . . . . . . . . . . . . .134
bsp_dpu_disable . . . . . . . . . . . . . . . . . . . . . .134
bsp_dpu_enable . . . . . . . . . . . . . . . . . . . . . . .135
bsp_dpu_region_get . . . . . . . . . . . . . . . . . . .135
bsp_dpu_region_set . . . . . . . . . . . . . . . . . . . .136
bsp_ffs_dir . . . . . . . . . . . . . . . . . . . . . . . . . . .137
bsp_ffs_fclose . . . . . . . . . . . . . . . . . . . . . . . .137
bsp_ffs_fopen . . . . . . . . . . . . . . . . . . . . . . . . .138
bsp_ffs_fread . . . . . . . . . . . . . . . . . . . . . . . . .139
bsp_ffs_showboot . . . . . . . . . . . . . . . . . . . . .140
bsp_ipu_disable . . . . . . . . . . . . . . . . . . . . . . .140
bsp_ipu_enable . . . . . . . . . . . . . . . . . . . . . . .140
bsp_ipu_region_get . . . . . . . . . . . . . . . . . . . .141
bsp_ipu_region_set . . . . . . . . . . . . . . . . . . . .142
bsp_itc_interrupt_clear . . . . . . . . . . . . . . . . . .142
166/170
bsp_itc_interrupt_disable . . . . . . . . . . . . . . . 143
bsp_itc_interrupt_enable . . . . . . . . . . . . . . . . 143
bsp_itc_interrupt_install . . . . . . . . . . . . . . . . . 144
bsp_itc_interrupt_poll . . . . . . . . . . . . . . . . . . 145
bsp_itc_interrupt_raise . . . . . . . . . . . . . . . . . 145
bsp_itc_interrupt_uninstall . . . . . . . . . . . . . . . 146
bsp_mmu_dump_TLB_Settings . . . . . . . . . . 146
bsp_mmu_memory_map . . . . . . . . . . . . . . . . 147
bsp_mmu_memory_unmap . . . . . . . . . . . . . . 150
bsp_mmu_reset . . . . . . . . . . . . . . . . . . . . . . . 150
bsp_pm_clock_get . . . . . . . . . . . . . . . . . . . . 151
bsp_pm_clock_set . . . . . . . . . . . . . . . . . . . . . 151
bsp_pm_count_mode . . . . . . . . . . . . . . . . . . 152
bsp_pm_counter_get . . . . . . . . . . . . . . . . . . . 152
bsp_pm_counter_set . . . . . . . . . . . . . . . . . . . 153
bsp_pm_event_get . . . . . . . . . . . . . . . . . . . . 153
bsp_pm_event_set . . . . . . . . . . . . . . . . . . . . 154
bsp_pm_reset . . . . . . . . . . . . . . . . . . . . . . . . 154
bsp_pm_start . . . . . . . . . . . . . . . . . . . . . . . . . 154
bsp_pm_stop . . . . . . . . . . . . . . . . . . . . . . . . . 155
bsp_scu_disable . . . . . . . . . . . . . . . . . . . . . . 155
bsp_scu_dump_SCU_Settings . . . . . . . . . . . 155
bsp_scu_read . . . . . . . . . . . . . . . . . . . . . . . . 156
bsp_scu_write . . . . . . . . . . . . . . . . . . . . . . . . 156
bsp_timer_count_get . . . . . . . . . . . . . . . . . . . 157
bsp_timer_count_mode . . . . . . . . . . . . . . . . . 157
bsp_timer_count_set . . . . . . . . . . . . . . . . . . . 158
bsp_timer_interrupt_clear . . . . . . . . . . . . . . . 158
bsp_timer_interrupt_enable . . . . . . . . . . . . . . 159
bsp_timer_now . . . . . . . . . . . . . . . . . . . . . . . 159
bsp_timer_reload_get . . . . . . . . . . . . . . . . . . 160
bsp_timer_reload_set . . . . . . . . . . . . . . . . . . 160
bsp_timer_start . . . . . . . . . . . . . . . . . . . . . . . 161
bsp_timer_stop . . . . . . . . . . . . . . . . . . . . . . . 161
bsp_timer_ticks_per_sec . . . . . . . . . . . . . . . . 162
bsp_timer_user . . . . . . . . . . . . . . . . . . . . . . . 162
bsp_user_end_handle . . . . . . . . . . . . . . . . . . 130
bsp_user_start_handle . . . . . . . . . . . . . . . . . 129
BUNDLE_CHECKING_ON . . . . . . . . . . . . . . . 70
BUNDLE_CHECKING_RE_ON . . . . . . . . . . . 70
BUS_BYTES_PER_CYCLE . . . . . . . . . . . . . . 68
BUS_BYTES_PER_TRANSACTION . . . . . . . 68
BUS_LATENCY . . . . . . . . . . . . . . . . . . . . . . . 68
BUS_MHZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
BUS_TRAFFIC_OUTPUT_TRACE_FILE . . . . 69
BUS_TRAFFIC_TRACE_END_CYCLE . . . . . 69
BUS_TRAFFIC_TRACE_START_CYCLE . . . 69
BUS_TRAFFIC_TRACING_ON . . . . . . . . . . . 69
7521642
ST200
Index
C
CLEAR_MEMORY . . . . . . . . . . . . . . . . . . . . . .71
CLOCK_D . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
commands
direct to target . . . . . . . . . . . . . . . . . . . . . . . .14
compile C program . . . . . . . . . . . . . . . . . . . . . .89
CONFIG_FILE . . . . . . . . . . . . . . . . . . 20, 22, 67
connect a target . . . . . . . . . . . . . . . . . . . . . . . .13
core registers . . . . . . . . . . . . . . . . . . . . . . . . . .42
initialization . . . . . . . . . . . . . . . . . . . . . . . . . .43
CORE_MHZ . . . . . . . . . . . . . . . . . . . . . . . . . . .67
CPU_RESET_ADDRESS . . . . . . . . . . . . . . . .22
critical test suite . . . . . . . . . . . . . . . . . . . . .85, 88
cross-development environment . . . . . . . . . . . .1
D
DCACHE_MODEL . . . . . . . . . . . . . . . . . . . . . .67
debug information . . . . . . . . . . . . . . . . . . . . . .15
define an alias . . . . . . . . . . . . . . . . . . . . . . . . .87
device plug-ins . . . . . . . . . . . . . . . . . . . . . . . . .70
DEVICE_PLUGIN_MODULES . . . . . . . . . . . . .70
DiDirectCommand . . . . . . . . . . . . . . . . . . . . . .14
direct command . . . . . . . . . . . . . . . . . . . . . . . .14
DISABLE_MPOKE . . . . . . . . . . . . . . . . . . . . . .22
dll
options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
parameters . . . . . . . . . . . . . . . . . . . . . . . . . .15
specify . . . . . . . . . . . . . . . . . . . . . 15, 20-21, 28
version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
DSU monitor . . . . . . . . . . . . . . . . . . . . . . . . . . .86
DSU register . . . . . . . . . . . . . . . . . . . . . 85-86, 88
DSU_DEFAULT_MODULE_ENABLED . . . . . .70
DSU_ROM_IMAGE . . . . . . . . . . . . . . . . . . . . .71
DUMP_CONFIG_FILE . . . . . . . . . . . . . . . .20, 67
dynamic library . . . . . . . . . . . . . . . . 15, 18, 20-21
dynamic target dll name . . . . . . . . . . . . . . .15, 28
E
EMU_SAFE_TRACE . . . . . . . . . . . . . . . . . . . .23
EMU_TRACE . . . . . . . . . . . . . . . . . . . . . . . . . .23
emulate system calls . . . . . . . . . . . . . . . . .13, 34
environment
pass variables to target . . . . . . . . . . . . . .15, 34
examples
using st200run . . . . . . . . . . . . . . . . . . . . . . . .13
execute C program . . . . . . . . . . . . . . . . . . . . . 89
execute program . . . . . . . . . . . . . . . . . . . . . . . 13
memory location . . . . . . . . . . . . . . . . . . . . . . 11
EXTERNAL_MEMORY_BASE . . . . . . . . . 20, 68
EXTERNAL_MEMORY_PATTERN . . . . . . . . 71
EXTERNAL_MEMORY_SIZE . . . . . . . . . . 20, 68
F
Fast mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
file management . . . . . . . . . . . . . . . . . . . . . . 108
G
gdbtk.ini file . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
GDI
commands . . . . . . . . . . . . . . . . . . . . . . . . . . 37
dynamic target dll name . . . . . . . . . . . . . 15, 28
function information . . . . . . . . . . . . . . . . . . . 15
functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
version information . . . . . . . . . . . . . . . . . . . . 18
GDI Debug Instrument . . . . . . . . . . . . . . . . . . 89
gentestsuite . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
graphical user interface . . . . . . . . . . . . . . . 27, 35
GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 35
H
hardware reset address . . . . . . . . . . . . . . . . . . 17
HAZARD_CHECKING_ON . . . . . . . . . . . . . . . 70
help
st200run . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
host environment variables . . . . . . . . . . . . 15, 34
HTI_ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
HTI_MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
I
ICACHE_MODEL . . . . . . . . . . . . . . . . . . . . . . 67
ID2KEY_FILE . . . . . . . . . . . . . . . . . . . . . . . . . 23
initialization hook . . . . . . . . . . . . . . . . . . . . . . . 43
initialize bss . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Insight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
installation testing . . . . . . . . . . . . . . . . . . . . . . 10
instruction-set accurate mode . . . . . . . . . . . . . 13
internal C run-time initialization . . . . . . . . . . . . 43
ISS mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7521642
167/170
Index
ST200
K
KERNEL_STACK_SIZE . . . . . . . . . . . . . . . . . .68
L
Linux
installation testing . . . . . . . . . . . . . . . . . . . . .10
LMI RAM memory . . . . . . . . . . . . . . . . . . . . . .11
load program . . . . . . . . . . . . . . . . . . . . . . . . . .13
--loaded . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
memory location . . . . . . . . . . . . . . . . . . . . . .11
M
memory
change location . . . . . . . . . . . . . . . . . . . . . . .11
LMI RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
load program . . . . . . . . . . . . . . . . . . . . . . . . .16
noncacheable area size . . . . . . . . . . . . . . . .16
memory allocation . . . . . . . . . . . . . . . . . . . . .108
memory protection setting . . . . . . . . . . . . . . . .47
MEMSYSTEM_LATENCY . . . . . . . . . . . . . . . .68
MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . .20, 67
module version . . . . . . . . . . . . . . . . . . . . . . . . .15
N
NO_CHIP_RESET . . . . . . . . . . . . . . . . . . . . . .23
NO_TAP_CTRL . . . . . . . . . . . . . . . . . . . . . . . .23
noncacheable memory area . . . . . . . . . . . . . . .16
NONCACHEABLE_MEM_SIZE . . . . . . . . .20, 68
O
OS21 tick duration . . . . . . . . . . . . . . . . . . . . .120
OS21_OSCALL . . . . . . . . . . . . . . . . . . . . . . . .24
OUTPUT_LOG_FILE . . . . . . . . . . . . . . . . . . . .70
OUTPUT_TRACE_FILE . . . . . . . . . . . . . . .20, 69
override
memory protection setting . . . . . . . . . . . . . . .47
P
passing environment variables . . . . . . . . . . . . .34
peripheral base address . . . . . . . . . . . . . . . . . .85
PERIPHERAL_BASE . . . . . . . . . . . . . . . . . . . .69
PERIPHERAL_LATENCY . . . . . . . . . . . . . . . .68
plug-ins
device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
168/170
R
R_Absolute . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
R_PIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
R_Relocatable . . . . . . . . . . . . . . . . . . . . . . . . . 90
RAM memory . . . . . . . . . . . . . . . . . . . . . . 86, 88
RAMEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
startup location . . . . . . . . . . . . . . . . . . . . . . . 33
README.GDBTK . . . . . . . . . . . . . . . . . . . . . . 41
reference mode . . . . . . . . . . . . . . . . . . . . . . . . 13
relocatable loader library . . . . . . . . . . . . . . . . . 90
file management . . . . . . . . . . . . . . . . . . . . . 108
memory allocation . . . . . . . . . . . . . . . . . . . 108
relocatable run-time model . . . . . . . . . . . . . . . 91
reset mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
RESET_ADDRESS . . . . . . . . . . . . . . . . . . . . . 69
RESET_DELAY_CYCLES . . . . . . . . . . . . . . . 69
rl_add_action_callback . . . . . . . . . . . . . . . . . 103
rl_delete_action_callback . . . . . . . . . . . . . . . 104
rl_errarg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
rl_errno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
rl_errstr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
rl_file_name . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
rl_foreach_segment . . . . . . . . . . . . . . . . . . . . 102
rl_handle_delete . . . . . . . . . . . . . . . . . . . . . . . 94
rl_handle_new . . . . . . . . . . . . . . . . . . . . . . . . . 94
rl_lib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
rl_load_addr . . . . . . . . . . . . . . . . . . . . . . . . . . 95
rl_load_buffer . . . . . . . . . . . . . . . . . . . . . . . . . 97
rl_load_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
rl_load_size . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
rl_load_stream . . . . . . . . . . . . . . . . . . . . . . . . . 98
rl_parent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
rl_set_file_name . . . . . . . . . . . . . . . . . . . . . . . 96
rl_sym . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
rl_sym_rec . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
rl_this . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
rl_unload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
run.log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
run-time configuration . . . . . . . . . . . . . . . . . . . 33
run-time model . . . . . . . . . . . . . . . . . . . . . . . . 90
run-time version . . . . . . . . . . . . . . . . . . . . . . . . 18
7521642
ST200
Index
taplink interface . . . . . . . . . . . . . . . . . . . . . . . . 86
target command . . . . . . . . . . . . . . . . . . . . . . . 28
target information . . . . . . . . . . . . . . . . . . . . . . 84
targets . . . . . . . . . . . . . . . . . . . . . . . . . 13, 19, 28
board file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
description file . . . . . . . . . . . . . . . . . 17-18, 28
dll name . . . . . . . . . . . . . . . . . . . . . . . . . 15, 28
mb379 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
options . . . . . . . . . . . . . . . . . . . . . . . . . . 20-21
sim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
simprof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
specify name . . . . . . . . . . . . . . . . . . . . . . . . 17
specify options . . . . . . . . . . . . . . 15, 20-21, 28
ST220 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
supported . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
syntax in file . . . . . . . . . . . . . . . . . . . . . . 19, 21
version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
targets.cfg . . . . . . . . . . . . . . . . . . . . . . 19, 28, 35
tools
setting up boards . . . . . . . . . . . . . . . . . . . . . 86
TRACE_END_CYCLE . . . . . . . . . . . . . . . . 20, 69
TRACE_START_CYCLE . . . . . . . . . . . . . 20, 69
TRACING_ON . . . . . . . . . . . . . . . . . . . . . . 20, 69
TRANSACTION_SETUP_CYCLES . . . . . . . . 68
transfer rate . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . 41
V
VERBOSITY . . . . . . . . . . . . . . . . . . . . . . . . . . 26
version
st200run . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
VIRTUAL_DEBUG . . . . . . . . . . . . . . . . . . . . . 26
7521642
169/170
ST200
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 STs 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 STS 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 USERS 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.
170/170
7521642