Avid AVS3022 Command Line Interface (CLI)

This document describes the command line interface (CLI) used with AVS3022 system.

Commands

Commands are entered one per line. Commands are alpha-numeric strings at the beginning of the line. Parameters to the commands are whitespace delimited.

Help

The CLI has a help system available. A list of all available commands can be obtained by doing:

    AVS3022> help
Available Commands:
      alias              avs3022            cfg                cmd
  cpld               debug              ee                 flash
  fpga               gpio               heart              help
  hist               quit               restart            status
  su                 version            volts

Additional help for an additional command can be done by:

    AVS3022> help help
Command: help
Group: script
Method: script.CmdHelp(%A)
Description: Display help for commands
Usage:
     help                // List all available commands
     help [key]          // List all commands with 'key' in the command

The method shows show the command is executed in Javascript. The parameter substitutions (%0, %1, %V, etc..) follow the same usage as defined by the alias command.

Usage

Usage defines the syntax for a command:

Usage:
    cmd <param1> [params2]

Where ‘cmd’ is the command literal that is used. Required parameters are denoted by <> and optional parameters are denoted by []; In the above command, param1 is required while param2 is optional.

Based on Javascript

At its heart, the CLI is based on Javascript. The QT QML Javascript Engine is used to implement the CLI. This allows Javascript functionality to be used from the CLI.

Numbers

All Javascript numeric types should be supported

    AVS3022> 3.14           // floating point
3.14(0x00000003)
    AVS3022> 123e6      // exponents
0x754D4C0(123000000)
    AVS3022> 123e-5
0.00123(0x00000000)
    AVS3022> 0xff           // hexadecimal
0xFF(255)

Variables

Variables can be assigned at the CLI and do not have to be declared. Javascript variables are not type specific.

    AVS3022> a=123
0x7B(123)
    AVS3022> b=a
0x7B(123)
    AVS3022> b          // typing the variable name at the CLI prompt will display its current value
0x7B(123)
    AVS3022> print(b)   // variables can be used as parameters of functions and commands
0x7B(123)

Operators

All Javascript operators should be accessible

    AVS3022> 1+1
0x02(2)
    AVS3022> 4-2
0x02(2)
    AVS3022> 3*9
0x1B(27)
    AVS3022> 9/2
4.5(0x00000005)
    AVS3022> 9%2
0x01(1)
    AVS3022> a=1
0x01(1)
    AVS3022> a++
0x01(1)
    AVS3022> a
0x02(2)
    AVS3022> a+=1
0x03(3)
    AVS3022> a*=2
0x06(6)
    AVS3022> 1<<3
0x08(8)
    AVS3022> 8>>1
0x04(4)

Functions

Javascript functions can be defined by the CLI or via a script file.

    AVS3022> function mult(a,b) { return a*b; }
    AVS3022> mult(9,4)
0x24(36)

Math Object

Javascript Math object is fully accessible.

    AVS3022> Math.PI
3.14159(0x00000003)
    AVS3022> Math.pow(2,3)
0x08(8)
    AVS3022> Math.sqrt(64)
0x08(8)
    AVS3022> Math.sqrt(2)
1.41421(0x00000001)
    AVS3022> Math.sin(90*Math.PI/180)
0x01(1)

Command Substitution

Command substitution provides a method for taking the output of a command and using it as a variable. The basic syntax is:

$(cmd)

Where cmd is any valid CLI command or method. The following is an example of using a shell date command to generate a date string and assigning it to a variable:

    AVS3022> a=$(!date)
Fri Sep 14 18:10:12 EDT 2018
    AVS3022> a
Fri Sep 14 18:10:12 EDT 2018

The following writes the current date to a file t1:

    AVS3022> fwrite t1 $(!date)
true
    AVS3022> fread t1
Fri Sep 14 18:10:33 EDT 2018
    AVS3022> print($(fread t1))
Fri Sep 14 18:10:33 EDT 2018

Shell Commands

Any CLI command that has a ! as the first character will be treated as a shell command.

    AVS3022> !date
Fri Sep 14 18:14:13 EDT 2018
    AVS3022> !df -h .
Filesystem   Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk1  930Gi  611Gi  319Gi    66% 4799773 4290167506    0%   /
    AVS3022> !ifconfig en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
    ether 3c:07:54:58:04:a5
    inet6 fe80::143f:ec5c:a4cb:e382%en0 prefixlen 64 secured scopeid 0x6
    inet 192.168.1.15 netmask 0xffffff00 broadcast 192.168.1.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect (1000baseT <full-duplex,flow-control>)
    status: active

Script Files

The CLI can run script files. The script files may contain CLI commands as well as Javascript.
To execute a script file, just simply type the filename at the CLI prompt:

    AVS3022> !cat x1
VAR1=123
VAR2=456

print("Executed X1");
    AVS3022> x1
Executed X1
true
    AVS3022> VAR1
0x7B(123)
    AVS3022> VAR2
0x1C8(456)

Any global objects created by the script file will remain available in the CLI until restarted. The above VAR1 and VAR2 show they exist in the CLI after the x1 script has completed.

Script files may also include functions:

    AVS3022> !cat x2
function myfunc(a) {
   var i;
   for (i=0;i<a;i++)
    print("Step "+i);
}

print("Executed X2");
    AVS3022> x2
Executed X2
true
    AVS3022> myfunc(5)
Step 0
Step 1
Step 2
Step 3
Step 4

Script files use CLI commands as well as javascript:

    AVS3022> !cat x3            // Display script file
cpld wr 4 9
r4=$(cpld rd 4)
    AVS3022> cpld wr 4 0    // write register 4 with a 0
    AVS3022> cpld rd 4 0    // read register 4
0x00(0)
    AVS3022> x3             // run x3 script file
true
    AVS3022> cpld rd 4 0    // read register 4 (shows the script file set the register)
0x09(9)
    AVS3022> r4             // The script file also set the variable r4
0x09(9)

Command Reference

Alias

The alias sub system can provide a way of creating shortcuts for complex commands.

    AVS3022> help alias
Command: alias
Group: script
Method: script.CmdAlias('%0',%A)
Description: Display or add aliases
Usage:
     alias               // Display all aliases
     alias load          // Load aliases
     alias save          // Save aliases
     alias del <name>    // Delete alias
     alias <name> <cmd>  // Create/Change alias

Example of defining and using an alias:

    AVS3022> alias df !df -h .
Alias added.
    AVS3022> df
Filesystem   Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk1  930Gi  611Gi  319Gi    66% 4802697 4290164582    0%   /
Operator Substitution
%0,%1,%2… Positional parameters
%V All remaining positional parameters separated by commas
%S All remaining positional parameters as strings separated by commas
%A All remaining positional parameters combined as a single string

Aliases may use positional parameters: %0, %1, %2, %3, etc…

    AVS3022> alias add %0+%1
Alias added.
    AVS3022> add 3 5
0x08(8)

The %V substitution allows calling of methods with variable number of parameters:

    AVS3022> alias add script.CmdAdd(%V)
Alias added.
    AVS3022> add 1 1
0x02(2)
    AVS3022> add 1 1 1
0x03(3)
    AVS3022> add 2 2 2 2 2
0x0A(10)

Cmd

Dump command definitions.

    AVS3022> help cmd
Command: cmd
Group: script
Method: script.CmdDump('%1')
Description: Dump details of commands
Usage:
     cmd                 // Dump all available commands
     cmd [obj]           // Dump all commands from obj
Example:
     cmd sys             // Dump all commands from SYS object

Debug

Enable/Disable debug messages for the CLI

    AVS3022> help debug
Command: debug
Group: script
Method: debug.Cmd('%0')
Description: View & Adjust debug settings

    AVS3022> debug
Debug Settings:
  config          : disabled
  cpld            : disabled
  flash           : disabled
  fpga            : disabled
  global          : enabled
  gpio            : disabled
  hwlib           : enabled
  i2c             : disabled
  script          : disabled

    AVS3022> debug script
script enabled.

fappend

Appends text to a file. The text being appended should be stored in a variable or the result of a parameter substitution.

    AVS3022> help fappend
Command: fappend
Group: sys
Method: sys.CmdFileAppend('%0',%1)
Description: Append text to a file.
Usage:
         fappend <filename> <text>
    AVS3022> fappend t1 $(!date)
true
    AVS3022> fread t1
Fri Sep 14 16:23:41 EDT 2018
    AVS3022> fappend t1 $(!date)
true
    AVS3022> fread t1
Fri Sep 14 16:23:41 EDT 2018Fri Sep 14 16:24:01 EDT 2018

fcheck

Determine if a file matches a given hash.

    AVS3022> help fcheck
Command: fcheck
Group: sys
Method: sys.CmdFileCheck('%0',%1)
Description: Check file against hash.
Usage:
         fcheck <filename> <hash>
    AVS3022> fwrite t2 $(fhash t1)
true
    AVS3022> fread t2
a94fa0325ed69e70c58e38e051420713ef10a26de999161bfd9b1ee7ea30bdbe
    AVS3022> fcheck t1 $(fread t2)
true
    AVS3022> fcheck t2 $(fread t2)
false

fexists

Determine if a file exists or not.

    AVS3022> help fexists
Command: fexists
Group: sys
Method: sys.CmdFileExists('%0')
Description: Checks existance of a file/dir
Usage:
         fexists <filename>

    AVS3022> fexists t2
true
    AVS3022> fexists t99
false

fhash

Generates a HASH script for a given file.

    AVS3022> help fhash
Command: fhash
Group: sys
Method: sys.CmdFileHash('%0')
Description: Hash contents of a file.
Usage:
         fhash <filename>

    AVS3022> fhash t1
a94fa0325ed69e70c58e38e051420713ef10a26de999161bfd9b1ee7ea30bdbe

fread

Reads a file and returns the contents as a string.

    AVS3022> help fread
Command: fread
Group: sys
Method: sys.CmdFileRead('%0')
Description: Read contents of a text file.
Usage:
         fread <filename>

    AVS3022> fread t2
a94fa0325ed69e70c58e38e051420713ef10a26de999161bfd9b1ee7ea30bdbe
    AVS3022> fread t3
Fri Sep 14 16:31:41 EDT 2018

fwrite

Write a file with a given string. Will overwrite if the file already exists.

    AVS3022> help fwrite
Command: fwrite
Group: sys
Method: sys.CmdFileWrite('%0',%1)
Description: Write text to a file.
Usage:
         fwrite <filename> <text>

    AVS3022> fwrite t2 $(fhash t1)
true
    AVS3022> fwrite t3 $(!date)
true

globals

Display all of the global Javascript objects.

    AVS3022> help globals
Command: globals
Group: script
Method: Object.keys(global).toString()
Description: List all the global objects

    AVS3022> globals
json,print,global,script,env,versionObj,debug,sys,console,hwlib,flash,eeprom,cpld,ltc,VI0,VI1,VI2,VI3,server

hist

Display the history of CLI commands that have been issued.

    AVS3022> help hist
Command: hist
Group: script
Method: script.CmdHistory(%S)
Description: Display command history

jread

Reads JSON file and create an object.

    AVS3022> help jread
Command: jread
Group: sys
Method: sys.CmdJsonRead('%0')
Description: Read contents of a JSON file.
Usage:
         jread <filename>

The following shows an existing file that contains a JSON array. Using command substitution the JSON file is read and the resulting object is assigned the variable ‘x’.

    AVS3022> fread t4
[2,5,67,7,9,10,1011,-2]
    AVS3022> x=$(jread t4)
2,5,67,7,9,10,1011,-2
    AVS3022> x
2,5,67,7,9,10,1011,-2
    AVS3022> x[2]
0x43(67)

jwrite

Write objects as JSON files.

Command: jwrite
Group: sys
Method: sys.FileWrite('%0',json(%1))
Description: Write JSON obj to a file.
Usage:
         jwrite <filename> <obj>

The following creates a Javascript array and then saves it as a JSON file:

    AVS3022> a=[2,5,67,7,9,10,1011,-2]
2,5,67,7,9,10,1011,-2
    AVS3022> jwrite t4 a
true

Display the JSON file as regular text

    AVS3022> fread t4
[2,5,67,7,9,10,1011,-2]

methods

Display the methods on an object that are accessible via Javascript.

    AVS3022> help methods
Command: methods
Group: script
Method: script.CmdMethods(%1)
Description: List methods for an object
Usage:
     methods <obj>       // List Javascrpt methods available on obj

Display the methods on the sys object:

    AVS3022> methods sys
Dump(QJSValue)
GetEnv(QString)
System(QString)
Shell(QString,QString&,int)
Shell(QString,QString&)
testMessages()
CmdFileRead(QString)
CmdFileWrite(QString,QString)
CmdFileAppend(QString,QString)
CmdFileHash(QString)
CmdFileCheck(QString,QString)
CmdFileExists(QString)
HashFile(QString)
FileRead(QString)
FileWrite(QString,QString)
FileAppend(QString,QString)
FileCompare(QString,QString)
FileCopy(QString,QString)
CmdJsonRead(QString)
Sleep(int)
MSleep(int)
IPCurrent(QString)
IPCurrent()

msleep

Sleep for the specified number of milliseconds:

    AVS3022> help msleep
Command: msleep
Group: sys
Method: sys.MSleep(%0)
Description: Sleep a number of milliseconds
Usage:
         msleep <msecs>

AVS3022 Specific Help

This section describes CLI commands for the AVS3022. Some commands are listed as Super-User Only commands. In order to access these commands, the SU command will have to be used.

AVS3022 Configuration

Configuration parameters are non-voltatile settings that are used to control the CLI and the AVS3022.

General Configration Parameters

      gen.autosu : false    // avs3022d will start with SU Enabled
    gen.cmd-cpld : true     // Enable CPLD related commands
      gen.cmd-ee : true     // Enable EEPROM related commands
   gen.cmd-flash : true     // Enable FLASH related commands
    gen.cmd-fpga : true     // Enable FPGA related commands
    gen.cmd-gpio : true     // Enable GPIO related commands
   gen.cmd-heart : true     // Enable Heartbeat related commands
      gen.cmd-nv : true     // Enable Non-Volatile related commands
     gen.cmd-wdt : true     // Enable Watch-Dog related commands
    gen.password : 18e9e8b7badf07435c3e1a78717e4b43 // change via su

EEPROM Configuration Parameters

The following parameters are stored in the EEPROM. The ee dump command can be used to see the raw data of the stored configuration.

ee.adapt-present : false
    ee.adapt-rev : 0x00(0)
     ee.adapt-sn : 00000000
         ee.mac0 : 00:00:00:00:00:00
         ee.mac1 : 00:00:00:00:00:00
        ee.model : AVS-3022
          ee.rev : 0x00(0)
       ee.serial : 00000000

Config Commands

Below is a list of configuration related commands:

    AVS3022> cfg
CFG Commands:

  Super-User Only Commands:
    cfg clear          Clear config params from storage config.CmdClear('%0')
    cfg defaults       Set default config params        config.CmdDefaults('%0')
    cfg dump           Display config parameters        config.CmdDump('%0')
    cfg get            Get config parameter             config.CmdGet('%0')
    cfg load           Load config parameters           config.CmdLoad('%0')
    cfg save           Save config parameters           config.CmdSave('%0')
    cfg set            Set config parameter             config.CmdSet('%0',%1)
    cfg status

CFG CLEAR

    AVS3022> help cfg clear
Command: clear
Group: cfg
Method: config.CmdClear('%0')
Description: Clear config params from storage
Usage:
       cfg clear         // Clear ALL config params from storage
       cfg clear <group> // Clear config params for a group

CFG DEFAULTS

    AVS3022> help cfg defaults
Command: defaults
Group: cfg
Method: config.CmdDefaults('%0')
Description: Set default config params
Usage:
       cfg default         // Set defaults for ALL config params
       cfg default <group> // Set defaults for a config group

CFG DUMP

    AVS3022> help cfg dump
Command: dump
Group: cfg
Method: config.CmdDump('%0')
Description: Display config parameters
Usage:
       cfg dump          // Display ALL config params
       cfg dump <group>  // Display config params for group

CFG GET

    AVS3022> help cfg get
Command: get
Group: cfg
Method: config.CmdGet('%0')
Description: Get config parameter
Usage:
       cfg get <grp.param>   // Get parameter value
Example:
       cfg get gen.xyz

CFG LOAD

    AVS3022> help cfg load
Command: load
Group: cfg
Method: config.CmdLoad('%0')
Description: Load config parameters
Usage:
       cfg load          // Load ALL config params from storage
       cfg load <group>  // Load config params for group from storage

CFG SAVE

    AVS3022> help cfg save
Command: save
Group: cfg
Method: config.CmdSave('%0')
Description: Save config parameters
Usage:
       cfg save          // Save ALL config params to storage
       cfg save <group>  // Save config params for group to storage

CFG SET

    AVS3022> help cfg set
Command: set
Group: cfg
Method: config.CmdSet('%0',%1)
Description: Set config parameter
Usage:
       cfg set <grp.param> <val>  // Set parameter value
Example:
       cfg set gen.xyz true

CFG STATUS

Display the CFG group status. A configuration group is valid if its been loaded from valid data. For example, a blank EEPROM will result in invalid coniguration.

    AVS3022> help cfg status
Command: status
Group: cfg
Method: config.CmdStatus('%0')
Description: Display Config Status
Usage:
       cfg status         // Status for all config groups
       cfg status <group> // Status for a config group

AVS3022 Command Help

Help for AVS3022 commands can be obtained by doing avs3022 with no parameters:

    AVS3022> avs3022
    AVS3022 Commands:
  cpld               CPLD related commands.
  ee                 EEPROM related commands
  flash              SPI FLASH related commands
  fpga               FPGA related commands.
  gpio               Display GPIO pins                gpio.Dump()
  heart              Heartbeat related commands
  status             Display system status            hwlib.Status()
  volts              Display system voltages          hwlib.Volts()

AVS3022 Command Reference

CPLD

CPLD related commands:

    AVS3022> cpld
CPLD Commands:
    cpld dump          Display all CPLD registers       cpld.Dump()
    cpld gpio          CPLD GPIO commands.
    cpld nv            CPLD Non-Volatile commands.
    cpld rd            Read CPLD register               cpld.Read(%0)

  Super-User Only Commands:
    cpld wdt           CPLD WDT related commands.
    cpld wr            Write CPLD register              cpld.Write(%0,%1)

CPLD GPIO

    AVS3022> cpld gpio
GPIO Commands:
    cpld gpio dir      Set GPIO Direction (1=output)    cpld.GPIODir(%0)
    cpld gpio drive    Set GPIO Drive Type              cpld.GPIODrive(%0)
    cpld gpio in       Read GPIO Inputs                 cpld.GPIOIn(%0)
    cpld gpio out      Set GPIO Outputs                 cpld.GPIOOut(%0)
CPLD GPIO DIR
    AVS3022> help cpld gpio dir
Command: dir
Group: gpio
Method: cpld.GPIODir(%0)
Description: Set GPIO Direction (1=output)
Usage:
       cpld gpio dir <val>
Example:
       cpld gpio dir        // Display GPIO Dir register
       cpld gpio dir 0x81   // Sets bits 0 & 7 as output
CPLD GPIO DRIVE
    AVS3022> help cpld gpio drive
Command: drive
Group: gpio
Method: cpld.GPIODrive(%0)
Description: Set GPIO Drive Type
Usage:
       cpld gpio drive [val]
Example:
       cpld gpio drive       // Display GPIO Drive Type register
       cpld gpio drive 0x81  // Set GPIO bits 0 & 7 to open drain
CPLD GPIO IN
    AVS3022> help cpld gpio in
Script.cpp:800: args.count=3
Script.cpp:800: args.count=2
Command: in
Group: gpio
Method: cpld.GPIOIn(%0)
Description: Read GPIO Inputs
Usage:
       cpld gpio in
CPLD GPIO OUT
    AVS3022> help cpld gpio out
Command: out
Group: gpio
Method: cpld.GPIOOut(%0)
Description: Set GPIO Outputs
Usage:
       cpld gpio out [val]
Example:
       cpld gpio out       // Display GPIO Out register
       cpld gpio out 0x81  // Set GPIO bits 0 & 7 to high

CPLD NV

    AVS3022> cpld nv
NV Commands:
    cpld nv auto       Get/Set Auto Power and Load      cpld.NVSetAuto(%V)
    cpld nv rd         Read Non-Volatile memory         cpld.NVRead(%0)

  Super-User Only Commands:
    cpld nv disable    Disable NV write protect         cpld.NVWPDisable()
    cpld nv enable     Enable NV write protect          cpld.NVWPEnable()
    cpld nv erase      Page erase Non-Volatile memory   cpld.NVErase()
    cpld nv wr         Write Non-Volatile memory        cpld.NVWrite(%0,%1)
CPLD NV DISABLE
    AVS3022> help cpld nv disable
Command: disable
Group: nv
Method: cpld.NVWPDisable()
Description: Disable NV write protect
Usage:
       cpld nv disable
CPLD NV ENABLE
    AVS3022> help cpld nv enable
Command: enable
Group: nv
Method: cpld.NVWPEnable()
Description: Enable NV write protect
Usage:
       cpld nv enable
CPLD NV ERASE
    AVS3022> help cpld nv erase
Command: erase
Group: nv
Method: cpld.NVErase()
Description: Page erase Non-Volatile memory
Usage:
       cpld nv erase
CPLD NV RD
    AVS3022> help cpld nv rd
Command: rd
Group: nv
Method: cpld.NVRead(%0)
Description: Read Non-Volatile memory
Usage:
       cpld nv read <addr> // returns 32-bit value
Example:
       cpld nv read 0x12
CPLD NV WR
    AVS3022> help cpld nv wr
Command: wr
Group: nv
Method: cpld.NVWrite(%0,%1)
Description: Write Non-Volatile memory
Usage:
       cpld nv write <addr> <val>  // value can be 32-bits
Example:
       cpld nv write 0x12 0x76543210

CPLD RD

    AVS3022> help cpld rd
Command: rd
Group: cpld
Method: cpld.Read(%0)
Description: Read CPLD register
Usage:
       cpld rd <addr>

CPLD WDT

    AVS3022> cpld wdt
WDT Commands:

  Super-User Only Commands:
    cpld wdt disable   Disable Watch Dog Timer          cpld.WDTDisable()
    cpld wdt enable    Enable Watch Dog Timer           cpld.WDTEnable()
    cpld wdt reset     Reset Watch Dog Timer            cpld.WDTReset()
    cpld wdt status    Display Watch Dog Timer status   cpld.WDTStatus()
CPLD WDT DISABLE
    AVS3022> help cpld wdt disable
Command: disable
Group: wdt
Method: cpld.WDTDisable()
Description: Disable Watch Dog Timer
Usage:
       cpld wdt disable
CPLD WDT ENABLE
    AVS3022> help cpld wdt enable
Command: enable
Group: wdt
Method: cpld.WDTEnable()
Description: Enable Watch Dog Timer
Usage:
       cpld wdt enable
CPLD WDT RESET
    AVS3022> help cpld wdt reset
Command: reset
Group: wdt
Method: cpld.WDTReset()
Description: Reset Watch Dog Timer
Usage:
       cpld wdt reset
CPLD WDT STATUS
    AVS3022> help cpld wdt status
Command: status
Group: wdt
Method: cpld.WDTStatus()
Description: Display Watch Dog Timer Status
Usage:
       cpld wdt status

CPLD WR

    AVS3022> help cpld wr
Command: wr
Group: cpld
Method: cpld.Write(%0,%1)
Description: Write CPLD register
Usage:
       cpld wr <addr> <val>

EE

EEPROM related commands:

    AVS3022> ee
EEPROM Commands:
    ee dump            Display entire EEPROM            eeprom.Dump()
    ee rd              Read EEPROM                      eeprom.Read(%0)

  Super-User Only Commands:
    ee wr              Write EEPROM                     eeprom.Write(%0,%1)

EE DUMP

    AVS3022> help ee dump
Command: dump
Group: eeprom
Method: eeprom.Dump()
Description: Display entire EEPROM
Usage:
       ee dump

Example Dump:

    AVS3022> ee dump
0000: 01 41 56 53 2D 33 30 32 30 00 00 30 30 30 30 30
0010: 30 30 30 00 00 00 00 00 30 30 30 30 30 30 30 30
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0030: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0040: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0070: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0080: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0090: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

EE RD

    AVS3022> help ee rd
Command: rd
Group: eeprom
Method: eeprom.Read(%0)
Description: Read EEPROM
Usage:
       ee rd <addr>

    AVS3022> ee rd 0
0x01(1)

EE WR

    AVS3022> help ee wr
Command: wr
Group: eeprom
Method: eeprom.Write(%0,%1)
Description: Write EEPROM
Usage:
       ee wr <addr> <val>

    AVS3022> ee wr 0 1
true

FPGA

FPGA Related commands:

    AVS3022> fpga
FPGA Commands:
    fpga dump          Display all FPGA registers       fpga.Dump()
    fpga gpio          FPGA GPIO related commands.
    fpga load          Load FPGA config into Flash      hwlib.LoadFlash('%0')
    fpga prog          Program FPGA from flash          hwlib.ProgramFPGA()
    fpga rd            Read FPGA register               fpga.Read(%0)
    fpga verify        Verify FPGA config in Flash      hwlib.VerifyFlash('%0')
    fpga wr            Write FPGA register              fpga.Write(%0,%1)

FPGA DUMP

    AVS3022> help fpga dump
Command: dump
Group: fpga
Method: fpga.Dump()
Description: Display all FPGA registers
Usage:
       fpga dump

FPGA GPIO

    AVS3022> help fpga gpio
GPIO Commands:
    fpga gpio in       Read GPIO Inputs                 fpga.GPIOIn(%0)

  Super-User Only Commands:
    fpga gpio dir      Set GPIO Direction (1=output)    fpga.GPIODir(%0)
    fpga gpio drive    Set GPIO Drive Type              fpga.GPIODrive(%0)
    fpga gpio out      Set GPIO Outputs                 fpga.GPIOOut(%0)
FPGA GPIO IN
    AVS3022> help fpga gpio in
Command: in
Group: gpio
Method: fpga.GPIOIn(%0)
Description: Read GPIO Inputs
Usage:
       fpga gpio in
FPGA GPIO DIR
    AVS3022> help fpga gpio dir
Command: dir
Group: gpio
Method: fpga.GPIODir(%0)
Description: Set GPIO Direction (1=output)
Usage:
       fpga gpio dir <val>
Example:
       fpga gpio dir        // Display GPIO Dir register
       fpga gpio dir 0x8001 // Sets bits 0 & 15 as output
FPGA GPIO DRIVE
    AVS3022> help fpga gpio drive
Command: drive
Group: gpio
Method: fpga.GPIODrive(%0)
Description: Set GPIO Drive Type
Usage:
       fpga gpio drive [val]
Example:
       fpga gpio drive         // Display GPIO Drive Type register
       fpga gpio drive 0x8001  // Set GPIO bits 0 & 15 to open drain
FPGA GPIO OUT
    AVS3022> help fpga gpio out
Command: out
Group: gpio
Method: fpga.GPIOOut(%0)
Description: Set GPIO Outputs
Usage:
       fpga gpio out [val]
Example:
       fpga gpio out         // Display GPIO Out register
       fpga gpio out 0x8001  // Set GPIO bits 0 & 15 to high

FPGA LOAD

    AVS3022> help fpga load
Command: load
Group: fpga
Method: hwlib.LoadFlash('%0')
Description: Load FPGA config into Flash
Usage:
       fpga load <filename>   // File should be a .mcs file

    AVS3022> fpga load fpga.mcs
loaded 0xF2471C bytes
s25flash.cpp:254: Write: addr=0x000000 len=0xF2471C
true

FPGA PROG

    AVS3022> help fpga prog
Command: prog
Group: fpga
Method: hwlib.ProgramFPGA()
Description: Program FPGA from flash
Usage:
       fpga prog

    AVS3022> fpga prog
hwlib.cpp:344: Programmed FPGA in 11.248 s
true

FPGA RD

    AVS3022> help fpga rd
Command: rd
Group: fpga
Method: fpga.Read(%0)
Description: Read FPGA register
Usage:
       fpga rd <addr>

FPGA VERIFY

    AVS3022> help fpga verify
Command: verify
Group: fpga
Method: hwlib.VerifyFlash('%0')
Description: Verify FPGA config in Flash
Usage:
       fpga verify <filename>   // file should be a .mcs file

    AVS3022> fpga verify fpga.mcs
loaded 0xF2471C bytes
true

FPGA WR

    AVS3022> help fpga wr
Command: wr
Group: fpga
Method: fpga.Write(%0,%1)
Description: Write FPGA register
Usage:
       fpga wr <addr> <val>

GPIO

    AVS3022> help gpio
Command: gpio
    Group: avs3022
Method: gpio.Dump()
Description: Display GPIO pins

    AVS3022> gpio
                      CPLD_INT <-- HIGH
                      FPGA_INT <-- HIGH

HEART

Heartbeat related commands:

    AVS3022> heart
HEART Commands:
  heart start        Start the heartbeat thread.      hwlib.HeartStart()
  heart stop         Stop the heartbeat thread.       hwlib.HeartStop()

HEART START

    AVS3022> help heart start
Command: start
Group: heart
Method: hwlib.HeartStart()
Description: Start the heartbeat thread.

HEART STOP

    AVS3022> help heart stop
Command: stop
Group: heart
Method: hwlib.HeartStop()
Description: Stop the heartbeat thread.

PCI

PCI related commands:

    AVS3022> pci
PCI Commands:
    pci dma              DMA RX Data to file
    pci dmacheck         Check file of DMA Test Data
    pci pgdis            Disable pattern generator for channel
    pci pgdisall         Disable pattern generator all channels
    pci pgen             Enable pattern generator for channel
    pci pgenall          Enable pattern generator all channels
    pci rd               Read FPGA PCI register
    pci sdma             Streaming DMA RX Data to file
    pci sdmacheck        Streaming DMA RX Data and check pattern
    pci sdmatest         Streaming DMA RX Data from all channels and check pattern
    pci ssdis            Disable snapshot for channel
    pci ssen             Enable snapshot for channel
    pci wr               Write FPGA PCI register

PCI DMA

    AVS3022> help pci dma
Command: dma
Group: pci
Method: pci.DMAWriteFileCmd(%0,'%1','%2')
Description: DMA RX Data to file
Usage:
       pci dma <ch> <filename> [len]
Example:
       pci dma 0 testfile 32M
       pci dma 0 testfile 1G

PCI DMACHECK

    AVS3022> help pci dmacheck
Command: dmacheck
Group: pci
Method: pci.DMACheckFileCmd('%0')
Description: Check file of DMA Test Data
Usage:
       pci dmacheck <filename>

PCI PGDIS

    AVS3022> help pci pgdis
Command: pgdis
Group: pci
Method: pci.DMAPatternGenerator(false,%0)
Description: Disable pattern generator for channel
Usage:
       pci pgdis <ch>
           ch: Channel (0-3)
Example:
       pci pgdis 0

PCI PGDISALL

    AVS3022> help pci pgdisall
Command: pgdisall
Group: pci
Method: pci.DMAPatternGeneratorAll(false)
Description: Disable pattern generator all channels
Usage:
       pci pgdisall

PCI PGEN

    AVS3022> help pci pgdisall
Command: pgdisall
Group: pci
Method: pci.DMAPatternGeneratorAll(false)
Description: Disable pattern generator all channels
Usage:
       pci pgdisall

PCI PGENALL

    AVS3022> help pci pgenall
Command: pgenall
Group: pci
Method: pci.DMAPatternGeneratorAll(true,%0)
Description: Enable pattern generator all channels
Usage:
       pci pgenall <div>
          div: Divisor (0-0xFFF)
Example:
       pci pgenall 15

PCI RD

    AVS3022> help pci rd
Command: rd
Group: pci
Method: fpga.PCIRead(%0)
Description: Read FPGA PCI register
Usage:
       pci rd <addr>

PCI SDMA

    AVS3022> help pci sdma
Command: sdma
Group: pci
Method: pci.SDMAWriteFileCmd(%0,'%1','%2')
Description: Streaming DMA RX Data to file
Usage:
       pci sdma <ch> <filename> [len]
Example:
       pci sdma 0 testfile 32M
       pci sdma 0 testfile 1G

PCI SDMACHECK

    AVS3022> help pci sdmacheck
Command: sdmacheck
Group: pci
Method: pci.SDMACheckCmd(%0,'%1')
Description: Streaming DMA RX Data and check pattern
Usage:
       pci sdmacheck <ch> <len>
Example:
       pci sdmacheck 0 32M
       pci sdmacheck 0 1g

PCI SDMATEST

    AVS3022> help pci sdmatest
Command: sdmatest
Group: pci
Method: pci.SDMATestCmd('%0')
Description: Streaming DMA RX Data from all channels and check pattern
Usage:
       pci sdmatest <len>
Example:
       pci sdmatest 32M
       pci sdmatest 1g

PCI SSDIS

    AVS3022> help pci ssdis
Command: ssdis
Group: pci
Method: pci.SnapshotEnable(false,%0)
Description: Disable snapshot for channel
Usage:
       pci ssdis <ch>
           ch: Channel (0-3)
Example:
       pci ssdis 0

PCI SSEN

    AVS3022> help pci ssen
Command: ssen
Group: pci
Method: pci.SnapshotEnable(true,%0)
Description: Enable snapshot for channel
Usage:
       pci ssen <ch>
           ch: Channel (0-3)
Example:
       pci ssen 0

PCI WR

    AVS3022> help pci wr
Command: wr
Group: pci
Method: fpga.PCIWrite(%0,%1)
Description: Write FPGA PCI register
Usage:
       pci wr <addr> <val>

STATUS

    AVS3022> status
               Super-User Mode: Enabled
             Board Temperature: 35.6 C
              XADC Temperature: 42.0 C
               FPGA Programmed: Programmed
                 Auto Power ON: Enabled
                Auto FPGA Load: Enabled
               Watch Dog Timer: Disabled
                 System Status: FIVE_ALIVE_MON

SU

The super-user commands enables or disables super-user mode.

    AVS3022> help su
Command: su
Group: script
Method: script.CmdSU(%S)
Description: Super-User Mode
Usage:
        su                  // Enables Super-User Mode
        su disable          // Disables Super-User Mode
        su passwd           // Change the Super-User password
        su status           // Displays Super-User Mode status

The default SU password is: avid

VOLTS

    AVS3022> help volts
Command: volts
    Group: avs3022
Method: hwlib.Volts()
Description: Display system voltages

    AVS3022> volts
             VDD GPU:   6.52 V     4.00 mA
             VDD SOC:   6.53 V    56.00 mA
             WIFI 5V:   4.77 V    68.00 mA
              VDD IN:   6.52 V   386.00 mA
             VDD CPU:   6.52 V     4.00 mA
              DDR 5V:   4.77 V    44.00 mA
               1.80V:   1.75 V   732.80 mA
               3.30V:   3.31 V   283.20 mA
               1.35V:   1.37 V   968.00 mA
            1.2V MGT:   1.20 V   976.00 mA
            1.8V MGT:   1.78 V    89.20 mA
            1.0V MGT:   1.03 V  1608.00 mA
             SYS PWR:  11.98 V  1214.00 mA