DreamSourceLab / DSView

An open source multi-function instrument for everyone
www.dreamsourcelab.com
GNU General Public License v3.0
1.09k stars 411 forks source link

CAN FD decoder #109

Open kanji2000 opened 6 years ago

kanji2000 commented 6 years ago

I really need 'CAN FD' decoder. Could you please support it.

Linjieqiang commented 4 years ago

+1

DmitryD1 commented 4 years ago

+1

abougouffa commented 4 years ago

:+1:

heshanxingzhe commented 2 years ago

+1

1101459202 commented 1 year ago

+1

CZZ187827 commented 1 year ago

我根据Can的写了一个CanFD的。

wdim0 commented 1 year ago

CAN-FD is more and more common nowadays. I'd like to use DSView to debug my CAN-FD project. It would be great to have CAN-FD decoder in DSView.

abougouffa commented 1 year ago

@wdim0 @CZZ187827 @1101459202

I've integrated some of sigroks decoders into DSView from a while, I didn't get the time to test them all, the new CAN decoder supports CAN-FD.

I've just opened a PR, if you want to test the new decoder, you can clone from my fork https://github.com/abougouffa/DSView/tree/feat/decoders

wdim0 commented 1 year ago

@abougouffa

I've cloned your fork and tried it, but there's an error: image

I've also checked the latest version of ".../libsigrokdecode4DSL/decoders/can/pd.py" on sigrok web http://sigrok.org/gitweb/?p=libsigrokdecode.git;a=tree;f=decoders/can;h=a9b52f173e2ca7df101087af1da8e8e5e117402f;hb=HEAD

but the file has the same content (except one line at start in comment with copyright) and it produces the same error. I'm afraid we have to wait until somebody with good "python + sigrok decoder architecture" skills will fix that.

Thanks anyway!

abougouffa commented 1 year ago

@wdim0 You can try to replace these lines:

https://github.com/abougouffa/DSView/blob/feat/decoders/libsigrokdecode4DSL/decoders/can/pd.py#L517-L520

With:

if (self.matched & (0b1 << 1)):
    self.dom_edge_seen()
if (self.matched & (0b1 << 0)):
    self.handle_bit(can_rx)

It is the libsigrokdecode4dsl which is not up-to-date, compared with the upstream libsigrokdecode. I don't understand why they made their own fork, which is constantly far behind the upstream one, instead of depending on the upstream lib directly. There is a very good proposition in #428, but the response from DreamSourceLab's developer was kind of hostile!

wdim0 commented 1 year ago

@abougouffa Yep! That's working!! Thank you so much abougouffa

CAN-FD frame: Screenshot from 2022-09-27 12-43-19

RoopaPalyegar commented 11 months ago

Hi, I am new here. I need to decode CAN-FD data. Critical stage of the proejct. Can anyone offer any help? I downloaded the zipped folder from "https://github.com/sigrokproject/libsigrokdecode" Replaced "decoders" folder in my laptop with the 'decoders' folder from the downloaded zipped folder. Replaced the 4 lines as suggested by @wdim0 But I get "Decoder Reported an error"

Capture
abougouffa commented 11 months ago

Hello @RoopaPalyegar

AFAK, CAN-FD is supported in the last 1.3.0 version. This hack was proposed for an older version.

EDIT: It seems that you are using PulseView! This discussion is intended for DSView.