AaronC81 / saleae-logic2-custom-data

Saleae Logic2 plugin to annotate custom data patterns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug : IndexError('list index out of range')

NeilSCGH opened this issue · comments

Hello,

I use your extension in Logic 2, I didn't find any other extension that allows to identify and name pattern from data, so I wanted to thank you for your work :)

But I've encountered a bug using your extension, I'm analysing an SPI communication and I want to detect patterns on MISO and MOSI, so I've added your analyser 2 times.

When I start the capture, with patterns "init" = 05 48 F8; "setup" = 05 48 E0 for MOSI and "ON" = 00 02 . ; "OFF" = 00 01 . ; "Wheel color: {color:L}" = 00 80 color:. for MISO, I get the following error message:

MOSI decode error - IndexError('list index out of range')

File "C:\Users\neils\AppData\Roaming\Logic\Marketplace\161\custom_data_analyzer.py", line 110, in decode
    match_result = candidate.pattern.match(datum, candidate.env)

  File "C:\Users\neils\AppData\Roaming\Logic\Marketplace\161\lib\pattern_element.py", line 140, in match
    return self.pattern_element.match(datum, env)

  File "C:\Users\neils\AppData\Roaming\Logic\Marketplace\161\lib\pattern_element.py", line 107, in match
    result = self.pattern_elements[self.current_pattern_index].match(datum, env)

And I also get this
image

I've found that when I put 02 as pattern for the MISO analyser and no pattern for MOSI, it works fine in realtime (the pattern is sent every 39ms). But when I put 48 as pattern for MOSI and no pattern for MISO, I get the error

MOSI decode error - IndexError('list index out of range')

File "C:\Users\neils\AppData\Roaming\Logic\Marketplace\161\custom_data_analyzer.py", line 110, in decode
    match_result = candidate.pattern.match(datum, candidate.env)

  File "C:\Users\neils\AppData\Roaming\Logic\Marketplace\161\lib\pattern_element.py", line 107, in match
    result = self.pattern_elements[self.current_pattern_index].match(datum, env)

Here is the screenshot of a sequence if this can help:
image

Thanks for the report, and I'm glad this plugin is useful! I only published it a few days ago, so well done on finding it so quickly 😆

I've had a play around, but have struggled to reproduce this myself.

Please would you be able to provide your Saleae Logic2 session file, so that I can import it and see for myself?
Thanks in advance!

(N.B. I've been working on updates to this plugin, which will be breaking changes for you - namely that bytes now need an explicit base, so "init" = 05x 48x F8x instead. If you update your plugin, you will need to update your patterns accordingly!)

Aha - I think I've reproduced this myself now. It's not 100% consistent on my system! (.sal file)

@NeilSCGH Please try installing v0.0.3 and seeing if that resolves your issue 😃 (You'll need to update your pattern as described above)

Hi,
I've just tried v0.0.3 and it seems to have fixed the problem :). The patterns are now detected without any issues in live mode, even with multiple CustomData analysers on different channels.

Note : for me it wasn't 100% consistent neither, sometimes it worked and sometimes not. But now it works every time
Thanks for your work :)