On Montag, 20. Mai 2019 16:47:58 CEST 李易 wrote: > Hi, > > I tried to use sigrok-cli to sample an 8MHz SWO signal in Ubuntu and > Raspbian. But, I met a problem.
As you mention Raspbian, I assume you are using a RPi. > *sigrok-cli -d fx2lafw -c samplerate=24MHz -C 0=SWO,1=LED0,2=LED2 -O vcd -o > d.vcd --time 1s* > *Device only sent 12966912 samples.* You are trying to squeeze 24MByte/s through the Pi's USB controller without any fluctuations. The FX2 has 4 fifo buffers of 512 byte, i.e. 2kByte. At the given rate this fifo fills up in about 2kByte / 24MByte/s = 1/12000 s = 80 microseconds. USB is a polling protocol, if the controller fails to poll the FX2 for more than the specified time, you get fifo overruns and the transfer stops. The Pi's USB controller is a very simple one, intended for settop boxes. It is also just one single controller also used for e.g. your keyboard, mouse and network. 1. Use a proper computer with a dedicated USB controller for the port you are using for the FX2 (try "lsusb -t", the FX2 should be the only device on its bus). 2. Lower the samplerate. On a fast computer, even 16 MS/s is somewhat unreliable when running for longer time, 8 MS/s typically works. If you want to sample an 8MHz signal, thats obviously not enough. 3. Use a different LA, the FX2 based ones with "16 channels/100 MS/s" are able to leave ununsed channels out of the data stream, i.e. with 3 channels and 25 MS/s you end up with 75 Mbit/s ~ 9.5 MByte/s. Regards, Stefan _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel