UM1616
7 How to use trace infrastructure
How to use trace infrastructure
7.1.1 On an STiH415 board
This section describes the steps required to configure an STiH415 board to collect traces from an application running on the STxP70 core. Traces are collected using the STM-Probe acquisition box. This example is specific to the standby controller (SBC). The STxP70 application instrumentation is based on the MTT API function.
Environment and application setup
Before starting, install the following:
• the trace infrastructure toolset
• the STxP70 toolset version 2012.1 or later (for information on how to obtain the toolset, contact [email protected])
• the ST Micro Connection Package and associated ST TargetPack supporting the
STxP70 toolset (STMicroelectronics recommend that you install the latest available version of the ST Micro Connection Package)
Then, setup the environment:
•
The first step is to setup the STxP70 toolset environment. Please refer to STxP70 toolset documentation. Then initialize, according to the host platform, all the necessary environment variables needed by target pack.
STMC_DIR
ST Micro Connection Package installation directory
TARGETPACK_PATH
STMC2_IP_ADDR
TARGET PACK installation directory
STMC2 IP Address
STTP_XML_PATH sttp.xml file directory
• According to the host platform, update your PATH environment variable:
PATH $STMC_DIR/bin
LD_LIBRARY_PATH $STMC_DIR/lib
Then, build your application:
•
Build your application with the STxP70 compiler and link with the STxP70 MTT library.
Please refer to MTT Library Documentation.
Finally, launch the STxP70 debugger:
• To connect to debugger, you must declare a suitable target in your target.ini file.
Figure 12
shows an example:
DocID024336 Rev 1 19/27
How to use trace infrastructure
Note:
UM1616
Figure 12. Example target.ini file
[xp70_lpm]
Rule=target:type EMU
Rule=define V4
Section=Core
Section=Common
Section=Memory_Map_lpm OwnerParam=<BEGIN> connect STMC2 -retry 2 100 -p "no_reset=1" -timeout 3000 -no_jtag_test
-target_pack "${STMC2_IP_ADDR}:b2000stxh415:xp70_lpm no_convertor_abort=1 silent=1 tck_frequency=10000000 targetpack_debug=jtag stmc_pokepeek_timeout=10000 module_function=stm:cpt_table_orly"
<OWNER PARAM END>
[Memory_Map_lpm]
Rule=require EMU && (V4)
MemoryMap = DRAM 0x00000000 0x00002000 rw
MemoryMap = PRAM 0x00400000 0x00008000 rwx
MemoryMap = ERAM 0x00800000 0x02000000 rwx
MemoryMap = ERAM 0xA00000 0xFF600000 rwx
The stm:cpt_table_orly tokens that appear in the connect command are Python scripts in charge of respectively initializing the STM and the MTT API. You must be sure that these two files are in your target pack directory.
The command line to launch the STxP70 debugger is the following: sxgdb --targetfile=<your target.ini>
-prop=connect_cmd=st.config.fetch_enable.on --target=<your target> <your instrumented application>
As an example: sxgdb --targetfile=target.ini -prop=connect_cmd=st.config.fetch_enable.on
--target=xp70_lpm exampleMTTAPI.out
If you use STWorkbench, add -prop=connect_cmd=st.config.fetch_enable.on in the More options field of the debug configuration (Debug Configurations > Tab
Debugger > Main > More options).
20/27 DocID024336 Rev 1