Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...


Anchor
_Toc452148569
_Toc452148569
Figure 11.1: Script file not defined.


Anchor
_Toc452148570
_Toc452148570
Figure 11.2: Script file active. can be used with other buttons. Using a text editor create a script file and save it as a file, for example, "test.sf" or any other file name. See this chapter below for all available

...


VCCINMV <mV> - Set Vcc in mV, from 1800 to 4000, in steps of 100.
RESET - Perform hard RESET function from main dialog screen, requires connected RST line.
AUTOPROGRAM - Perform "AUTO PROG." function from main dialog screen.
VERIFYACCESS - Perform "VERIFY ACCESS" function from main dialog screen.
ERASEFLASH - Perform "ERASE FLASH" function from main dialog screen.
BLANKCHECK - Perform "BLANK CHECK" function from main dialog screen.
WRITEFLASH - Perform "WRITE FLASH" function from main dialog screen.
VERIFYFLASH - Perform "VERIFY FLASH" function from main dialog screen.
READFLASH - Perform "READ FLASH" function from main dialog screen.
READSN – Read serial number and label only.
LOCK - Perform "Lock Device" function from main dialog screen.
UNLOCK - Perform "Clear Locked Device" function from main dialog screen.
TRACEON <filename> - Enable tracing and log to the selected filename. This option is useful for debugging. The trace file will contain the sequence of all executed commands ran from the script file annotated with line numbers. Line numbers are counted without empty lines and without lines only containing comments.
TRACEOFF - Disable tracing.
OPEN_TARGET - Power-on device, initialize communication, set MCU clock frequency to default for programming.
CLOSE_TARGET - Close communication, and power-down device.

These operations can be used for debugging, control flow, and setting adapter pins:
OPEN_COMMS - Only initialize JTAG/SWD communication, does not affect power or other settings.
SOFT_RESET - Reset using AIRCR register.
HARD_RESET - Reset using hardware RST line.
OPCODE_SETBOOT0HIGH - Set BOOT0 pin high - Pin TEST/TRST (8)
OPCODE_SETBOOT0LOW - Set BOOT0 pin low - Pin TEST/TRST (8)
OPCODE_SETBOOT0FREE - Set BOOT0 pin Tri-State - Pin TEST/TRST (8)
CMP_W_TIMEOUT <timeout> <addr> <mask> <value>- A function that will check a value in a loop until pass value has be found. Useful for waiting for a flag to be set. //while((*addr & mask) != value)) break after timeout or success

The script executor has 8 (eight) uint32_t registers used for internal storage (REG_0-REG_7), and one boolean register for control flow:
SETREG <param1> <param2> - Register PARAM1 (REG_0-REG_7) set with value PARAM2 (uint32_t)
SETBOOL <param1>- bool reg = PARAM1: true/false
INVBOOL - invert bool reg value: no params
MOVEREG <param1> <param2> - move register values - PARAM1 = PARAM2: target reg, source reg
MEMTOREG <param1> <param2> - load target memory to register - PARAM1 = *((uint32_t *)(PARAM2)): address, reg
MEMTOREGGANG <param1> <param2> (GANG only) - load memory from all 6 targets to registers - read from up to 6 targets and save in 6 regs.

Call: MEMTOREGGANG <address> <first reg index (6 in total will be written in series).. REG_start, ...REG_start+5>, i.e.
MEMTOREGGANG 0x1FFF8070 REG_2 - load value at 0x1FFF8070 from each target to registers (REG_2-REG_7)
REGTOMEM <param1> <param2> - save register to address in target - *((uint32_t *)(PARAM2)) = PARAM1 (PARAM1 is register index)
VALTOMEM <param1> <param2> - save value to address in target - *((uint32_t *)(PARAM2)) = PARAM1 (PARAM1 is hex value uint32_t)
PRINTREG <param1> - print uint32_t register value given by index PARAM1 (must be between REG_0-REG_7)
PRINTBOOL - print boolean register value

Register manipulations on the 8 (eight) uint32_t registers used for internal storage (REG_0-REG_7):
ADD <param1> <param2> - Reg[PARAM1] = Reg[PARAM1] + Reg[PARAM2]
SUB <param1> <param2> - Reg[PARAM1} = Reg[PARAM1] - Reg[PARAM2]
MULT <param1> <param2> - Reg[PARAM1} = Reg[PARAM1] * Reg[PARAM2]
AND <param1> <param2> - Reg[PARAM1} = Reg[PARAM1] & Reg[PARAM2]
OR <param1> <param2> - Reg[PARAM1} = Reg[PARAM1] | Reg[PARAM2]
XOR <param1> <param2> - Reg[PARAM1} = Reg[PARAM1] XOR Reg[PARAM2]
SHIFTL <param1> <param2> - Reg[PARAM1] = Reg[PARAM1] << PARAM2 (value)
SHIFTR <param1> <param2> - Reg[PARAM1] = Reg[PARAM1] >> PARAM2 (value)

...