Bug 1118 - srd: ZeroDivisionError: Protocol decoder instance spi-1: : float division by zero
Summary: srd: ZeroDivisionError: Protocol decoder instance spi-1: : float division by ...
Status: RESOLVED FIXED
Alias: None
Product: libsigrokdecode
Classification: Unclassified
Component: PD: spi (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-28 19:32 CET by Uwe Hermann
Modified: 2018-01-29 02:21 CET (History)
0 users



Attachments
Example file (21.38 KB, text/csv)
2018-01-28 20:00 CET, Uwe Hermann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Hermann 2018-01-28 19:32:01 CET
The SPI decoder currently has issues with input data where the samplerate is 0. This can happen e.g. when importing from CSV files and not explicitly setting an assumed/fake samplerate during the import.

Example file and discussions:
https://forum.digilentinc.com/topic/4343-openscope-discovery-question/?tab=comments#comment-26156

The decoder shows all bytes correctly if a samplerate is set, but it only shows the first byte with samplerate 0 and then aborts. On the command-line you get:

  srd: ZeroDivisionError: Protocol decoder instance spi-1: : float division by zero
Comment 1 Uwe Hermann 2018-01-28 20:00:20 CET
Created attachment 386 [details]
Example file

Add file from original forum post so we can reproduce more easily.

https://forum.digilentinc.com/applications/core/interface/file/attachment.php?id=4650
Comment 2 Uwe Hermann 2018-01-29 02:21:24 CET
This was fixed in 956721de58552b05776c8613449f2907196e61e9, thanks!