Bug 26 - ASIX SIGMA driver doesn't seem to work
Summary: ASIX SIGMA driver doesn't seem to work
Status: RESOLVED FIXED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Driver: asix-sigma (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-24 16:57 CET by Uwe Hermann
Modified: 2012-12-24 17:00 CET (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Hermann 2012-12-24 16:57:45 CET
As reported by Marex on IRC, the current git state of the ASIX SIGMA driver doesn't seem to work properly.

Marex> I suspect there's a bunch of bugs in the libsigrok library ... the sigma2 works with v.0.1.1, but doesn't work with the git version
...
Marex> I suspect it never switches to SIGMA_DOWNLOAD mode ... it's always in SIGMA_CAPTURE
Marex> it's SIGMA_CAPTURE every time the receive_data() is called

Output:

$ sudo sigrok-cli --driver asix-sigma -d 0:samplerate=1m --time 1000 -O binary -p 1-4 -l 5 -o /tmp/crap.out
sr: libsigrok loglevel set to 5.
srd: libsigrokdecode loglevel set to 5.
sr: asix-sigma: Found ASIX SIGMA - Serial: A6021129
sr: asix-sigma: Uploading firmware file 'asix-sigma-50.fw'.
sr: asix-sigma: Firmware uploaded.
sr: session: starting
sr: bus: received SR_DF_HEADER
cli: Received SR_DF_HEADER
sr: bus: received SR_DF_META_LOGIC
cli: Received SR_DF_META_LOGIC
sr: session: running

The following patch seems to fix the issue, though it's unclear whether this is the correct fix.

diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c
index fba3d36..67ffb4c 100644
--- a/hardware/asix-sigma/asix-sigma.c
+++ b/hardware/asix-sigma/asix-sigma.c
@@ -1073,7 +1073,9 @@ static int receive_data(int fd, int revents, void *cb_data)
                else
                        hw_dev_acquisition_stop(sdi, sdi);

-       } else if (devc->state.state == SIGMA_DOWNLOAD) {
+       }
+
+       if (devc->state.state == SIGMA_DOWNLOAD) {
                if (devc->state.chunks_downloaded >= numchunks) {
                        /* End of samples. */
                        packet.type = SR_DF_END;

Thanks Marex for the patch!
Comment 1 Uwe Hermann 2012-12-24 17:00:22 CET
The current quifix patch is merged as dc890b8f9fa01895d3849e7d5ab8be1146f07b9e.

Should be reviewed later though, whether this is a suitable long-term fix.

Closing for now.