Quickstart

If any step below results in an error, please contact us at support@lagerdata.com

Install the lager-cli package

pip3 install -U lager-cli

Log in to Lager

lager login

The lager-cli tool will prompt you to open a browser window so that you can link lager-cli to your account.

➜  ~ lager login
Please confirm the following code appears in your browser: ABCD-EFGH-IJKL
Lager would like to open a browser window to confirm your login info [y/N]:

If you do not have a browser installed (for example if you are using a virtual machine or docker image) lager will prompt you to copy-paste a url:

➜  ~ lager login
Please visit https://auth.lagerdata.com/activate?user_code=ABCD-EFGH-IJKL in your browser
And confirm your device token: ABCD-EFGH-IJKL
Awaiting confirmation... (Could take up to 5 seconds after clicking "Confirm" in your browser)

List your DUTs

lager list duts

This will show a list of DUTs associated with your account.

➜  ~ lager list duts
name            id
main_pcb_v1      1

Say hello to your DUT

lager hello --dut main_pcb_v1 or lager hello --dut 1

➜  ~ lager hello --dut 1
Hello, world! Your DUT is connected.

If you get the "Hello, world!" message, that means your DUT is connected and ready to receive commands! If you have more than one DUT, you need to use the --dut <name> flag e.g. lager hello --dut main_pcb_v1. Otherwise, if you only have one DUT, the command will automatically use that one.

List Available Nets

Lager allows developers to interact directly with hardware nets on a PCB from the command line.

➜  ~ lager net --dut 1
name                     type   channel
GPIO18                 analog         0
GPIO19                 analog         1
PWM0                   analog         0
PWM1                   analog         1
PWM2                   analog         2
SPI_SCK                 logic         0
SPI_MOSI                logic         1
SPI_MISO                logic         2
SPI_CS_LAN9252          logic         3
VDD              power-supply         0
VBAT                  battery         0

Each net type has associated functionality. For example power-supply nets allows you to control voltage or current on that net.

Types

analog Nets that can be viewed or measured using an oscilloscope or a logic analyzer. For viewing use the Lager Web App.

logic Nets that can be viewed or measured using anlogic analyzer. For viewing use the Lager Web App.

power-supply Nets that can be controlled from a power supply.

battery Nets that can be controller from a battery simulator.

Channels

For analog and logic nets, only nets on different channels can be viewed simultaneously. For example PWM0 and PWM1 can be scene at the same time, but GPIO18 and PWM0 cannot.

Use A Debugger

lager debug erase --dut 1 Erase the flash on your DUT.

lager debug flash --hexfile my_hex_file.hex --dut 1 Use the provided ihex file to flash your DUT.

lager debug flash --binfile my_bin_file,0x00000000 --dut 1 Use the provided binary file and start address to flash your DUT.

lager debug gdb my_elf_file.elf --dut 1 Start interactive debug session with your DUT using GDB.

lager debug reset --dut 1 Reset your DUT's MCU.

lager debug reset --halt --dut 1 Reset your DUT's MCU and halt.

Control USB Power

Lager allows users to plug and unplug USB devices from the commmand line.

➜  ~ lager usb --dut 1
Device: my_usb_device_1 enabled: True
Device: my_usb_device_2 enabled: False
Device: my_usb_device_3 enabled: False

Similar to lager net this lists USB devices that a user has control over.

lager usb my_usb_device_1 on --dut 1 Power on (e.g. plug in) my_usb_device_1.

lager usb my_usb_device_1 off --dut 1 Power off (e.g. unplug) my_usb_device_1.

Open Serial Terminal

Lager allows users to open interactive serial terminals with their DUT.

➜  ~ lager serial-ports --dut 191
/dev/ttyACM0 - SEGGER J-Link; serial number 960010725
/dev/ttyACM1 - SEGGER J-Link; serial number 960010725
/dev/ttyACM2 - SEGGER J-Link; serial number 960010725

Lists available serial devices.

lager uart --serial-device /dev/ttyACM0 --interactive --dut 1 Opens an interactive serial connection with device /dev/ttyACM0.