Logic Sniffer: Comprehensive update application

From DP

Jump to: navigation , search

Contents

Introduction

Forum member robots developed an all-in-one update application for the Logic Sniffer. A single command line utility updates the PIC firmware and FPGA bitstream, under all platforms. The app works nicely, but is still in development.

More information:


You should be aware of the Logic sniffer 101 to understand how everything works.

Usage

Usage of the ols-fwloader program:

ols-fwloader [-d] [-V] [-W] [-R] [-E] [-r rfile] [-w wfile] [-t type] [-v vid] [-p pid]
 -f dev  - select which device to work with (BOOT or APP)
 -V      - veriy Flash against wfile
 -E      - erase flash
 -W      - erase and write flash with wfile
 -R      - read flash to rfile
 -T      - reset device at the end
 
 -t type - File type (BIN/HEX) (default: BIN)
 -w file - file to be read and written to flash
 -r file - file where the flash content should be written to
 -d      - be verbosse
BOOT only options:
 -p pid  - Set usb PID
 -v vid  - Set usb VID
 -n      - enter bootloader first
APP only options:
 -P port - Serial port device
 -l num  - Limit number of read/written pages to num
 -S      - run selftest

Write PIC firmware with verification, enter bootloader first:

ols-fwloader -f BOOT -n -P /dev/ttyACM0 -V -W -w firmware.hex

Write FPGA bitstream (HEX):

ols-fwloader -f APP -W -w bitstream.mcs

Write FPGA bitstream (BIN):

ols-fwloader -f APP -W -w bitstream.bit -t BIN

Sample Update Session

Update the PIC firmware

  1. Place the OLS in update mode (press the 'update' button, then press 'reset' - the ACT and PWR leds should be lit solid)
  2. Run the ols-fwloader program to update the firmware
$ sudo ./ols-fwloader -f BOOT -n -P /dev/ttyACM0 -W -w OLSv1-firmware-v2.1.hex
Found OLS HW: 1, FW: 0.1, Boot: 1
Found flash: ATMEL AT45DB041D 
OLS switched to bootloader mode
Bootloader version 0.2.2
Bootloader version 0.2.2
Reading file 'OLSv1-firmware-v2.1.hex'
Erasing flash ...
Writing flash ... (0x0800 - 0x3c00) 
Protecting bootloader - skip @0x3be0

Reset the OLS at the end

Verify the PIC firmware

  1. Place the OLS in update mode (hold the 'update' button, then press 'reset' - the ACT and PWR leds should be lit solid)
  2. Run the ols-fwloader program to verify the firmware against a known firmware file
$ sudo ./ols-fwloader -f BOOT -n -P /dev/ttyACM0 -V -w OLSv1-firmware-v2.1.hex
Found OLS HW: 1, FW: 2.1, Boot: 1
Found flash: ATMEL AT45DB041D 
OLS switched to bootloader mode
Bootloader version 0.2.2
Bootloader version 0.2.2
Checking flash ... (0x0800 - 0x3c00)
Verified OK! :)

The OLS stays in the bootloader at the and and must be reset to get out.

Update the FPGA bitstream

  1. Place the OLS in update mode (press the 'update' button, then press 'reset' - the ACT and PWR leds should be lit solid)
  2. Run the ols-fwloader program to update the FPGA bitstream
$ sudo ./ols-fwloader -f APP -P /dev/ttyACM0 -W -t BIN -w Logic_Sniffer_dynamic_depth.bit
Found OLS HW: 1, FW: 2.1, Boot: 1
Found flash: ATMEL AT45DB041D 
Reading file 'Logic_Sniffer_dynamic_depth.bit'
Erasing flash ...
Chip erase ... done :)
Will write 642 pages 
.....................

The OLS stays in update mode at the end and must be rest go back to normal

Verify the FPGA bitstream

  1. Place the OLS in update mode (press the 'update' button, then press 'reset' - the ACT and PWR leds should be lit solid). Not necessary if you verify immediately after updating.
  2. Run the ols-fwloader program to verify the FPGA bitstream against a known firmware file
$ sudo ./ols-fwloader -f APP -P /dev/ttyACM0 -V -t BIN -w Logic_Sniffer_dynamic_depth.bit
Found OLS HW: 1, FW: 2.1, Boot: 1
Found flash: ATMEL AT45DB041D 
Checking flash ...
.....................
Verify OK

The OLS stays in update mode at the end and must be rest go back to normal.