How to install and use the CLI Flasher?



Get / install the CLI Flasher

Download the CLI Flasher

Unzip the CLI Flasher

USB driver for Windows

Download the USB driver.

Install the USB driver

udev rules for Linux

Apply the udev rules from this page udev rules

CLI Flasher starting with version 2.x.x

Verify communication with netX

Put the netX hardware into boot mode and connect it to the PC. Change into the directory, where the flasher is located. Open a command line and enter the following command:

cd ...\flasher_cli-2.0.2-windows_x86_64\flasher_cli-2.0.2>

lua5.4.exe cli_flash.lua info <Enter>

A list similar to the one below should appear:

Please select the interface: 1: romloader_uart_COM3 (romloader_uart) Used: false, Valid: true 2: romloader_uart_COM4 (romloader_uart) Used: false, Valid: true 3: romloader_uart_COM6 (romloader_uart) Used: false, Valid: true 4: romloader_jtag_netX90_COM@NXHX_90-JTAG@3:2,3,1,1,4 (romloader_jtag) Used: false, Valid: true R: rescan C: cancel >

It should contain an entry with the interface the netX is connected to. Enter the number of this entry and press Enter.

Some more output should appear, ending with:

Board info: Bus 1: Serial Flash Unit 0: SQI Unit 1: SPI0_APP Unit 2: SPI1_APP Unit 3: SPI2_APP Bus 2: Internal Flash Unit 0: IFLASH0 Unit 1: IFLASH1 Unit 2: IFLASH2 Unit 3: IFLASH01

 

If it does, the PC can communicate with the netX.

Get help

The commands

  • lua5.4.exe cli_flash.lua --help

  • lua5.4.exe wfp.lua --help

  • lua5.4.exe usip_player.lua --help

provide help for the implemented features.

 

Usage: Cli Flasher [-v] [-h] <command> ... Options: -v, --version Show version info and exit. -h, --help Show this help message and exit. Commands: flash, f Flash a file to the netX read, r Read data from netX to a File erase, e Erase area inside flash verify, v Verify that a file is flashed verify_hash, vh Quick compare using checksums hash, h Compute SHA1 detect, d Check if flash is recognized test, t Test flasher testcli, tc Test cli flasher info, i Show information about the netX list_interfaces, li List all connected interfaces detect_netx, dn Detect if an interface is a netX detect_secure_boot_mode, dsbm Detect if secure boot is enabled (netX 90 only) reset_netx, rn Reset the netX identify_netx, in Blink SYS LED for 5 sec check_helper_version, chv Check that the helper files have the correct versions check_helper_signature, chs Verify the signatures of the helper files. Limitations: There are several commands that are only valid for the netX 90: check_helper_version check_helper_signature detect_secure_boot_mode Likewise, the optional arguments for secure boot mode are only valid for the netX 90: --sec --comp --disable_helper_signature_check The reset_netx command currently supports only the netX 90. The hash and verify_hash commands do not support the netIOL. Examples: Write file to serial flash: lua cli_flash.lua flash -b 1 NETX100-BSL.bin Erase boot cookie from serial flash: lua cli_flash.lua erase -b 1 -l 4 Erase boot cookie from parallel flash: lua cli_flash.lua erase -b 0 -l 4

Further details will be received with the command specific help

lua5.4.exe cli_flash.lua detect -h

 

The parameters to the various flashing operations should be clear, except how to specify the destination device.
It consists of three parameters:

  • bus (-b ): MANDATORY: selects between different flash types at different memory interfaces

  • unit (-u ): OPTIONAL default 0: selects one out of several interfaces of the same types (e.g. from multiple SPI interfaces)

  • chip select (-c ): OPTIONAL default 0: selects one out of several available chip select lies on the same interface.

The serial flash on a netX 90 is bus 1, unit 0, chip select 0 by default.

lua5.4.exe cli_flash.lua detect -b 1

attempts to detect the serial flash connected to the netX.

 

Example result if successful:

 

Examples

Flash the file "firmware.bin" to bus 1, unit 0, chip select 0 and offset 0:

lua5.4.exe cli_flash.lua flash -b 1 -u 0 -c  0 firmware.bin

Flash the file "firmware.bin" to bus 1, unit 0, chip select 0 and offset 0x1000:

lua5.4.exe cli_flash.lua flash -b 1 -u 0 -c  0 -s 0x1000 firmware.bin

netX 90: write into internal flash

  • parameter cs is always 0 to access the main flash content

COM side: at offset 0x3000

lua5.4.exe cli_flash.lua flash -b 2 -u 3 -c  0 -s 0x3000 firmware_com.bin

APP side: at offset 0x0000

lua5.4.exe cli_flash.lua flash -b 2 -u 2 -c  0 -s 0x0000 firmware_app.bin

netX 90: write into external flash

  • parameter c depends on the extern circuitry at the PCB. Most times it is C 0

at offset 0x0000

lua5.4.exe cli_flash.lua flash -b 1 -u 0 -c  0 -s 0x0000 firmware_com_extented.bin

at offset 0x0030 0000 (3MByte)

lua5.4.exe cli_flash.lua flash -b 1 -u 0 -c  0 -s 0x00300000 firmware_app_extented.bin

CLI Flasher before version 2.x

Verify communication with netX

Put the netX hardware into boot mode and connect it to the PC. Change into the directory, where the flasher is located. Open a command line and enter the following command:

cd ...\flasher_cli-1.6.0-windows_x86_64\flasher_cli-1.6.0

lua5.1.exe cli_flash.lua info <Enter>

A list similar to the one below should appear:

Note: Starting with (internal) version 1.5.3, USB-JTAG interfaces have a suffix starting with "@". It specifies the position of the adapter in the USB port hierarchy and allows distinguishing multiple adapters that are of the same type and are connected to the same type of target.

It should contain an entry with the interface the netX is connected to. Enter the number of this entry and press Enter.

Some more output should appear, ending with:


If it does, the PC can communicate with the netX.

Get help

The command
        lua5.1.exe cli_flash.lua -h
shows a command overview.



The parameters to the various flashing operations should be clear, except how to specify the destination device.
It consists of three parameters:

  • bus (-b ): MANDATORY: selects between different flash types at different memory interfaces

  • unit (-u ): OPTIONAL default 0: selects one out of several interfaces of the same types (e.g. from multiple SPI interfaces)

  • chip select (-cs ): OPTIONAL default 0: selects one out of several available chip select lies on the same interface.

The serial flash on a netX 100/500 is bus 1, unit 0, chip select 0 by default.

lua5.1.exe cli_flash.lua detect -b 1 -u 0 -cs  0

attempts to detect the serial flash connected to the netX.

Result if successful:

Flashing a file

To flash a file to a device, the mode is set to "flash".

The default offset in the flash is 0, which is the start of the flash area. This can be changed with the option "-s".

Examples

Flash the file "firmware.bin" to bus 1, unit 0, chip select 0 and offset 0:

lua5.1.exe cli_flash.lua flash -b 1 -u 0 -cs  0 firmware.bin

Flash the file "firmware.bin" to bus 1, unit 0, chip select 0 and offset 0x1000:

lua5.1.exe cli_flash.lua flash -b 1 -u 0 -cs  0 -s 0x1000 firmware.bin

netX 90: write into internal flash

  • parameter cs is always 0 to access the main flash content

COM side: at offset 0x3000

lua5.1.exe cli_flash.lua flash -b 2 -u 3 -cs  0 -s 0x3000 firmware_com.bin

APP side: at offset 0x0000

lua5.1.exe cli_flash.lua flash -b 2 -u 2 -cs  0 -s 0x0000 firmware_app.bin

netX 90: write into external flash

  • parameter cs depends on the extern circuitry at the PCB. Most times it is CS 0

at offset 0x0000

lua5.1.exe cli_flash.lua flash -b 1 -u 0 -cs  0 -s 0x0000 firmware_com_extented.bin

at offset 0x0030 0000 (3MByte)

lua5.1.exe cli_flash.lua flash -b 1 -u 0 -cs  0 -s 0x00300000 firmware_app_extented.bin