| |||
| Home > Data Collection Using RealView Trace 2 > Setting the connection options > Setting up scripts | |||
To set up script files to run before the execution of the image file, use the Browse button next to one of the script fields to search for an existing .etm script file or the Create button to write a new one. There are three script fields in Connection tab:
Connection Setup to set up the target connection
Before Transfer to execute the script file before the image is downloaded to the target
After Transfer to execute the script file just before the target execution starts.
Create a new .etm file and add any combination of the following commands to it:
Data.Set - The Data.Set command can be useful in either a pre- or post- script to manually set specific memory addresses to known values before execution. Use the data set command in either of the following syntaxes:
Data.Set address %format value
Data.Set address "string"
Use a hexadecimal address for address and
a hexadecimal value for .
The possible values for %format are:value
%Long - 4 bytes
%Word - 2 bytes
%Byte - 1 bytes
Register.Set - Use the Register.Set command to specify register values. Use the register set command in one of the following syntaxes:
Register.Set register value
Register.Set mcr_opcode1_DestinationRegister_cp15RegisterNumber_RegisterAction_opcode2 value.
For example, Register.Set mcr_p15_0_r1_c1_c0_0 0x5007A
Refer to the technical reference manual for your processor for a detailed description on how to write to the system control coprocessor.
The possible values for are:register
cpsr
r0 - r14
pc
Use
a hexadecimal value in place of value.
WAIT - Use the wait command to add a delay before the next action. Use wait in the following syntax:
WAIT time
Time can be set in either seconds or milliseconds by using either .s or .ms after the time value. For example, to set the wait time to 12 seconds enter WAIT 12.s in the script file.
Data.LOAD.Binary PathName address - Use
this command along with a path to a binary file and an address to
load a binary. This is useful when loading the Symbian binary, as
demonstrated in the example that follows.
To illustrate how each of these commands can be used, an example script file that makes use of each of the three possible commands is shown in Example 3.1:
Example 3.1. A sample script
Register.Set mcr_p15_0_r1_c1_c0_0 0x5007A
Data.LOAD.Binary C:\SymbianROMs\PB1176ARMV6.IMG 0x0
Data.Set 0x00000004 %Long 0x0000ffff
Data.Set 0x00000008 %Long 0x00003000
WAIT 12.ms
Register.Set r1 0x12