Skip to content

Command Line interface

Peter Wittich edited this page Oct 20, 2020 · 10 revisions

Command Line Interface (CLI)

The command line interface has a read-line support based on microrl from helios. This CLI uses control characters for up-arrow etc support, so care must be taken when reading from the CLI.

The CL is available via the UART (front panel or Zynq).

Connecting to the CLI

On the LNX machines, use screen.

screen  /dev/ttyUSB1 115200

screen is a somewhat obscure piece of code; read the man page to see how to disconnect (C-a k).

On the Zynq, use minicom.

minicom -D /dev/ttyUL1

To exit minicom, type C-x a.

CLI commands

Some useful commands are errorlog 25, ff to get information about the fireflies, and fpga to get information about the FPGAs. To get help on a command, type help <string>. A brief help string will be typed for any command that starts with the string.

How to ...

  1. Reset various error states.
    1. Temperature alarm. Type alm clear to clear the temperature alarm.
    2. Power supply alarm. Type pwr clearfail to put the power supply state machine from the error state to the OFF state.
  2. Get information about the state of the CM. Read the help contents for the commands for more information.
    1. id prints out basic information about the CM.
    2. adc prints out the measurements of voltages on the board from the microcontroller ADC.
    3. fpga prints out the temperature of the FPGAs.
    4. psmon # prints out information about the LGA80D supplies.
    5. ff prints out the temperature of the SamTec firefly devices
    6. snapshot prints out the contents of the snapshot register of the selected LGA80D power supply. The power supplies must be OFF to be able to reset the snapshot register.

List of all CLI commands

The output of the help command is listed below (v0.28).

adc
 Displays a table showing the state of ADC inputs.
alm (clear|status|settemp #)
 Get or clear status of alarm task.
bootloader
 Call the boot loader
clock
 Reset (1) or program the clock synthesizer to 156.25 MHz (2).
eeprom_info
 Prints information about the EEPROM.
eeprom_read <address>
 Reads 4 bytes from EEPROM. Address should be a multiple of 4.
eeprom_write <address> <data>
 Writes <data> to <address> in EEPROM. <address> should be a multiple of 4.
errorlog_entry <data>
 Manual entry of 2-byte code into the eeprom error logger.
errorlog <n>
 Prints last n entries in the eeprom error logger.
errorlog_info
 Prints information about the eeprom error logger.
errorlog_reset <data>
 Resets the eeprom error logger.
fpga_reset (k|v)
 Reset Kintex (k) or Virtex (V) FPGA
ff <none> |(xmit|cdr on/off (0-23|all))| regw reg# val (0-23|all) | regr reg# (0-23)
 Firefly monitoring command
fpga (<none>|done)
 Displays a table showing the state of FPGAs.
id
 Prints board ID information.
i2c_base <device>
 Set I2C controller number. Value between 0-9.
i2cr <address> <number of bytes>
 Read I2C controller. Addr in hex.
i2crr <address> <reg> <number of bytes>
 Read I2C controller. Addr in hex
i2cw <address> <number of bytes> <value>
 Write I2C controller.
i2cwr <address> <reg> <number of bytes>
 Write I2C controller.
i2c_scan
 Scan current I2C bus.
help
 This help command
pwr (on|off|status|clearfail)
 Turn on or off all power, get status or clear failures.
led (0-4)
 Manipulate red LED.
psmon <#>
 Displays a table showing the state of power supplies.
snapshot # (0|1)
 Dump snapshot register. #: which of 5 LGA80D (10*dev+page). 0|1 decide if to reset snapshot.
restart_mcu
 Restart the microcontroller
set_id <password> <address> <data>
 Allows the user to set the board id information.
set_id_password
 One-time use: sets password for ID block.
simple_sensor
 Displays a table showing the state of temps.
suart (on|off)
 Control soft uart.
stack_usage
 Print out system stack high water mark.
task-stats
 Displays a table showing the state of each FreeRTOS task
uptime
 Display uptime in minutes
version
 Display information about MCU firmware version

I2C controllers

The CLI also allows raw reads and writes to the I2C devices. The I2C controllers that can be currently addressed are

  1. I2C 1 (for power supplies)
  2. I2C 2 (for clock synthesizer)
  3. I2C 3 (for FF devices on the VU7P)
  4. I2C 4 (for FF devices on the KU15P)
  5. I2C 6 (for the two FPGAs)

The CLI commands for I2C r/w are all prefaced by i2c_*. The commands will interfere with the FreeRTOS tasks that also talk to these buses, so you need to be careful when using these commands.