Flasher/Controlling Flasher via U-Flash and J-Flash CLI

From SEGGER Wiki
Jump to: navigation, search

Introduction

The U-Flash executable (UniversalFlasher.exe) and J-Flash executable (JFlash.exe) are part of the Flasher Software and Documentation Pack. Both applications can be controlled via CLI, e.g. from within scripts, in order to automate the download of projects onto a Flasher which is connected via USB to the host computer.

U-Flash Command line options

This section lists and describes all available command line options. Some options accept additional parameters which are enclosed in angle brackets, e.g. <FILENAME>. If these parameters are optional they are enclosed in square brackets too, e.g. [<SADDR>]. Neither the angle nor the square brackets must be typed on the command line. They are used here only to denote (optional) parameters.

The command line options are evaluated in the order as they are passed to U-Flash, so please ensure that the project and data file have already been opened when evaluating a command line option which requires this.

It is recommended to always use

-openprj<PRJFILENAME> -opendat<FILENAME>[,<SADDR>]

to make sure the correct project and data files are opened.

All command line options return 0 if the processing was successfully. A return value unequal 0 means that an error occurred.

Option Description
-download Downloads the open project configuration to the Flasher.
-exit Exits U-Flash.
--help
-help
-h
Displays the help dialog.
-opendat <FILENAME>[,<SADDR>] Opens a data file.
-openprj <FILENAME> Opens an existing project.
-saveprjas <FILENAME> Saves the current data file in the specified file.
-savecfg <FILENAME> Saves the Flasher configuration file.
-savedat <FILENAME> Saves the Flasher data file.
-saveprj Saves the current project.
-saveprjas <FILENAME> Saves the current project in the specified file.

J-Flash Command line options

For the J-Flash command line options, please refer to UM08003_JFlash#Command_line_options.