This is an old version, see the latest version on the documentation wiki.
The Logic Sniffer is an open source logic analyzer. It’s designed to support the SUMP logic analyzer software at the lowest possible cost. This project is a collaboration between the Gadget Factory and Dangerous Prototypes.
The Logic Sniffer has two parts that can be upgraded over USB.
- The ROM chip (IC2) holds bitstreams that are loaded into the FPGA (IC3) at startup. The bitstream is code that tells the FPGA how to act like a logic analyzer. New bitstreams are loaded in ROM update mode.
- The PIC chip (IC1) contains firmware that provides the OLS’ USB connection and ROM update mode. New firmware is loaded via a USB bootloader in the PIC.
This post demonstrates how to update both parts.
If you have a preorder 1 Logic Sniffer, be sure to check for the bootloader before you start.
Stuff you’ll need:
- An upgrade package
- Windows PC
- Optional: a jumper (jumper, wire, foil, gum wrapper, etc)
- Load a new bitstream into the Logic Sniffer ROM with the GUI or pump-loader
- Load a new firmware into the Logic Sniffer PIC with the USB bootloader
- Reset and assign a driver if needed.
1. Load updated FPGA bitstream to the ROM chip
In this step we put the OLS in ROM update mode, and load the latest bitstream for the FPGA. Note that OLS firmware v04+ must be paired with bitstream v2.04+.
- The OLS connects to a computer as a USB virtual serial port in ROM update mode. The first time you plug it in, give Windows the .inf file from the project archive to assign the correct drivers to the device.
- Enter update ROM mode. Hold the UPDATE button then press the RESET button to enter update mode. The ACT LED lights, and the OLS enumerates as a virtual serial port.
- From v2.1 there is a GUI update utility to guide you through the ROM upload process. Run \FPGA_ROM\load_FPGA_ROM.bat to get started. When complete, continue to step 2.
Manual ROM updates:
It’s also possible to update the ROM directly from the command line with the pump-loader utility. See the pump-loader ROM update procedure for additional instructions.
- pump-loader is a utility that loads a new FPGA bitstream into the OLS ROM chip. It’s available for most platforms, and is usually in the \FPGA_ROM\bin\ folder of the OLS update package.
C:\ols\FPGA_ROM>pump-loader -p:COM4 -write -wH:Logic_Sniffer_4k32bit.mcs -run PUMP loader Opening serial port 'COM4' @ 921600 ... OK Found PUMP HW: 1, FW: 0.5, Boot: 1 Found flash: ATMEL AT45DB041D Reading HEX file 'pump.mcs' ... OK! (binary size = 169216) Will write 641 pages Page 0x0000 write ... OK ...... Page 0x0280 write ... OK PUMP switched to RUN mode C:\ols\FPGA_ROM>
- Run pump-loader from the command line as shown above. Modify -p: to match the OLS serial port name on your system. Modify -wH: to use one of the .mcs bitstream files in the release package.
- The upload will take a few seconds, but the operation isn’t critical. If it fails or is interrupted nothing will be damaged, just try the update again. If you use the -run flag the OLS will exit update mode and return to normal operating mode when the upload is complete.
- The OLS currently has several bitstreams with different capture widths (channels) and depths (samples). These will eventually be integrated into a single bitstream.
2. Load new firmware with bootloader
Some release packages also include an updated firmware for the PIC microcontroller. The PIC firmware is updated over USB. Note that OLS firmware v04+ must be paired with bitstream v2.04+.
We used a custom compile of the Diolan bootloader utility that is only available for Windows (64bit Linux test version here), this step currently requires a Windows PC until someone compiles the bootloader utility for other platforms. Use only our custom from the update package with the OLS, do not use the unmodified utilities from Diolan.
There are two ways to start the bootloader for a firmware upgrade:
- Enter the bootloader with a jumper – Place a jumper between the PGC and PGD pins of the ICSP header and then press the reset button. The ACT LED will light and the OLS will enumerate as a USB HID device (no driver needed). With out a jumper the OLS will not enter the bootloader.
- Enter bootloader with pump-loader – Enter ROM update mode by pressing the RESET button while holding the UPDATE button. The ACT LED will light and the OLS will enter ROM update mode. Use the pump-loader application with the -boot flag to jump to bootloader mode. The ACT LED stays lit and the OLS enumerates as a USB HID device.
C:\ols\firmware>fw_update -e -w -vid 0x04D8 -pid 0xFC90 -ix OLSv1-firmware-v06-20MHz.hex U2IO flash erasing: DONE. U2IO flash programming: DONE. RESET Device Operation successfully completed. C:\ols\firmware>pause Press any key to continue . . .
- Run the firmware loader (\firmware\fw_update.exe) as shown above, or just use the OLSv1-firmware-vXX.bat included in the update archive. If you have a preorder 1 OLS use the -20MHz firmware version, if you have a later OLS use the -16MHz version (don’t worry if you use the wrong one, it doesn’t actually matter, this is only a precaution).
- The chip is erased and then programmed. It’s a little slow, be prepared to wait.
- Remove the jumper (if used), and reset the board by pressing the RESET button.
3. Assign the driver on Windows if needed
The OLS uses a virtual serial port (CDC-ACM) for communications, and does not require a driver. Linux and Mac recognize it automatically. Windows already has a driver, but you have to assign it to the OLS with a .inf file.
- The first time you plug in the OLS, and after the upgrade from v0.1 to v0.5+ firmware, Windows will prompt you for a driver. Use the updated .inf (\inf\mchpcdc.inf) included in the archive to assign a driver to the OLS.
Congratulations, master hacker, your upgrade is complete. If this worked for you, or if you need some help, please give us a shout in the forum.