GangFlasher-ST CLI

Gang Flasher-ST CLI(command line interface) allow to programming STM32 MCUs with using only command line. The following sections describe how to use the GangFlasher-ST from the command line , describle posible commands arguments and show in exaples how to use it.

 

List of supported commands

List of all available commands(with all options) are shown in Figure 1.

Figure 1. GangFlasher-ST:avalilable commands.

Command description

There are two types of command arguments - required argument( always needed to perform any operation) and optional arguments needed olny in specific situation.

Syntax:
GangFlasher-CLI [Optional Settings] -target_cfg <setup filepath> or

GangFlasher-CLI -target_cfg <setup filepath> [Optional Settings]

Below is description of all possible command arguments.

Required argument

-target_cfg <setup filepath>Path to setup file created in GUI that has the target parameters and other information. How to save config file is shown in Figure 2.(File ->Save Setup as…).

Figure 2. Save config file.

Optional Settings


-usb_cfg <usb setup filepath> : Path to USB configuration file created in GUI that specifies a fixed USB PORT/HUB allocation. With no usb assignment file, F_USBAutoScanAndAssign() will be called to auto assign boards for programming. How to save USB configuration is shown in Figure 3. (File ->Save USB Configuration as…).


-tsv <tsv filepath>: Path to TSV file from ST that has the list of partitions to be created and file to be programmed - support olny STM32MP1.
-otp <otp filepath>: Path to OTP file. OTP programming must be turned on in the target_cfg file for this file to be used - support olny STM32MP1.
-ssp <ssp filepath>: Path to SSP (Secret Secure Provisioning) for programming of OEM secrets into STM32MP1 one time programming(OTP) area in a secure way support olny STM32MP1.
-tfa_ssp <tfa_ssp filepath>: Path to TFA-SSP first stage bootloader for programming of OEM secrets into STM32MP1 one time programming(OTP) area in a secure way - support olny STM32MP1.
-fsbl <fsbl filepath>: Path to first stage bootloader (TF-A) - support olny STM32MP1.
-ssbl <ssbl filepath>: Path to secondary stage bootloader (U-Boot) - support olny STM32MP1.
-hsm <slot id>: Read data from HSM Card.
-cmd <index> : Command to perform (default: F_Connect()).

1 : F_AutoProgram()
2 : F_Connect() - default
3 : F_Load_OS() - support olny STM32MP1
4 : F_Write()
5 : F_Verify()
6 : F_Read()
7 : F_OTP_Write()
8 : F_OTP_Verify()
9 : F_OTP_Read()
10 : F_TrustedWrite() - support olny STM32MP1
11 : F_Read_HSM(slot_id)
12 : F_Erase_All -not supported for STM32MP1
13 : F_ClearProtRegs -not supported for STM32MP1

-of <filename> : send output to file with path <filename>.

Example usage

In the following sections shown in examples how to use GangFlasher-ST command line interface.

Test connection

GangFlasher-CLI -target_cfg setup_file.cfg

or GangFlasher-CLI -target_cfg setup_file.cfg -cmd 2

Description: Test connection via USB-dfu with MCU’s . Selected MCU’s is set in setup_file.cfg file. Output from command line interface is shown in Figure 4.

Command arguments:

  • target_cfg <setup filepath>: - path to setup file created in GUI that has the target parameters and other information;

  • cmd 2: optionaly agrument during connect operation(default cmd value is 2 - F_Connect()).

Autoprogram

GangFlasher-CLI -target_cfg setup_7targets.cfg -usb_cfg usb_loc.cfg -cmd 1

Description: Program the content of the specified binary file into device memory. The
programing operation is preceded by the erase operation before the Flash memory is
programmed . After programing memory is verify. Binary file, target MCUs and USB locations are set in setup_7targets.cfg file and usb_loc.cfg file. Output from command line interface are shown in Figure 5. (general report for all targets) and Figure 6.(detailed report for one of all targets).

Command arguments:

  • target_cfg <setup filepath>: path to setup file created in GUI that has the target parameters and other information;

  • usb_cfg <usb setup filepath>: path to USB configuration file created in GUI(Figure 3.) that specifies a fixed USB PORT/HUB allocation;

  • cmd 1: selected F_AutoProgram() operation.

 

Load OS(STM32MP1 olny)

GangFlasher-CLI -target_cfg setup_mp1.cfg -cmd 3

Description: Install necessary to program memory, ST Linux OS on the STM32MP1 board. Output from command line shown in Figure 7.

Command arguments:

  • target_cfg <setup filepath>: path to setup file created in GUI that has the target parameters and other information;

  • cmd 3: selected F_Load_OS() operation.

Autoprogram STM32MP1

GangFlasher-CLI -target_cfg setup_mp1.cfg -tsv<tsv filepath> -cmd 1 or

GangFlasher-CLI -target_cfg setup_mp1.cfg -cmd 1

Description: Program the content of the specified binary files into device memory. The programing operation is preceded by the erase and patrication operation before the device memory is programmed. After programing memory is verify. Target MCUs set in setup_mp1.cfg file. TSV file set by -tsv command, instead that TSV file can be set in setup file and skip that argument. Output from command line shown in Figure 8.

Command arguments:

  • target_cfg <setup filepath>: path to setup file created in GUI that has the target parameters and other information;

  • tsv <tsv filepath>: path to TSV file from ST that has the list of partitions to be created and file to be programmed

  • cmd 1: selected F_AutoProgram() operation.