Bug#1036103: sigrok: Fails to work with AZDelivery Logic Analyzer, firmware fails to load.

2023-05-15 Thread Lisandro Damián Nicanor Pérez Meyer
Well, the bug is only present when I plug the Logic Analyzer against a hub. 
Interestingly enough this does not happens with proprietary software, but this 
solution is good enough



signature.asc
Description: This is a digitally signed message part.


Bug#1036103: sigrok: Fails to work with AZDelivery Logic Analyzer, firmware fails to load.

2023-05-15 Thread Lisandro Damián Nicanor Pérez Meyer
Source: sigrok
Version: 0.3
Severity: normal
X-Debbugs-Cc: lisan...@debian.org

Hi!

sigrok-cli and pulseview fail to capture any data using the AZDelivery
Logic analyzer. I have tried the device with some proprietary software
and works (yes, I have cleaned up the udev rules after that).

Here is some output from sigrok-cli.

$ sudo sigrok-cli --driver fx2lafw --time 3s --output-format bits --channels D2 
--triggers D2=r -l  5
sr: [00:00.00] log: libsigrok loglevel set to 5.
sr: [00:00.48] backend: libsigrok 0.5.2/5:1:1.
sr: [00:00.79] backend: Libs: glib 2.74.4 (rt: 2.74.6/7406:6), libzip 
1.7.3, libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1), libusb-1.0 1.0.26.11724 API 
0x01000109, hidapi 0.12.0, bluez 5.66, libftdi 1.5.
sr: [00:00.000183] backend: Host: x86_64-pc-linux-gnu, little-endian.
sr: [00:00.000188] backend: SCPI backends: TCP, serial, USBTMC.
sr: [00:00.000192] backend: Firmware search paths:
sr: [00:00.000209] backend:  - /root/.local/share/sigrok-firmware
sr: [00:00.000217] backend:  - /usr/share/sigrok-firmware
sr: [00:00.000219] backend:  - /usr/local/share/sigrok-firmware
sr: [00:00.000226] backend:  - /usr/share/sigrok-firmware
sr: [00:00.000251] backend: Sanity-checking all drivers.
sr: [00:00.000258] backend: Sanity-checking all input modules.
sr: [00:00.000263] backend: Sanity-checking all output modules.
sr: [00:00.000272] backend: Sanity-checking all transform modules.
srd: libsigrokdecode loglevel set to 5.
sr: [00:00.008932] ezusb: uploading firmware to device on 3.21
sr: [00:00.012777] ezusb: setting CPU reset mode on...
sr: [00:00.025257] resource: Attempt to open 
'/root/.local/share/sigrok-firmware/fx2lafw-saleae-logic.fw' failed: No such 
file or directory
sr: [00:00.025318] resource: Opened 
'/usr/share/sigrok-firmware/fx2lafw-saleae-logic.fw'.
sr: [00:00.025365] ezusb: Uploading firmware 'fx2lafw-saleae-logic.fw'.
sr: [00:00.030346] ezusb: Uploaded 4096 bytes.
sr: [00:00.034356] ezusb: Uploaded 4024 bytes.
sr: [00:00.034400] ezusb: Firmware upload done.
sr: [00:00.034413] ezusb: setting CPU reset mode off...
sr: [00:00.035398] ezusb: Unable to send control request: LIBUSB_ERROR_PIPE.
sr: [00:00.035425] fx2lafw: Firmware upload failed for device 3.21 (logical), 
name fx2lafw-saleae-logic.fw.
sr: [00:00.035465] hwdriver: Scan found 1 devices (fx2lafw).
sr: [00:00.035580] device: fx2lafw: Opening device instance.
sr: [00:00.035596] fx2lafw: Firmware upload was not needed.
sr: [00:00.035930] fx2lafw: Unable to get version info: LIBUSB_ERROR_PIPE.
sr: [00:00.035961] fx2lafw: Failed to get firmware version.
sr: [00:00.035983] fx2lafw: Unable to open device.
Failed to open device.

So the firmware seems to be failing to load.

A second run will produce:

$ sudo sigrok-cli --driver fx2lafw --time 3s --output-format bits --channels D2 
--triggers D2=r -l  5
sr: [00:00.01] log: libsigrok loglevel set to 5.
sr: [00:00.37] backend: libsigrok 0.5.2/5:1:1.
sr: [00:00.010010] backend: Libs: glib 2.74.4 (rt: 2.74.6/7406:6), libzip 
1.7.3, libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1), libusb-1.0 1.0.26.11724 API 
0x01000109, hidapi 0.12.0, bluez 5.66, libftdi 1.5.
sr: [00:00.010046] backend: Host: x86_64-pc-linux-gnu, little-endian.
sr: [00:00.010054] backend: SCPI backends: TCP, serial, USBTMC.
sr: [00:00.010069] backend: Firmware search paths:
sr: [00:00.010098] backend:  - /root/.local/share/sigrok-firmware
sr: [00:00.010104] backend:  - /usr/share/sigrok-firmware
sr: [00:00.010114] backend:  - /usr/local/share/sigrok-firmware
sr: [00:00.010122] backend:  - /usr/share/sigrok-firmware
sr: [00:00.010159] backend: Sanity-checking all drivers.
sr: [00:00.010187] backend: Sanity-checking all input modules.
sr: [00:00.010204] backend: Sanity-checking all output modules.
sr: [00:00.010229] backend: Sanity-checking all transform modules.
srd: libsigrokdecode loglevel set to 5.
sr: [00:00.037844] fx2lafw: Found an fx2lafw device.
sr: [00:00.037949] hwdriver: Scan found 1 devices (fx2lafw).
sr: [00:00.038240] device: fx2lafw: Opening device instance.
sr: [00:00.038249] fx2lafw: Firmware upload was not needed.
sr: [00:00.041830] fx2lafw: Opened device on 3.23 (logical) / usb/3-1.1.3 
(physical), interface 0, firmware 1.4.
sr: [00:00.041863] fx2lafw: Detected REVID=1, it's a Cypress CY7C68013A (FX2LP).
sr: [00:00.041985] hwdriver: sr_config_list(): key 30014 (triggermatch) sdi 
0x55f83e98e260 cg NULL -> [1, 2, 3, 4, 5]
sr: [00:00.042033] hwdriver: sr_config_get(): key 3 (samplerate) sdi 
0x55f83e98e260 cg NULL -> uint64 2
sr: [00:00.042048] hwdriver: sr_config_set(): key 50001 (limit_samples) sdi 
0x55f83e98e260 cg NULL -> uint64 6
sr: [00:00.042070] session: Checking trigger:
sr: [00:00.042076] session: Stage 0 match on channel D2, match 3
sr: [00:00.042090] session: Using thread-default main context.
sr: [00:00.042096] session: Starting.
sr: [00:00.042102] hwdriver: fx2lafw: Starting acquisition.
sr: [00:00.042149] fx2lafw: submitting transfer: 0
sr: [00:00.042168]