Hi All,
Just thought I'd leave this here, as I had terrible trouble finding good info on this and had to learn a lot as I went; hopefully it helps someone else.
I recently bought a Hantek 6022BL for a friend getting into audio and IoT/digital electronics. The combo of scope and logic analyzer for $100AUD was pretty tempting. You should know it can only work as one or the other at one time (you select which with a switch before plugging it in...).
Prior to giving it to them, I realised the Hantek software is all completely unusable, so went about 'fixing' it before sending them down this path of chaos. The findings are:
Oscilloscope mode:Logic Analyzer mode:There are a couple of options for software:
1. sigrok/PulseView (
https://sigrok.org/wiki/Downloads)
2. Salae Logic (
https://www.saleae.com/downloads/) - note that it will only run up to 12MS/sec; it will let you select more than this but will generate errors.
It works 'out of the box' (as per the sigrok wiki) in 8-channel mode, as the device reports itself with the same USB ID as a Salae Logic, which was an 8-channel device. It's kind of a clone in that regard. You can use the Salae Logic software (which is great; even friendlier than PulseView) as long as 8 channels is enough.
However, the device has 16 channels, and I wanted to get them all working. Here's how:
Enabling 16-channels for 6022BL with sigrok:Basically, the device uses a FX2 chip - for these, there is no flash, firmware is uploaded to it every time it is connected. The initial USB VID/PID is reported from EEPROM on the device; there are two EEPROMs in the 6022BL which are selected by the mode selection switch (H/in=oscilloscope or P/out=logic analyzer). Sigrok comes with a firmware called 'fx2lafw', which is designed to work with lots of logic analyzer devices based on these chips. As the device reports it is a Saleae Logic, sigrok is uploading a firmware configured for this 8ch device when it runs. All we need to do is swap the salae-logic firmware file for a properly configured 16ch firmware file - fortunately, there is one that works provided with sigrok/pulseview already!
Here's how; I'm using windows, but linux people will be able to adapt the below to suit:
(1) Find the 'sigrok-firmware' directory.
For sigrok-cli, this is something like:
C:\Program Files\sigrok\sigrok-cli\share\sigrok-firmwareFor pulseview it is something like:
C:\Program Files\sigrok\PulseView\share\sigrok-firmwareIf you want to use either, do steps (2) and (3) for both!
(2) Make a backup of "fx2lafw-saleae-logic.fw" (e.g. change name to ... .fw.bak)
(3) Copy "fx2lafw-sigrok-fx2-16ch.fw", and rename the copy to "fx2laf2-salae-logic.fw".
(4) On the device, set the H/P switch to P (out) for logic analyzer mode, and plug in the USB cable.
Now, if you're using sigrok-cli:
(5a) Scan for fx2lafw devices. Command line: "sigrok-cli --scan". libsigrok will upload the 'wrong' firmware but report a 'Salae Logic with 8 channels'
(6a) If you're using windows, and this is the first time with this device, use Zadig (comes with pulseview, or you can install separately:
https://zadig.akeo.ie/) to install the WinUSB driver for the new device that has appeared (name: 'fx2lafw', VID:1D50, PID:608D).
(7a) Now, scan again (sigrok-cli --scan) and device "sigrok FX2 LA (16ch)" will appear and work.
Or if you're using pulseview:
(5b) Start pulseview. During the start-up scan, the 16-ch firmware is uploaded.
(6b) If you're using windows, and this is the first time with this device, use Zadig to install the WinUSB driver for the new device that has appeared (name: 'fx2lafw', VID:1D50, PID:608D).
(7b.i) Manually connect to the device: Click the arrow next to <No Device> and then 'Connect to Device...' from the dropdown, select 'fx2lafw' from the driver list, then 'scan for devices...', and 'sigrok FX2 LA (16ch) with 16 channels' should appear in the device list. Click OK, and ready to work.
-- OR --
(7b.ii) Quit and restart pulseview, which should find and connect the 16ch firmware automatically.
More notes:
- Obviously if you also use Salae Logic hardware, when you try and connect to this with sigrok or PulseView it will now do the same firmware loading to this device as above. Presumably (I don't have one to test) it will report 16 channels but only 8 will work. Worst case it might not work at all. You'll have to swap back the firmware files to make it work again.
- You can still use the Salae Logic software with the 6022BL if you like - just plug the device in, DON'T RUN SIGROK OR PULSEVIEW. Salae Logic will identify the device and load it's own firmware, and you can use the first 8 channels.