Flasher/How to command the Flasher

From SEGGER Wiki
Jump to: navigation, search

This guide explains how to command the flasher and trigger an operation like the #AUTO command for one of the standalone Flasher projects available on the Flasher. There are many ways to command the Flasher, some that work only manually like pressing the PROG Button, and some that can be automated even without the use of a computer.

Requirements

This guide requires a ready to use standalone project configuration on the Flasher. If you need to create a project configuration first, please refer to Flasher/How to create a project configuration.

Command interfaces

Commanding the Flasher can be classified into several categories of interfaces that can be used:

  • The PROG button
  • The command line interface (CLI)
  • The built-in web interface
  • The handshake protocol
  • The automatic mode (in development)

All of them can be used to trigger an operation on the Flasher. However, if an interface can be used depends on the Flasher model, since not all models provide all interfaces. For more information about the Flasher models and supported interfaces to trigger programming, please refer to the model comparison table on https://www.segger.com/products/flasher-in-circuit-programmer.

The PROG button

This is the easiest way to trigger the #AUTO command for the currently active Flasher project as it only requires pressing the PROG button on the Flasher. As only the #AUTO command can be triggered with the PROG button, the Flasher project must be configured accordingly to perform all the desired tasks when #AUTO is triggered. If a Flasher Portable PLUS is used, the SEL button can be used to select another Flasher project available on the Flasher as the active one. Else, the #SELECT command must be sent via CLI or the Flasher.ini has to be edited manually to change the active Flasher project.

The command line interface (CLI)

The command line interface is a text-based terminal that can be used to command the Flasher.

A list of the available commands can be found in the Flasher manual: UM08022_Flasher#Commands and replies

The command line interface can be accessed via the following interfaces:

  • Serial interface via RS-232 or VCOM
  • A Telnet connection via Ethernet
  • A special protocol used by the J-Link DLL via USB
  • SSH (in development)

RS-232 and VCOM

This requires a Flasher with either a DE-9 or USB connector. If connected via USB, the Flasher will enumerate as a virtual serial port. A command can then be sent using any application allowing to send data via a serial communication interface, e.g. PuTTY. Alternatively, built-in system utilities of an operating system can be used to send and receive data via a serial port.

Windows

REM Send #AUTO command
echo #AUTO > COM1
REM Read reply
type < COM1

Linux

# Send #AUTO command
echo #AUTO > /dev/serial1
# Read reply
tail -f /dev/serial1

For more information on how to access the terminal via RS-232 and VCOM please refer to UM08022_Flasher#Settings for ASCII interface via RS232.

Telnet

For information on how to connect to a Flasher connected via Ethernet to a network please refer to UM08022_Flasher#Settings for ASCII interface via Telnet.

J-Link DLL

The J-Link DLL can be used either with FlasherControl or by using the J-Link SDK.

Built-in web interface

The Flasher Hub and Flasher Hub-12 come with a built-in web server that allows to trigger programming on the Flasher. For more information please refer to Flasher Hub User Manual (UM08039) or Flasher Hub-12 User Manual (UM08043).

Handshake protocol

For more information about the handshake protocol please refer to UM08022 Flasher#Handshake control.

Automatic mode

The automatic mode is a feature currently in development which triggers the #AUTO operation when the Flasher senses a corresponding voltage on the VTref line. This allows to command the Flasher by simply powering the target device for a certain period of time.