Table of Contents |
---|
...
press the "Script" button in the main dialog, and
append the option -rf <script file> to the executable.
Anchor | ||||
---|---|---|---|---|
|
...
11.1 Script button
The "Script" button is the dynamically programmable device action button that takes a selected script file and executes it. The Script button has a name "Script – none" (Figure 1011.1) if the script file is not defined or Script: <script file> when the script file is selected (Figure 1011.2). When the Script button is pressed and the script file not defined, the Open File dialog will be used to select a script file. When the Script file button is pressed and the script file is defined, the script till be executed. After that, a new script file can only be loaded using the pull down menu File→Open Script File.
The Script button is very useful for implementing a short programming sequence not present directly in the Device Action group buttons. Below is a sample script used for downloading two different code files to a target device - first code used for hardware test, and second code is the final user code. The same sequence
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
...
The script file above loads the first configuration file and the first code file into the programmer's data structures. The Auto Program function will flash the selected code file into the selected MCU based on given configuration settings. If the wrong MCU is selected, Vcc too low, or any of the Auto Program features fail, then the function will not succeed. The user can insert an "IF DONE" or "IF FAILED" line to interpret the Auto Program result. The script file then follows with a message box that lets the user decide if the final code should be programmed. If NO is clicked, the GOTO statement will jump to the "finish" label denoted by the special character ">". Some users add protection settings to disable debug access in the final Auto Program configuration to protect their code from end-user access, the specifics of which depend on the target MCU.
Before running the script file the configuration files named test.cfg and final.cfg required in the setup should be created using the GUI software first. To do that connect target devices to programming adapter, select desired configuration and save the configuration file as test.cfg and create final configuration file in a similar way.
Anchor | ||||
---|---|---|---|---|
|
...
11.2 Script file option
The script file can be automatically loaded by appending the option -rf <script file> to the executable file (described in the "Setup and Image Load and Save" chapter in more detail).
Briefly, when the executable FlashPro-ARM.exe is called with a script file as an option,
FlashPro-ARM.exe – rf C:\Program Files (x86)\Elprotronic\ARM\FlashPro-ARM\script.txt
access to other buttons is blocked. When the selected script file sequence is finished then the FlashPro-ARM GUI will close. There is not option to modify the running sequence when script sequence is used. This option can be useful in production since operators will not be able to modify prepared sequences.
Anchor | ||||
---|---|---|---|---|
|
...
11.2.1 Script Limitations
Up to a total of 1000 command lines can be used. Empty lines and comments are ignored.
The stack supports a call depth of up to 50 CALLs (CALL inside CALL inside CALL...).
Anchor | ||||
---|---|---|---|---|
|
...
11.2.2 Command Syntax
White spaces before instructions, labels, and comments are ignored.
; - start of a comment. All characters in the same line after the start of a comment are ignored.
...
A line with a label cannot also contain a command or another label.
For example, this would be illegal >START VCCOFF
Anchor | ||||
---|---|---|---|---|
|
...
11.2.3 Instructions
MESSAGE - message declaration. Contents must be placed between quotes below message declaration. Maximum of 50 content lines. Example:
...