Dangerous Prototypes

Dangerous Prototypes => Logic Pirate => Topic started by: cwall on March 08, 2015, 04:10:19 pm

Title: Logic Pirate and sigrok-cli
Post by: cwall on March 08, 2015, 04:10:19 pm
I have not been able to get the Logic Pirate to work with sigrok-cli to get a capture.  I think the problem might be that the Logic Pirate does not give the number of probes or maximun number of samples, when it is asked.  The Bus Pirate V3.6 which does work, gives the number of channels and the maximun number of samples.  This is the only difference that I can see when I use.

sigrok-cli --driver ols:conn=/dev/ttyACM0 --show      for the Logic Pirate
 
"  serialcomm
ols - Logic Pirate (40 MHz) FPGA version 2013-06-25
Supported configuration options:
    samplerate (10 Hz - 200 MHz in steps of 1 Hz) "

sigrok-cli --driver ols:conn=/dev/ttyUSB0 --show      for the Bus Pirate V3.6

 " serialcomm
ols - BPv3 with 5 channels: 0 1 2 3 4
Supported configuration options:
    Maximum number of samples: 4096
    samplerate (10 Hz - 200 MHz in steps of 1 Hz) "

Other than that, the two output files are the same for the show command.

Carl
Title: Re: Logic Pirate and sigrok-cli
Post by: guttula on September 05, 2015, 11:36:00 am
The reason for this is that the Logic Pirate doesn't support the whole extended SUMP protocol. I'm trying to get in contact with somebody who is allowed to make editions to the repository since I've made the necessary changes for the Pirate to correctly support the SUMP metadata. If these changes are applied, then the Pirate should be compatible with the OLS driver in sigrok. If it's not too much effort then you could apply a patch locally in the SVN repository yourself and rebuild the firmware (easier on Windows than Linux).

The patch is currently untested, but it only contains changes to the metadata string, so it shouldn't break anything. If I'm not replying to this thread in a week or so, I probably never managed to set up a working environment on my machine for doing the testing.

If anyone knows what the process for submitting patches is, or knows who is responsible for the repository, I'd love to know :)

Code: [Select]
Index: main.c
===================================================================
--- main.c      (revision 2177)
+++ main.c      (working copy)
@@ -525,13 +525,23 @@
 static const char id_string[ 4 ] = { "1ALS" };
 
 // http://dangerousprototypes.com/docs/The_Logic_Sniffer%27s_extended_SUMP_protocol#Metadata_command
-static const char meta_info[] = { "x01" "Logic Pirate ("
+static const char meta_info[] = {
+    "x01" "Logic Pirate" "x00"
+//  "x02" "" "x00"            //there is no FPGA firmware
+    "x03" "2015-09-05" "x00"  //PIC firmware version
+    "x20" "x00x00x00x08"  //8 probes
+    "x21" "x00x03xe8x00"  //256k sample memory
+//  "x22" "x00x00x00x00"  //there is no dynamic memory
 #if defined( OVERCLOCK )
-                                  "60"
+    "x23" "x03x93x87x00"  //60MHz maximum sample rate
 #else
-                                  "40"
+    "x23" "x02x62x5ax00"  //40MHz maximum sample rate
 #endif
-                                  " MHz)" "x00" "x02" "2013-06-25" "x00" "x00" };
+    "x24" "x00x00x00x02"  //protocol version 2
+    "x40" "x08"              //8 probes
+    "x41" "x02"              //protocol version 2
+    "x00"
+};
 static config_t config = { 0 };
 static bool do_fill_ram = false;
 static uint32_t delayed_fill_counter = 0;
Title: Re: Logic Pirate and sigrok-cli
Post by: tofurky on March 10, 2019, 09:26:31 pm
thanks for posting the patch. i meant to make this reply several months ago but ran into an issue trying to register for the forum ;)
anyhow, please see attached 40mhz and 60mhz logic pirate firmwares (in .zip) with the new metadata version.
tested in pulseview 0.4.0.
compiled with mplab x v4.20 and xc32 v2.10.
for those who aren't registered etc., you can goto tinyurl y2u99djv (i'm too new to post proper links).