Hi! Thank you for your positive remarks! Now, to be honest, and this might sound a little bit weird, but... I have, like, designed two embedded processors, written one operating system from scratch, complete with linkers and loaders, retargetted a C compiler and written numerous device drivers, but I have never used git and this is my first ever attempt at writing Python, or indeed even looking at Python code, so I'm more than a little in over my head.
I just needed to get the SD card decoder working, because as I said, the decoder decodeds forever all packets wrong after the first mis-step of the state machine, making the entire trace unreadable and often to crash, and that's what I needed to fix and so I fixed that. The jist of it is this line: > + self.token, self.state = [], 'GET COMMAND TOKEN' which puts the state machine on its correct foot again. And my friend Hannu convinced me to send my work to the mailing list, so I distilled it a bit to emphasize my modifications and hope for the best... because that's what I *can* do. I'm amazed by the quality and usefulness of sigrok/pulseview, and I'd love to be able to do it correctly, but right now I just don't have the skills for it. It looks like a fascinating learning project, though. So I just wonder if it would be possible for you to find a way to bake in that one line, which resets the state machine so the rest of the trace becomes readable again. I'm sure others would appreciate it, I can just go on using my modified version. With immense gratitude of your amazing collective programming work, Panu/VLSI > Hi, > > On Fri, Jan 10, 2020 at 08:51:44AM -0000, panu-kristian.poiks...@vlsi.fi > wrote: >> Here's an error condition robustness update for SD Card (sdcard_sd) >> protocol analyzer. It adds recovery from state machine failures caused >> by >> missing packets, which would make the decoder show replies as commands >> and >> commands as replies, which was a common annoyance in my debug traces. >> >> For more information and screenshots, please visit: >> >> https://imgur.com/a/TeVnzR3 > > Quick review: > > + # for readability's sake, only show ones in the raw waveform > + if s[bit][2] == 1: > + self.putf(bit, bit, [128, ['%d' % s[bit][2]]]) > > This is no longer necessary, the decoder now has individual annotation > classes for 0 bits and 1 bits, so you can show/hide them independently > in the latest PulseView nightly build. > > + # Improve readability by showing the transmission bit > differently, original line below... > + # self.putf(1, 1, [130, ['Transmission: ' + t, 'T: ' + t, 'T']]) > + k = 130 if s[1][2] == 1 else 131 > + t = 'C' if s[1][2] == 1 else 'R' > + self.putf(1, 1, [k, [t,t,t]]) > > This looks like a useful change in general, but will need to be reworded > a bit for the latest git state of the decoder. > > Also, please use longer and shorter string versions, they're used > for different zoom levels in GUIs (e.g. ['Card', 'C'] and such). > > + # is it a reply instead of a command? > + s = self.token > + if s[1][2]==0: > + self.putr('DECODER EXPECED A COMMAND, BUT THIS IS A REPLY') > + self.token, self.state = [], 'GET COMMAND TOKEN' > + return > > This could be a nice feature as well, but please put the output on an > extra "Warning" annotation class and a "Warnings" row indeed, as Soeren > mentioned in another mail. Also, no need for all-caps in the warning. > > > If possible, please put your changes in a git repo (GitHub or > elsewhere), or send patches in the usual git format. Example: if you > have exactly one local commit, this will get a file you can attach to > mails: > > git format-patch HEAD~1 > > > Thanks! Uwe. > -- > http://hermann-uwe.de | http://randomprojects.org | http://sigrok.org > _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel