Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.241

winIDEA Initialization Files

In this topic:

Preprocessor

Item Types

Write Item

Modify Item

Pause Item

Reset Item

Instruction Item

Poll Item

Copy Item

 

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 menu / CPU Options / Reset page.

 

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

 

 

Preprocessor

C-like pre-processor is used.

 

Aliases

#define <alias> <value>

 

Example:

#define SP Supervisor
#define ALL_ONES 0xFFFFFFFF
#define ALL_ZERO 0x00000000

 

 

Comments

Multiline comments

Standard C /*  */ multi-line comments are supported.

Example:

/* this is a begin of a multi-line comment
This is the end */

 

End of line comments

Double forward-slash characters are interpreted as end of line comments.

Example:

#define SP Supervisor // this is a comment

 

 

Tokens with Spaces

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

 

 

Item Types

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

Write

A

S [deprecated]

R

[memory area:]<address> <size> <data> [number of repeats]

Modify

M

[memory area:]<address> <size> <mask> <value>

Pause

P

<delay in ms>

Reset

B

 

Instruction

I

<op-code as HEX literal>

Poll

C

D [deprecated]

<source> [memory area:]<address> <size> <data> <mask> <timeout>

Copy

X

[memory area:]<source address> <size> [memory area:]<destination address>

 

 

Write Item

Write item causes a target location to be written.

Detailed description with an example:

<destination> [memory area:]<address> <size> <data> [number of repeats]
<destination> = A | R

 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>
  <literal> = C number syntax literal
  <register name> = name of the register as displayed in the SFR window
  <size> = B | W | L

 

 B        8-bit width

 W        16-bit width

 L        32-bit width

<data> = C number syntax literal
[number of repeats]

 

Number of repeats is an optional parameter used for block writes, which specifies the number of times the data is written.

Warning_orange

L size data repeated 5 times, writes 20 bytes.

 

Examples:

S DEC L 0xFFFFFFFF     // initialize DEC register
S 0x40000000 L 0x0 0x4000   // write 16k * 32-bit = 64kB of zeros
R R3 L 0x12345678           // store 0x12345678 in the R3 core register

 

Modify Item

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>
     <literal> = Hexadecimal value prefixed with 0x
     <register name> = name of the register as displayed in the SFR window
  <size> = B | W | L
     B        8-bit width
     W        16-bit width
     L        32-bit width
  <mask> = Hexadecimal value prefixed with 0x, only set bits will be modified
  <data> = Hexadecimal value prefixed with 0x

 

Example modifies the last 2 bits of the 32-bit value at 0x200080C4 to b’10’.

M 0x200080C4 L 0x00000003 0x00000002

 

Pause Item

Introduces a delay.

Detailed description with an example:

P <delay in ms>

 

Example inserts a delay of 100ms:

P 100

 

 

Reset Item

Resets the CPU.

 

Instruction Item

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.

 

Poll Item

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
   <timeout>

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

 

 

Copy Item

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>

 

Copyright © 2024 TASKING Germany GmbH