Contents
|
Sigrok Logic16
I am using with Sigrok the following devices:
USBee AX clone, Logic Analyzer, 8 bit wide, see for info
Saleae Logic16 clone, Logic Analyzer, 16 bit wide, see for info
For GPIB (General Purpose Interface Bus, or HPIB, or IEEE488; 16 bits parallel) analysis I need a low cost 16 bit Logic Analyzer, and found a Saleae Logic16 clone on the china market, for about 23 EUR.
I like to have a GPIB protocol decoder, which is not offered from company Saleae. So I came to http://sigrok.org/, which is open source, and protocol decoders are witten in Python3, which is in the range of my programming knowledge. The project is started, but not finished, please see SigrokDecoderGPIB.
Here I will document my experience with sigrok and Logic16 under the 3 main PC operating systems, Linux, Mac OS X and Windows.
Firmware for Logic16
The download of the original software Logic (version 1.2.10) for Linux is needed to extract the firmware. You can extract the files with this Python3 script, and copy them in Ubuntu to the path shown below. The use of the script is also explained.
# check the MD5 sum of the firmware files- $ md5sum /usr/share/sigrok-firmware/saleae* 96df76444afc5c28748f03d7e4280c2d /usr/share/sigrok-firmware/saleae-logic16-fpga-18.bitstream c97db523c2d54fe07fc6d8588fd9d77b /usr/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream 80af10cd7c0d0cd8ba69d3bc60baa9f8 /usr/share/sigrok-firmware/saleae-logic16-fx2.fw
The internals about the firmware are also described.
Logic16 in Ubuntu 14.04
In Ubuntu 14.04 LTS Trusty sigrok is not in the Ubuntu repository. If you do not want to compile sigrok for Ubuntu, you can use a user friendly PPA (Personal Package Archive). On this web page it is explained how to use the PPA.
The most actual PPA provision is for Ubuntu trusty 14.04 LTS only. Following is a list of the installed modules:
$ dpkg --list | grep sigrok ii libsigrok1 0.2.0-2.1ubuntu1 i386 sigrok hardware driver library - shared library ii libsigrok2:i386 0.3.0+4.0git20160103-0ppa1~trusty i386 sigrok hardware driver library - shared library ii libsigrokcxx:i386 0.3.0+4.0git20160103-0ppa1~trusty i386 sigrok C++ bindings - shared library ii libsigrokdecode1 0.2.0-2ubuntu1 i386 sigrok protocol decoding library - shared library ii libsigrokdecode2:i386 0.3.0+4.0git20151225-0ppa1~trusty i386 sigrok protocol decoding library - shared library ii pulseview 0.2.0+3.0git20160103-0ppa1~trusty i386 sigrok logic analyzer, oscilloscope, and MSO GUI ii sigrok 0.2-2 all Logic analyzer and protocol decoder software suite (metapackage) ii sigrok-cli 0.5.0+6.0git20151231-0ppa1~trusty i386 command-line frontend for the sigrok software ii sigrok-firmware 0.0.0+1.0git20151211-0ppa1~trusty all Firmware files for some devices supported by sigrok (non-free) ii sigrok-firmware-fx2lafw 0.1.3-0ppa1~trusty all Firmware for Cypress FX2(LP) based logic analyzers
Below is documented a capture sample session with log level 5
$ sigrok-cli -d saleae-logic16 --samples 100 -l 5 sr: [00:00.000002] log: libsigrok loglevel set to 5. sr: [00:00.000085] backend: libsigrok 0.4.0/2:0:0 (rt: 0.4.0/2:0:0). sr: [00:00.000134] backend: Libs: glib 2.40.2 (rt: 2.40.2/4002:0), libzip 0.10.1, libserialport 0.1.1/0:0:0 (rt: 0.1.1/0:0:0), libusb-1.0 1.0.17.10830, libftdi 0.20, librevisa 0.0.20130812. sr: [00:00.000164] backend: Host: i686-pc-linux-gnu, little-endian. sr: [00:00.000190] backend: SCPI backends: TCP, RPC, serial, VISA, USBTMC. sr: [00:00.000229] backend: Sanity-checking all drivers. sr: [00:00.000258] backend: Sanity-checking all input modules. sr: [00:00.000283] backend: Sanity-checking all output modules. sr: [00:00.000304] backend: Sanity-checking all transform modules. srd: libsigrokdecode loglevel set to 5. sr: [00:00.004351] hwdriver: Initializing driver 'saleae-logic16'. sr: [00:00.004482] ezusb: uploading firmware to device on 2.8 sr: [00:00.004778] ezusb: setting CPU reset mode on... sr: [00:00.005057] resource: Attempt to open '/home/rudi/.local/share/sigrok-firmware/saleae-logic16-fx2.fw' failed: No such file or directory sr: [00:00.005097] resource: Opened '/usr/share/sigrok-firmware/saleae-logic16-fx2.fw'. sr: [00:00.005168] ezusb: Uploading firmware 'saleae-logic16-fx2.fw'. sr: [00:00.005910] ezusb: Uploaded 4096 bytes. sr: [00:00.006259] ezusb: Uploaded 1121 bytes. sr: [00:00.006297] ezusb: Firmware upload done. sr: [00:00.006333] ezusb: setting CPU reset mode off... sr: [00:00.006527] hwdriver: Scan of 'saleae-logic16' found 1 devices. sr: [00:00.006604] saleae-logic16: Waiting for device to reset. sr: [00:00.407285] saleae-logic16: Waited 400ms. sr: [00:00.507724] saleae-logic16: Waited 501ms. sr: [00:00.608134] saleae-logic16: Waited 601ms. sr: [00:00.708522] saleae-logic16: Waited 702ms. sr: [00:00.808944] saleae-logic16: Waited 802ms. sr: [00:00.909306] saleae-logic16: Waited 902ms. sr: [00:01.009712] saleae-logic16: Waited 1003ms. sr: [00:01.110149] saleae-logic16: Waited 1103ms. sr: [00:01.210336] saleae-logic16: Waited 1203ms. sr: [00:01.310772] saleae-logic16: Waited 1304ms. sr: [00:01.411178] saleae-logic16: Waited 1404ms. sr: [00:01.511563] saleae-logic16: Waited 1505ms. sr: [00:01.611998] saleae-logic16: Waited 1605ms. sr: [00:01.712358] saleae-logic16: Waited 1705ms. sr: [00:01.812771] saleae-logic16: Waited 1806ms. sr: [00:01.912991] saleae-logic16: Waited 1906ms. sr: [00:02.013348] saleae-logic16: Waited 2006ms. sr: [00:02.016345] saleae-logic16: mcupro Saleae16 detected. sr: [00:02.032146] saleae-logic16: Opened device on 2.9 (logical) / usb/2-1 (physical), interface 0. sr: [00:02.032208] saleae-logic16: Device came back after 2006ms. sr: [00:02.032367] hwdriver: sr_config_set(): key 50001 (limit_samples) sdi 0x9caf300 cg NULL -> uint64 100 sr: [00:02.032495] session: Using thread-default main context. sr: [00:02.032516] session: Starting. sr: [00:02.035336] std: saleae-logic16: Starting acquisition. sr: [00:02.035386] std: saleae-logic16: Sending SR_DF_HEADER packet. sr: [00:02.035414] session: Running transform module 'nop'. sr: [00:02.035438] transform/nop: Received packet of type 10000, passing on unmodified. sr: [00:02.035462] session: bus: Received SR_DF_HEADER packet. cli: Received SR_DF_HEADER. sr: [00:02.035631] hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x9caf300 cg NULL -> uint64 500000 sr: [00:02.047022] saleae-logic16: receive_transfer(): status LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED received 10240 bytes. sr: [00:02.047270] session: Running transform module 'nop'. sr: [00:02.047280] transform/nop: Received packet of type 10004, passing on unmodified. sr: [00:02.047289] session: bus: Received SR_DF_LOGIC packet (200 bytes, unitsize = 2). cli: Received SR_DF_LOGIC (200 bytes, unitsize = 2). sr: [00:02.047336] hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x9caf300 cg NULL -> uint64 500000 libsigrok 0.4.0 Acquisition with 16/16 channels at 500 kHz 0:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 1:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 2:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 3:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 4:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 5:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 8:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 10:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 12:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 13:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 14:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 15:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 sr: [00:02.056387] session: Running transform module 'nop'. sr: [00:02.056417] transform/nop: Received packet of type 10001, passing on unmodified. sr: [00:02.056433] session: bus: Received SR_DF_END packet. 0:00000000 00000000 00000000 00000000 0000 1:00000000 00000000 00000000 00000000 0000 2:00000000 00000000 00000000 00000000 0000 3:00000000 00000000 00000000 00000000 0000 4:00000000 00000000 00000000 00000000 0000 5:00000000 00000000 00000000 00000000 0000 6:00000000 00000000 00000000 00000000 0000 7:00000000 00000000 00000000 00000000 0000 8:00000000 00000000 00000000 00000000 0000 9:00000000 00000000 00000000 00000000 0000 10:00000000 00000000 00000000 00000000 0000 11:00000000 00000000 00000000 00000000 0000 12:00000000 00000000 00000000 00000000 0000 13:00000000 00000000 00000000 00000000 0000 14:00000000 00000000 00000000 00000000 0000 15:00000000 00000000 00000000 00000000 0000 cli: Received SR_DF_END. sr: [00:02.056498] usb: usb_source_finalize sr: [00:02.057178] session: Stopped. sr: [00:02.057322] saleae-logic16: Closing device on 2.9 (logical) / usb/2-1 (physical) interface 0.
Logic16 in Ubuntu 16.04
In Ubuntu 16.04-32 LTS Xenial sigrok is in the repository, you can install sigrok the best with synaptic.
Unfortunately at the moment (2016-09-14) an old driver saleae-logic16 prevents the use of the Logic16.
# test $ sigrok-cli -d saleae-logic16 --samples 100 -l 5 # Error message at log level 5: sr: saleae-logic16: Invalid FPGA bitstream version: 0x40 != 0x10
Logic16 in Virtualbox
More difficult is the Ubuntu 14.04-32 LTS installation on a Virtual Machine, like https://www.virtualbox.org/. It is not the installation by itself, it is the weak graphic performane, which annoys especially with the Ubuntu standard desktop software Unity/Compiz. Also a few specialities have to be known, when it comes to work with a USB hardware dongle like the Logic16.
A very short explanation for Virtualbox host Windows 7 (R) follows.
Logic16 in Windows 7
Install the (nightly) windows package of sigrok-cli.
Install with Zadig.exe (in sigrok-cli folder) the USB driver WinUSB (v6.1.7600.16385)-
click on menu->Options->List all devices.
- in the devices window select the last entry 'Saleae Logic16 USB Logic Analyzer',
- or USB PID [21a9:1001] if the firmware is not yet loaded.
click on the Install button, it may take a while.
Virtual Box
Oracle VM Virtual Box Manager installation Ver. 5.1.4
Install also the guest additions
Following properties should/must be adopted:
- Common/Extended: Common Clipboard: bidirektional
- System/main board/RAM: 1024 MB, or more
- System/main board/Chip set: ICH9
- System/main board/extended: set check mark at IO-APIC
- System/acceleration: set check mark VT-x/AMD-V (must be enabled in BIOS)
- Display/Graphic RAM: 32 MB
- Display, 3D acceleration: set check mark
- Mass storage: At CD-ROM Controller select: VBoxGuestAdditions.iso
- Mass storage: Harddisk size about 15 GB, incrementel
- Common folder: Name: vboxshare
- Common folder: Path: C:\vboxshare
- Common folder: automatic mount: yes
# add user to virtualbox group $ sudo usermod -a -G vboxsf <user name> # log off and login again to make it active # check user for groups $ id # shared folder link (Name on host computer: vboxshare) $ ls /media/sf_vboxshare # if folder is seen, set link $ cd /home/<user name> $ sudo ln -sf /media/sf_vboxshare vboxshare
Desktop, Compiz
Because Ubuntu Compiz in Virtualbox needs a lot of RAM (175 MB) and is very slow in screen update, it is recommended, to fall back to Gnome Classic desktop, see at Gnome Classic installation, with pictures. Type in the Terminal:
# install $ sudo apt-get install gnome-session-flashback
After installation you need to log off. At the login screen click on the Ubuntu Logo and select GNOME Flashback (Metacity). Then you can login with your password.
Then you have the classic Gnome Desktop with a Program Select Tree in the header bar. The process gnome-panel now needs just 6 MB RAM.
Program adoption
Ubuntu 16.04 File manager Nautilus shows no longer menu item properties and Tree View. Fix:
# install $ sudo apt-get install dconf-editor $ dconf-editor at org->gnome->nautilus->list-view->use-tree-view set check mark at org->gnome->nautilus->preferences->default-folder-view "list-view" select
Archive management file-roller needs for .rar archives:
# install $ sudo apt-get install unrar
- System load indicator in the header bar
#install $ sudo apt-get install indicator-multiload # start program system load # click in der header bar on the "CPU load indicator" field for showing the options # select also the indicators RAM, network, and system load
Function test
If that all is done, it is time to route the USB port of Logic16 to Ubuntu in the Virtualbox.
- Select in the Virtualbox properties the chapter USB.
- Click on the right on the '+' button
- You should see the found USB devices from Windows 7 (R)
- click on 'unknown device 21A9:1001' (which is the Logic16 USB dongle)
in the Filter windows check mark the device
If in Virtualbox/Ubuntu the Logic16 is not found, click on the Virtualbox window top bar menu->Devices->USB.
Click in the list on unknown device 21A9:1001
If you look again, the unknown device 21A9:1001 must have a check mark in front.
extract/copy the Logic16 firmware to the folder as described.
- test the installation with (enable log level 5):
$ sigrok-cli -d saleae-logic16 --samples 100 -l 5
The Logic16 capture sample log is already shown.
If it does not work on the first try, try again. It may be, that the firmware has to be loaded first, in order to work.
Logic16 in Mac OS X
The Sigrok installation for Mac OS X 10.11.6 El Capitan is described on the Sigrok page. Unfortunately a few information are missing, which I will describe following:
A Homebrew installation before El Capitan 10.11.6 must be updated, in the Terminal:
# fix user rights $ sudo chown -R $(whoami):admin /usr/local # reset brew to actual version $ cd $(brew --prefix) && git fetch origin && git reset --hard origin/master # path to the installation: /usr/local/Cellar/
Next the missing firmware folder must be created and filled:
$ mkdir ~/.local/share/sigrok-firmware/
Copy firmware files from a Linux or Windows installation, or see at sigrok.
USBee AX clone - working at the first test
Saleae Logic16 clone - does not work first, select the device from the list in Pulseview, search for the device, and say OK. Then it worked. At the second pulseview start it finds the salea Logic16 immediately.
Salea Logic16 update 2017-08-08: It works with pulseview version 0.4.0-git-fe934a9 under Mac OS X version 10.12.6 (Sierra). See the logging:
$ pulseview -V PulseView 0.4.0-git-fe934a9 $ pulseview -l 3 sr: saleae-logic16: Firmware upload was not needed. sr: saleae-logic16: mcupro Saleae16 detected. sr: saleae-logic16: Opened device on 20.11 (logical) / usb/20-2 (physical), interface 0.
Logic16 in Windows 7-64 (R)
Install sigrok as already described.
Unfortunately at the moment (2016-09-14) an old driver Saleae-logic16 prevents the use of the Logic16.
# test $ sigrok-cli -d saleae-logic16 --samples 100 -l 5 # Error message at log level 5: Failed to receive reply to EP1 command 0x7d: LIBUSB_ERROR_IO
For more explanation of that, please look at the bug report.
Links
List of pages in this category:
-- RudolfReuter 2016-09-12 17:08:45
Go back to CategoryLogicAnalyzer or FrontPage ; KontaktEmail (ContactEmail)