FlasherControl

From SEGGER Knowledge Base
Jump to navigation Jump to search

FlasherControl is a command line utility that allows accessing the Flasher terminal via USB or IP, rather than COM port, RS232 or Telnet. It is part of the Flasher software package.

Purpose

FlasherControl is primarily intended for use with Flasher Compact in solitary mode (without Flasher Hub) or generally for troubleshooting when the terminal of Flasher is not available via other channels.
It also contains a rudimentary terminal mode, which makes the use of a special terminal program unnecessary in simple cases.

Several targets can be programmed simultaneously and in parallel by starting multiple instances of FlasherControl, each connected to a different Flasher.

Operation

Command line arguments

FlasherControl command line arguments
argument description
-USB Use Flasher with given serial number or nickname.
-IP Use Flasher with given hostname, serial number or nickname.
-P Select given project name before programming.
-I Interactive terminal-like mode.
-C The command to be sent to the Flasher to be executed instead of #auto. (Flasher commands has to be prefixed by #)
-T The program ends when the termination string is found in the Flasher response.
FlasherControl.exe command line parameters

Parameter USB

If more than one flasher is connected to the PC, this parameter can be used to specify which flasher is to be used. If it is omitted in such a case, a dialogue for selecting a Flasher is displayed to the user instead.

Syntax

-USB serial number
-USB nickname

Example

FlasherControl.exe -USB 844200006 …
FlasherControl.exe -USB MyFlasher

Parameter IP

If more than one flasher is connected to the PC, this parameter can be used to specify which flasher is to be used. If it is omitted in such a case, a dialogue for selecting a Flasher is displayed to the user instead.

Syntax

-IP hostname
-IP serial number
-IP nickname

Example

FlasherControl.exe -IP 192.168.10.19 …
FlasherControl.exe -IP 844200006 …
FlasherControl.exe -IP MyFlasher

Parameter I

This parameter causes the program to operate in interactive operation mode. If not specified, the program operates in automatic mode

Syntax

-I

Example

FlasherControl.exe -SN 844200006 -I

Parameter C

This parameter sets the command to send to Flasher, when operating in automatic mode. When omitted, #auto is used.

Syntax

-C #flasher command

Example

FlasherControl.exe -SN 844200006 -P boot.UNI -C #read

Parameter P

When using the #Automatic_mode the project name specified with this parameter is sent as #select before the command. This selects the project to use on Flasher. I.e. one must specify the name of the CFG file ('without extension '.cfg' for J-Flash projects or the name of the UNI file (with extension *.uni).

Syntax

-P project name

Example

FlasherControl.exe -SN 844200006 -P boot.UNI -C #read

Parameter T

When using the #Automatic_mode, this argument specifies the string when received from the flasher, the programme is terminated.

Syntax

-T termination string

Example

FlasherControl.exe -SN 844200006 -P boot.UNI -C #read -T ERR:

Operation modes

The FlasherControl program supports two modes of operation, automatic and interactive.

Interactive mode

The interactive mode is started by the call parameter -I.

FlasherControl.exe example for interactive mode

In interactive mode, a user can control the Flasher via the CLI as if it were a terminal program.

FlasherControl.exe example for interactive #read command

The interactive mode ends on reception of the BREAK signal followed by ENTER (CTRL-C, ENTER on most PC).

Automatic mode

In automatic mode a single command is sent to Flasher and the response from the Flasher is captured.

The command can be specified by the -C argument; #auto is sent by default.

FlasherControl.exe example for automatic mode with #auto command

Optionally an additional preceding #select command can be issued. This #select project name is set by -P project name

FlasherControl.exe example for automatic mode with pre-selected project

The capture ends - like in interactive mode - with BREAK signal followed by ENTER. Additionally it ends after reception of a response from Flasher containing the specified terminator. The terminator string can be specified by -T terminator string.

When the terminator is received, the processing of communication ends .

Post-processing output

All fetched content is output via STDOUT.

Additionally as state messages from FlasherControl itself are also output on STDERR.

To process the output of the Flasher the output can easily be redirected to files

FlasherControl.exe … >filename

or piped to other post-processing tools

FlasherControl.exe … | other post processing-tool

To process the FlasherControl state messages, STDERR can be redirected by 2>. Piping STDERR is a little bit more complicated. First redirect STDERR to STDOUT — the pipe; then redirect STDOUT to NUL (without changing where STDERR is going):

FlasherControl.exe … 2>&1 >NUL | other post processing-tool

Both redirection methods can be combined to fetch STDOUT and STDERR to separate files:

FlasherControl.exe … >stdout-filename 2>stderr-filename

To combined output before processing use following construction:

FlasherControl.exe … 2>&1 >combined-filename;