Flasher Hub

From SEGGER Wiki
Revision as of 11:52, 14 March 2022 by Dirk (talk | contribs) (Web interface)
Jump to: navigation, search

This is the user documentation for owners of a SEGGER Flasher Hub.

SEGGER Flasher Hub

How Flasher Hub works

Example setup for Flasher Hub

Flasher Hub makes ultra-fast high speed parallel programming ("gang programming") with up to 24 channels possible.
Flasher Hub is connected to one or more modules (Flasher Compact). Each module is connected to a target chip.
Using one of the Flasher Hub's host interfaces, flash programming operations can be triggered and responses from the Flasher Hub can be read and evaluated.
This makes the Flasher Hub a perfect fit for small-scale as well as large-scale production environments.


Getting started

USB-C port on the Flasher Hub
Ethernet port on the Flasher Hub
USB ports on the Flasher Hub

Before putting the Flasher Hub into operation, make sure to have the following devices at hand:

The Flasher Hub is set up and good-to-go in less than 30 minutes

After making sure that the devices mentioned above are all available, the Flasher Hub can be setup:

  1. Connect Flasher Hub to power supply via USB-C
  2. Connect Flasher Hub to LAN via Ethernet cable
  3. Connect USB Hub to power supply
  4. Connect USB Hub to Flasher Hub via USB
  5. Connect Flasher Compact(s) to Flasher Hub via USB
  6. Wait for the Flasher Hub to finish booting (green LED stops flashing)
  7. Note the serial number of your Flasher Hub
  8. Open the Flasher Hub's web interface by visiting http://flasherhub-<SerialNo>/ (Make sure to replace <SerialNo> with the serial number of your Flasher Hub)
  9. Flasher Hub is now up and running


Preparing a module

One-time setup via J-Flash

Before a Flasher Hub module can program a target chip, it needs to know what data that should be programmed. Additionally, the module needs information on the configuration to use.
A module is prepared accordingly by downloading a Flasher data and configuration file pair into the module (.dat + .cfg files).
Both are generated using J-Flash, SEGGER's free multi-platform production programming software.
More information on J-Flash can be found on segger.com and the SEGGER Wiki

  1. Download and install the most recent version of the J-Link software package.
  2. Start J-Flash
  3. Create a new project
  4. Select a target device, target interface, target interface speed, ...
  5. Adjust the project settings as needed (see here for more information)
  6. Open the data file to be programmed in J-Flash (via drag-and-drop)
  7. File --> Save Flasher config file
  8. File --> Save Flasher data file
  9. File --> Save project
  10. Close J-Flash
  11. Make sure Flasher Hub is up and running and connected to the LAN
  12. Make sure the module that should be prepared is connected to Flasher Hub
  13. Connect to the Flasher Hub FTP server using a FTP Client (e.g. FileZilla)
  14. Download the .cfg and .dat file to the designated modules
  15. Done

After providing a Flasher Hub module with data and configuration file, the module is ready to be used for programming operations.

Starting production programming

PuTTY console output when programming via Flasher Hub

After preparing the Flasher Hub modules, the Flasher Hub is ready for production programming.
The following instructions describe how to start production programming via the TELNET terminal:

  1. Make sure the Flasher Hub is up and running and connected to the LAN
  2. Make sure the Flasher Hub modules are prepared with a .dat and .cfg file
  3. Make sure each Flasher Hub module is connected to its target chip
  4. Open a terminal application (e.g. PuTTY) on a desktop PC
  5. Connect to the Flasher Hub's TELNET terminal
    • Host name: flasherhub-<SerialNo>
    • Port: 23
  6. Upon successful connection, the Flasher Hub sends a welcome message
  7. Now commands can be sent to the Flasher Hub using the ASCII command protocol explained below
  8. Production programming is started by sending the AUTO command and specifying the positions of the modules to address
    • Enter #AUTO 1,2,3 to start production programming for the modules at positions 1, 2 and 3.
  9. The Flasher Hub will acknowledge the command (#ACK response)
  10. Now the production programming process is up and running
  11. As soon as a module finishes production programming, the Flasher Hub sends a response with the programming result (#RESULT:... response)
  12. After all modules are done programming, Flasher Hub responds with #DONE

Power supply

The Flasher Hub is powered via USB-C. The power supply must be able to supply up to 1A at 5V to the Flasher Hub.
Note:
Undefined behavior may occur when the Flasher Hub is not powered sufficiently.

The Flasher Compacts connected to the Flasher Hub via USB must be powered externally, e.g. via an externally powered USB hub.
Note:
Undefined behavior may occur when the Flasher Compacts are not powered sufficiently.

Web interface

Flasher Hub Web interface

The Flasher Hub comes with a built-in web interface which provides a status overview as well as controls for the Flasher Hub.
The web interface can be accessed by navigating to the following location using a web browser (e.g. Mozilla Firefox, Google Chrome, ...): http://flasherhub-<SerialNo>/

Note: The web interface is only available if the Flasher Hub is connected to the LAN.


FTP interface

FTP Client (FileZilla) connected to Flasher Hub FTP Server

The Flasher Hub comes with a built-in FTP server for transferring files from or to the Flasher Compacts connected to the Flasher Hub.
Any FTP client software (e.g. FileZilla, etc...) can be used to connect to the Flasher Hub's FTP server.

Host: flasherhub-<SerialNo>
Port: 21

Credentials for read-only access:
User: anonymous
Pass: <None>

Credentials for read/write access:
User: admin
Pass: 1234


ASCII command interface

The Flasher Hub comes with an ASCII command interface (aka. Terminal) which can be used to send commands to the Flasher Hub, as well as receive responses from the Flasher Hub.
The Terminal can be accessed by connecting to the Flasher Hub via TELNET:

Host: flasherhub-<SerialNo>
Port: 23

Once a successful connection to the Flasher Hub Terminal has been established, it will handle commands as described in the protocol below.

Protocol

Commands

Commands to the Flasher Hub
#AUTO
#AUTO NOPATCH
#AUTO PATCH
#CANCEL
#ERASE
#FWVERSION
#FWVERSIONMOD
#IPCONFIG
#POWERON
#POWEROFF
#PROGRAM
#PROTVER
#RESULT
#SELECT
#SETVTREF
#START
#STATUS
#VERIFY
#SELMODULE
#SERIAL
#SERIALMOD
#SETVTREF

Specifying modules

Most commands affect one or more modules connected to the Flasher Hub. Those commands expect the list of modules to address as the very first parameter following the command identifier itself, e.g.

#AUTO <Modules>

There are different ways to specify the list of modules to address.
Comma-separated list

#AUTO 1,3,5  // Starts production programming for modules 1, 3 and 5. Other modules are not affected by this command

"All"

#AUTO ALL    // Starts production programming for all currently connected modules

Wildcard (*)

#SELMODULE 2,4,6     // Selects modules 2, 4 and 6 for following operations using '*'
[...]
#AUTO *              // Starts production programming for all previously selected modules (2, 4 and 6)
[...]
#SELMODULE 10,11,12  // Selects modules 10, 11 and 12 for following operations
[...]
#AUTO *              // Starts production programming for all previously selected modules (10, 11 and 12)

AUTO Command

Description: Starts production programming. Production programming refers to a sequence of the following operations, specified by the current configuration (.cfg):

  • Erase
  • Program
  • Verify

Syntax:

#AUTO <Modules>

Parameters:

Parameter Description
<Modules> List of modules to start production programming with

Example:

Command sent to Flasher Hub Reply
#AUTO 1,2
#ACK
#RESULT:1:OK (Total 13.993s, Erase 0.483s, Prog 9.183s, Verify 2.514s)
#RESULT:2:OK (Total 13.995s, Erase 0.483s, Prog 9.189s, Verify 2.510s)
#DONE

AUTO NOPATCH Command

Description: Starts production programming but ignores an existing patch file for the programming.

Syntax:

#AUTO NOPATCH <Modules>

Parameters:

Parameter Description
<Modules> List of modules to start production programming with

Example:

Command sent to Flasher Hub Reply
#AUTO NOPATCH 1,2
#ACK
#RESULT:1:OK (Total 13.993s, Erase 0.483s, Prog 9.183s, Verify 2.514s)
#RESULT:2:OK (Total 13.995s, Erase 0.483s, Prog 9.189s, Verify 2.510s)
#DONE

AUTO PATCH Command

Description: Starts production programming and allows patching of the content of the data to be programmed.

Syntax:

#AUTO PATCH <Modules> <NumPatches>,<Addr>,<NumBytes>:[,...]


Parameters:

Parameter Description
<Modules> List of modules to start production programming with
<NumPatches> Number of patches that follow
<Addr> Address to be patched. Value is expected in hex
<NumBytes> Number of bytes for the current patch. Max. value is 20h (32 in decimal). Value is expected in hex
<Data> Data to be patched. Value is expected in hex, e.g. 2 hexadecimal characters per byte (0xAB 0xCD --> "ABCD").
... <Next patch information>

Example:

Command sent to Flasher Hub Reply
#AUTO PATCH 1 1,08000000,4:DEADBEEF
#ACK
#RESULT:1:OK (Total 10.476s, Erase 8.293s, Prog 1.832s, Verify 0.137s)
#DONE

CANCEL Command

Description: Cancels an ongoing operation (e.g. erase, program, verify, ...).

Syntax:

#CANCEL <Modules>

Parameters:

Parameter Description
<Modules> List of modules to cancel ongoing operation for.

Example:

Command sent to Flasher Hub Reply
#AUTO 1
#ACK
#CANCEL 1
#ACK
#RESULT:1:ERR255:Error while flashing
#DONE

ERASE Command

Description: Erases all selected target flash sectors.

Syntax:

#ERASE <Modules>

Parameters:

Parameter Description
<Modules> List of modules to erase all selected target flash sectors for.

Example:

Command sent to Flasher Hub Reply
#ERASE 1,2
#ACK
#RESULT:1:OK (Total 2.164s, Erase 1.936s)
#RESULT:2:OK (Total 8.780s, Erase 8.552s)
#DONE

FWVERSION Command

Description: Returns the firmware version of the Flasher Hub.

Syntax:

#FWVERSION

Example:

Command sent to Flasher Hub Reply
#FWVERSION
#ACK
#OK:1.00
#DONE

FWVERSIONMOD Command

Description: Returns the firmware version for the specified modules.

Syntax:

#FWVERSIONMOD <Modules>

Parameters:

Parameter Description
<Modules> List of modules to return firmware version for.

Example:

Command sent to Flasher Hub Reply
#FWVERSIONMOD 1,2
#ACK
#OK:1:J-Link / Flasher Compact V5 compiled Feb 3 2021 10:44:44
#OK:2:J-Link / Flasher Compact V5 compiled Feb 3 2021 10:44:44
#DONE

IPCONFIG Command

Description: Returns the Flasher Hub's current IP configuration.

Syntax:

#IPCONFIG

Example:

Command sent to Flasher Hub Reply
#IPCONFIG
#ACK
#RESULT:IP address:192.168.11.35
#RESULT:Subnet mask:255.255.0.0
#RESULT:Gateway:0.0.0.0
#RESULT:IP mode:User assigned
#DONE

POWERON Command

Description: Enables the Flasher Compact's 5V target power supply for the given modules.

Syntax:

#POWERON <Modules> <PowerSource>,<Discharge>

Parameters:

Parameter Description
<Modules> List of modules to enable target power supply for.
<PowerSource> Must be 0. Parameter exists to stay compatible to Flasher ATE, which supports different power sources.
<Discharge> Must be 0. Parameter exists to stay compatible to Flasher ATE, which supports discharging target power.

Example:

Command sent to Flasher Hub Reply
#POWERON 1 0,0
#ACK
#DONE

POWEROFF Command

Description: Disables the Flasher Compact's 5V target power supply for the given modules.

Syntax:

#POWEROFF <Modules>

Parameters:

Parameter Description
<Modules> List of modules to disable target power supply for.

Example:

Command sent to Flasher Hub Reply
#POWEROFF 1
#ACK
#DONE

PROGRAM Command

Description: Programs the target. Other than #AUTO, this command does not erase nor verify target flash contents.

Syntax:

#PROGRAM <Modules>

Parameters:

Parameter Description
<Modules> List of modules to start programming for.

Example:

Command sent to Flasher Hub Reply
#PROGRAM 1,2
#ACK
#RESULT:1:OK (Total 2.076s, Prog 1.833s)
#RESULT:2:OK (Total 2.132s, Prog 1.888s)
#DONE

PROTVER Command

Description: Returns the version of the ASCII command protocol in use.

Syntax:

#PROTVER

Example:

Command sent to Flasher Hub Reply
#PROTVER
#ACK
#OK:2.02b
#DONE

RESULT Command

Description: Returns the last result of the previously executed command

Syntax:

#RESULT <Modules>

Parameters:

Parameter Description
<Modules> List of modules to return result for.

Example:

Command sent to Flasher Hub Reply
#RESULT 1,2
#ACK
#RESULT:1:OK (Total 2.076s, Prog 1.833s)
#RESULT:2:OK (Total 2.132s, Prog 1.888s)
#DONE

SELECT Command

Description: Selects a specific config and data file pair which should be used to program the target.

Syntax:

#SELECT <Modules> <Filename>

Parameters:

Parameter Description
<Modules> List of modules to select .cfg + .dat file pair for.
<Filename> Name of .cfg + .dat file pair to select.

Example:

Command sent to Flasher Hub Reply
#SELECT 1,2 FWTest
#ACK
#RESULT:1:OK
#RESULT:2:OK
#DONE

SETVTREF Command

Description: Sets a fixed voltage for I/O pins of the Flasher Compact's target interface.

Syntax:

#SETVTREF <Modules> <Voltage>

Parameters:

Parameter Description
<Modules> List of modules to set VTref for.
<Voltage> Voltage in millivolt [mV].

Example:

Command sent to Flasher Hub Reply
#SETVTREF 1 3300
#ACK
#DONE

START Command

Description: Starts the target application. The Flasher Compact's configuration (.cfg file) determines the method of how the target application is started.

Syntax:

#START <Modules>

Parameters:

Parameter Description
<Modules> List of modules to start target application for.

Example:

Command sent to Flasher Hub Reply
#START 1
#ACK
#RESULT:1:OK (Total 0.252s)
#DONE

STATUS Command

Description: Returns the current status of the Flasher Hub (READY or BUSY).

Syntax:

#STATUS

Example:

Command sent to Flasher Hub Reply
#STATUS
#ACK
#STATUS:READY

VERIFY Command

Description: Verifies target flash contents by comparing them to the data (.dat) file.

Syntax:

#VERIFY <Modules>

Parameters:

Parameter Description
<Modules> List of modules to verify target flash contents for.

Example:

Command sent to Flasher Hub Reply
#VERIFY 1,2
#ACK
#RESULT:1:OK (Total 0.331s, Verify 0.117s)
#RESULT:2:OK (Total 0.332s, Verify 0.117s)
#DONE

SELMODULE Command

Description: Selects one or more modules. Commands with the wildcard character (*) in place of the <Modules> parameter will address the modules specified by this command.

Syntax:

#SELDMOULE <Modules>

Parameters:

Parameter Description
<Modules> List of modules to select.

Example:

Command sent to Flasher Hub Reply
#SELMODULE 1,2,3
#ACK
#SELECTED:1,2,3

SERIAL Command

Description: Returns the serial number of the Flasher Hub.

Syntax:

#SERIAL

Example:

Command sent to Flasher Hub Reply
#SERIAL
#ACK
#RESULT:1021000000
#DONE

SERIALMOD Command

Description: Returns the serial number for the specified modules.

Syntax:

#SERIALMOD <Modules>

Parameters:

Parameter Description
<Modules> List of modules to select.

Example:

Command sent to Flasher Hub Reply
#SERIALMOD 1,2
#ACK
#OK:1:1015000000
#OK:1:1015000001
#DONE

Replies

Replies from the Flasher Hub
#ACK
#NACK
#OK
#OK:<NumBytes>:
#OK:
#OK:<Module>:
#RESULT:<Module>:
#DONE
#ERRxxx

Fail-safe mode

Flasher Hub's fail-safe mode was introduced with Flasher Hub firmware version 1.08 and makes Flasher Hub more reliable in case of a power outage.
Early units of Flasher Hub run the risk of "breaking" after a power outage while running (e.g. due to disconnecting the power supply).
After that, Flasher Hub could not be used anymore without restoring it as described below.

New Flasher Hubs are now shipped with a USB flash drive which enables Flasher Hub's fail-safe mode,
making sure Flasher Hub does not break with sudden power outages.

For early units of Flasher Hub that were produced and shipped before fail-safe mode was introduced (e.g. no USB flash drive was shipped with Flasher Hub),
fail-safe mode can be enabled as described below.

How to restore a broken Flasher Hub

In case a Flasher Hub became unreachable following a power outage while running in non fail-safe mode, the following steps describe how to restore the Flasher Hub:

  1. Remove power supply from Flasher Hub
  2. Remove any cables attached to Flasher Hub
  3. Using a Phillips screwdriver, remove the one screw at the top and the four screws on the bottom of the Flasher Hub casing
  4. Remove the separate parts of Flasher Hubs' casing and put them aside
  5. Remove the SD card from the PCB
  6. Using an SD card reader and a PC, read back the contents of the SD card (e.g. using Win32DiskImager on a PC running Windows)
  7. Write the exact same contents that were read from the SD card back onto the SD card
    • Make sure not to modify the contents at all!
  8. Put the SD card back into the PCB
  9. Reassemble the Flasher Hub casing
  10. Power Flasher Hub
  11. Reattach USB/ Ethernet/ ... cables, if necessary
  12. Flasher Hub is now restored

How to enable fail-safe mode

For Flasher Hub units that were shipped with a USB flash drive, fail-safe mode is enabled by default.
For early units of Flasher Hub that were produced and shipped before fail-safe mode was introduced (e.g. no USB flash drive was shipped with Flasher Hub), fail-safe mode can be enabled by following the steps below.

Note:
When switching to fail-safe mode, the current configuration is lost.
This means that the module positioning and other settings need to be manually checked and reconfigured.
  1. Update Flasher Hub's firmware to the most recent release version available at segger.com
  2. Get a USB flash drive
    • A capacity of a few MB (e.g. 128 MB) is sufficient already
  3. Format the USB flash drive
    • Make sure to use a file system other than exFAT.
  4. Rename the USB flash drive label to "flasherhubrw"
    • On Windows, this can be done by right-clicking on the device in file explorer and selecting Rename
  5. Eject and remove the USB flash drive from the PC
  6. Attach the USB flash drive to Flasher Hub
    • The USB flash drive does not need to be directly attached to Flasher Hub. It is also possible to connect it via a USB hub.
  7. In the Flasher Hub web interface Config tab, click "Restart now" to restart Flasher Hub
  8. Flasher Hub is now running in fail-safe mode, storing any non-volatile data on the external USB flash drive
Note:

Although possible, it is not recommended to switch back to non-fail-safe mode.

This puts the Flasher Hub unit at risk of breaking after a power outage.