M5 Thruster Module
M5 Thruster Module, M5 Thruster Module

Using vr_refresh

The vr_refresh tool is a standalone command line application that can be used to update the firmware on a module. There are no dependencies for vr_refresh.

Usage: vr_refresh [OPTIONS] [SINGLE_HEX_FILE_NAME]

Do not include the brackets [   ].

OPTIONDescription
-? [ --help ]show the help message
--versionshow version
-c [ --com ] argset com port name (=/dev/ttyUSB0)
-i [ --id ] argnode ID, 255 for broadcast (=255)
--sn argserial number (=any)
--block_size arg flash block size (=1024)
-d [ --dir ] argset firmware folder, not used if an input file is specified
-q [ --quite ]do not send check active command
-v [ --verbose ]output verbose diagnostics
-r [ --RESET ]reset device upon completion
--UNLOCKallow reprogramming of bootloader
--input_file arginput file

For example, to download the firmware to a LED controller module, the typical usage on a Windows machine would be:

  • vr_refresh -c com7 led_controller-1.0.0.hex

The typically usage on a Linux host would be:

  • vr_refresh -c /dev/ttyUSB0 led_controller-1.0.0.hex

By default vr_refresh will use BROADCAST transmissions to establish connections. This behavior can be changed by using the -i or the -sn parameters.

vr_refresh, like all VideoRay command line tools will output its usage options when run with the "-?" parameter.

vr_refresh Methods of Connection

There are two ways to establish a connection between vr_refresh and the module.

Power on Connection

When vr_refresh is run it will sit and wait for the initial announcement message sent by the module. The modules use a randomized transmission to attempt to minimize collisions when there are multiple devices on the bus. Since vr_refresh by default uses broadcasts, this means that if there are multiple devices connected and powered up at the same time it is a matter of chance as to which module will connect. It is therefore recommend that either the -sn or -i parameters be used or only as single module be connected at a time when updating firmware.

Application Firmware Reboot Connection

When vr_refresh is run it will send a REBOOT message immediately (-i parameter applies). If a module is connected, powered up, and accepts the REBOOT message from vr_refresh (either it is a broadcast message or the proper node id was passed in) the module will reboot and jump to the bootloader. It should then connect as desired.

vr_refresh Output

vr_refresh will output status strings during operation. Examples are given below:

Waiting to connect (command line: vr_refresh -c com7 -I 1); response:

  • INFO: Attempting connection to Node: 1 S/N: any

Successful connection (command line: vr_refresh -c com7); response:

  • INFO: Attempting connection to Node: 255 S/N: any
  • INFO: Connected to Node: 5
  • INFO: Done

Successful connection VERBOSE mode (command line: vr_refresh -c com7 --verbose); response:

  • INFO: Attempting connection to Node: 255 S/N: any
  • INFO: Connected to Node: 5
  • INFO: Boot Data
    • Data version: 1
    • Device type: 131
    • Incept date: 2014-Nov-10 22:29:55
    • Serial number: LED0001
    • App Size: 0x9118
    • App crc: 0x23f766a8
  • INFO: Done

Sample end of firmware update (command line: vr_refresh -c com7 -verbose led_controller-1.0.0.hex); response:

  • INFO: Progress 90%
  • INFO: Erase 0xc400
  • INFO: Progress 91%
  • INFO: Progress 92%
  • INFO: Progress 93%
  • INFO: Erase 0xc800
  • INFO: Progress 94%
  • INFO: Progress 95%
  • INFO: Progress 96%
  • INFO: Erase 0xcc00
  • INFO: Progress 97%
  • INFO: Progress 98%
  • INFO: Erase 0xd000
  • INFO: Progress 99%
  • INFO: Progress 100%
  • INFO: Done

Document Path: M5 Thruster Module Operator's Manual > Software Guide > Firmware > Firmware Updates > Using vr_refresh