The following options were set in "Connect to Device" menu: 1) Driver - ols 2) Interface - Serial Port (/dev/tty/ACM1) Scanning for devices produced no output in "Select the device window", but the following error appeared in the command line: sr: ols: Invalid reply (expected '1SLO' or '1ALS', got 'ALS1'). On a few occasions (can't reproduce reliably) "Sump Logic Analyzer" did show up in the "Select the device" window, but attempts to connect to the device resulted in software crashing.
"Software crashing" probably means PulseView segfaulting. Yes, that used to happen when OLS devices were not able to send metadata. This part has been fixed with 519a6ed ("Fix #928 by catching errors if config_list() fails") and is included in the latest PulseView version already. For the improper scanning, hard to tell. The next libsigrok version will likely have a timeout there increased because I needed this for another device. It could help here, too. Not super-likely, though. Is it the original or the latest firmware?
Depending my experience; This happen due sigrok doesn't clear rx buffer on serial initialization, at least before sending 0x00's. If there are an unread byte available at line, due an interference, previous sessions, or DTR reset (on some devices prints some boot init strings to serial line), 1ALS corrupted on first read on receiver side because line has some data like 3 byte 'xxx'. At first read let say rx line has 'xxx' chars. For detection sent 0x00 * 5. HW feed line with 1ALS. At receiver side it become 'xxx1' but 3 byte 'ALS' is wait at buffer. At second trial, HW feed 1ALS again. But at receiver side it reads ALS1, 3 byte 'ALS' is still stay at buffer. Flushing the rx via an external program (like cutecom) resolves this issue. After, detection work as intended. I think it's better to flush available RX buffer before sending 0x00 * 5 on OLS devices.
Makes sense to me. Thanks! Unless you say you want to do it, I will try to make a patch and test it later this week.
have the same issue (but on windows) openbench is not found in the command line and pulseview just crashes at start up (openbench connected) and if i start pulseview without openbench connected, it crashes when I select the device(don't get any error in both cases...) so i'm looking forward for your patch :) thanks!
I don't notice the your reply Wolfram. Thank you for fixing it. :)
Created attachment 584 [details] OpenBenchLogic serial init code fix
Created attachment 585 [details] OLS init needs flush patch
Created attachment 586 [details] OLS init needs flush patch Fixed using proper function. Discard old patch.
Created attachment 587 [details] flush buffers after open in libserialport Sorry for not answering earlier, I am on the road an can't do actual testing. However, I think the flushing should be done in libserialport to be generic. I attach a WIP which needs testing, but shows the concept. Famous last word: i'll try to test it this week.
Bummer, even with both(!) patches applied (libsigrok patch + libserialport patch), I still can't get it to work reliably :( I get two bad cases, one is the serial port getting stuck after the 4th reset cmd. This happens often. The other one is a shifted identification string like comment #1 was reporting. This happens once in a while. I tried some other flushing but to no avail. Needs more debugging. My test scenario: $ sigrok-cli --driver=ols:conn=/dev/ttyACM0 --samples 6144 <then CTRL+C before capture does finish> $ sigrok-cli --driver=ols:conn=/dev/ttyACM0 --scan -l 5
(In reply to Wolfram Sang from comment #10) > Bummer, even with both(!) patches applied (libsigrok patch + libserialport > patch), I still can't get it to work reliably :( I get two bad cases, one is > the serial port getting stuck after the 4th reset cmd. This happens often. > The other one is a shifted identification string like comment #1 was > reporting. This happens once in a while. I tried some other flushing but to > no avail. Needs more debugging. > > My test scenario: > > $ sigrok-cli --driver=ols:conn=/dev/ttyACM0 --samples 6144 > > <then CTRL+C before capture does finish> > > $ sigrok-cli --driver=ols:conn=/dev/ttyACM0 --scan -l 5 Hi I think I had a similar issue to yours? https://sigrok.org/bugzilla/show_bug.cgi?id=1597