winIDEA Initialization Files
In this topic:
Initialization files (INI files) in winIDEA are plain text files used to script simple memory read/write operations, basic core instruction execution.
They are mostly used for:
•Memory initialization
•Simple peripheral initialization
•Additional operations/actions that can be executed at predefined debug session operation (e.g.: after reset, before starting trace session, etc…)
INI files can be part of winiDEA distribution (e.g.: next to EVE scripts and SFR files, part of winIDEA Example Workspaces) or can be user created files. They are mainly defined in Hardware | CPU Options | Reset.
An initialization item is defined in a single line. The syntax is case-insensitive, which means that, for example, either #define or #DEFINE is considered the same.
No arithmetic is supported. These expressions are illegal:
#define ABC 0x000FFFFF+1 |
C-like pre-processor is used.
#define <alias> <value> |
Example:
#define SP Supervisor |
Standard C /* */ multi-line comments are supported.
Example:
/* this is a begin of a multi-line comment |
Double forward-slash characters are interpreted as end of line comments.
Example:
#define SP Supervisor // this is a comment |
If a token contains a space, it must be enclosed in double quotes.
Example:
#define SP “Supervisor Data” // memory space name contains a whitespace and must be enclosed in quotes |
Memory Area specifies the name of the CPU’s Memory Space where the write is performed. The string specifying the area is CPU architecture specific. This parameter is optional. If omitted, the default SFR memory space is used.
Command |
Op code |
Parameters |
---|---|---|
A S [deprecated] R |
[memory area:]<address> <size> <data> [number of repeats] |
|
M |
[memory area:]<address> <size> <mask> <value> |
|
P |
<delay in ms> |
|
B |
|
|
I |
<op-code as HEX literal> |
|
C D [deprecated] |
<source> [memory area:]<address> <size> <data> <mask> <timeout> |
|
X |
[memory area:]<source address> <size> [memory area:]<destination address> |
Detailed description with an example:
<destination> [memory area:]<address> <size> <data> [number of repeats] |
A memory location, absolute addresses
R core register
[memory area:] |
Memory area specifies the name of the CPU’s memory space where the write is performed. The string specifying the area is CPU specific. For applicable values see Memory Spaces chapter. This parameter is optional. If omitted, the default SFR memory space is used.
<address> = <literal> | <register name> |
B 8-bit width
W 16-bit width
L 32-bit width
<data> = C number syntax literal |
Number of repeats is an optional parameter used for block writes, which specifies the number of times the data is written.
L size data repeated 5 times, writes 20 bytes. |
Examples:
S DEC L 0xFFFFFFFF // initialize DEC register |
Reads the memory location specified by the <address> and <size>, modifies the bits specified by <mask> to a <data> value and writes the modified value back to the same memory location.
Detailed description with an example:
M [memory area:]<address> <size> <mask> <value> |
Where:
[memory area:] |
Memory area specifies the name of the CPU’s memory space where the write is performed. The string specifying the area is CPU specific. For applicable values see Memory Spaces chapter. This parameter is optional. If omitted, the default SFR memory space is used.
<address> = <literal> | <register name> |
Example modifies the last 2 bits of the 32-bit value at 0x200080C4 to b’10’.
M 0x200080C4 L 0x00000003 0x00000002 |
Introduces a delay.
Detailed description with an example:
P <delay in ms> |
Example inserts a delay of 100ms:
P 100 |
Resets the CPU.
Executes a CPU instruction. No inline assembler is supported – the op-code must be specified in HEX format.
Detailed description with an example:
I <op-code as HEX literal> |
Example:
I 7C0007A4 // tlbwe |
Executes the 7C0007A4 opcode.
Polls a memory location until a specified bit is set.
Detailed description with an example:
<source> [memory area:]<address> <size> <data> <mask> <timeout> <source> = C | D |
C memory location, address offset is used
D memory location, absolute addresses
[memory area:] |
See Write Item.
<address> |
See Write Item.
<size> |
See Write Item.
<data> |
See Write Item.
<mask> |
Same format as <data>. winIDEA will repeat memory reads while:
(mem(address) & mask) != data |
Time in milliseconds to wait for completion.
Example:
C 0xE01FC084 W 0x200F 0xF0FF 500 |
reads 16 bit words from address E01FC084 for 500 ms, or until the read value is 0x200F
Reads value from some address and writes it to some other address.
Detailed description with an example:
X [memory area:]<source address> <size> [memory area:]<destination address> [memory area:] |
See Write Item.
<source address> <destination address> |
See Write Item <address>.
<size> |