dreamsourcelab-dslogic: support DSLogic Plus Pango variant (2a0e:0034)#291
dreamsourcelab-dslogic: support DSLogic Plus Pango variant (2a0e:0034)#291huehuehuehueing wants to merge 1 commit into
Conversation
…0034)
Adds support for the DSLogic Plus hardware revision that enumerates
as USB ID 2a0e:0034 ("USB-based DSL Instrument v2") and ships with a
Pango FPGA bitstream. This revision speaks a newer envelope-style
control protocol than the existing DSLogic family; the driver gains a
parallel V2 path while leaving the V1 (flat-opcode) path untouched.
Architecture
------------
- struct dslogic_protocol_ops vtable in protocol.h with one slot per
operation whose wire format differs between protocol versions
(fpga_firmware_upload, fpga_config, acquisition_start/stop,
set_samplerate/voltage_threshold/trigger/external_clock/clock_edge,
security_check).
- enum dslogic_protocol_version per profile (DSL_PROTO_V1 or
DSL_PROTO_V2). All existing profiles tagged V1; PID 0x0034 tagged V2.
- dev_context gains a cached ops pointer resolved at dev_open.
- protocol_v1.c (new): thin facades over the existing V1 functions,
bound into dslogic_v1_ops. Pure refactor with no wire changes.
- protocol_v2.{c,h} (new): the envelope-protocol implementation.
Wire format (V2)
----------------
- Three control opcodes only: CMD_CTL_WR=0xb0, CMD_CTL_RD_PRE=0xb1,
CMD_CTL_RD=0xb2. The packed struct ctl_header (dest, offset, size)
carries the real destination via a DSL_CTL_* enum
(HW_STATUS, INTRDY, WORDWIDE, START, STOP, BULK_WR, NVM, I2C_REG,
I2C_STATUS, PROG_B, LED, FW_VERSION).
- command_ctl_rd_v2 is two-phase: PRE (OUT) writes the header, 10 ms
sleep, then RD (IN) collects the requested bytes.
- Register R/W (dsl_wr_reg_v2 / dsl_rd_reg_v2) wraps the envelope with
I2C_REG (write) / I2C_STATUS (read) destination and a 1-byte address
in offset. NVM reads use DSL_CTL_NVM.
Bitstream upload (V2)
---------------------
Mirrors DSView's dsl_fpga_config sequence:
PROG_B low -> LED off -> PROG_B high -> wait FPGA_INIT_B -> INTRDY
low -> DSL_CTL_BULK_WR with 3-byte filesize -> bulk transfer bitstream
on ep2 OUT -> INTRDY high -> wait GPIF_DONE -> INTRDY low -> wait
FPGA_DONE -> LED green -> WORDWIDE high.
Security challenge (V2)
-----------------------
The 0x0034 firmware gates capture on an 8-step challenge-response over
an I2C register block (SEC_CTRL_ADDR=0x73, SEC_DATA_ADDR=0x75). The
encryption blob is read from device NVM at SECU_EEP_ADDR=0x3C00 via
DSL_CTL_NVM. Implemented as v2_security_check; called from dev_open
after the FPGA bitstream is loaded. Mirrors DSView's dsl_secuCheck.
FPGA arm (V2)
-------------
WORDWIDE -> DSL_CTL_BULK_WR (3-byte word count = sizeof(setting)/2 =
186) -> poll bmSYS_CLR -> bulk transfer struct DSL_setting (372 bytes)
on ep2 OUT -> DSL_CTL_INTRDY -> read HW_STATUS once and check
bmGPIF_DONE. The DSL_setting layout (with its (register_index << 8) |
word_count header encoding) and the samplerate divider math
(hw_max=500 MHz, pre_div=5 for DSLogic Plus pgl12) mirror DSView's
dsl_fpga_arm. Sample count is shifted right by 4 because the FPGA's
minimum capture unit is 16 samples.
V2 acquisition stop is two-stage like DSView's: write CTR0_ADDR :=
bmFORCE_RDY first (soft FPGA abort that releases the GPIF capture
engine and resets the green LED to solid), then DSL_CTL_STOP.
dev_open changes
----------------
- Extends has_firmware product-string probe to recognise "USB-based
DSL Instrument v2" so the V2 device skips the legacy FX2 firmware
upload (which would renumerate it to 0x0020 with the V1 firmware).
- V2 path performs DSL_CTL_FW_VERSION + DSL_CTL_HW_STATUS reads at the
start of dev_open (matches DSView's hw_dev_open + dsl_dev_open
initialisation). The pre-existing V1 firmware version probe at
bRequest 0xb0 collides with V2's CMD_CTL_WR opcode and is now
V1-gated.
- After bitstream upload + security check, an initial voltage threshold
is written to VTH_ADDR via the new vtable slot.
Tested on real PID 0x2a0e:0x0034 hardware: scan, FPGA bitstream upload,
security challenge, FPGA arm, sample capture (100 samples / 16 channels
at 1 MHz returns 1959 bytes), and clean stop with idle-LED state.
Co-authored-by: Larry Hernandez <l.gr@dartmouth.edu>
|
You are awesome. I just purchased this exact same device! One question though:
It seems that the current master branch of DSView no longer ships with EDIT: At first glance this seems to work quite nicely, thanks a lot! |
|
@vhdirk Thank you for your appreciation! I figured there must be other people who are either broke, or want to push cheap "crap" to its Rohde & Schwarz pedigree potential, or both. As they say, great things have smol beginnings. It would be fantastic if you had a chance to test the full set of changes. The chunked transfer feature is something I hope to see merged. It should enable using any LA, and especially the cheap DSLogic series, for full duty/continuous streaming, by stitching the transfers. Normally you are limited to whatever caching/on-board RLE/storage tricks are available, with degraded channel counts and bandwidth per channel. You may need to fine-tune the settings if you are using one of the USB 2.0 models (as was my case), as that will quickly saturate the bus bandwidth. Happy to provide suggestions. Hammer it with high speed SPI (e.g. SD card transfers). |
|
I tested with the full set of changes from the start. One thing I noticed, and I'm not sure where this originates, is that all signals just flatline after about 2 minutes of recording ( 12 channels, at 1Mhz). It was always 2 minutes and a couple of seconds. I don't think it's always exactly at the same time. Restarting the session fixes it, but that makes it unusable for now. Any idea what could be the cause of this? I'm using PulseView so I haven't looked if there are any meaningful log message or errors. I won't be able to assist with code, but I'm happy to test and provide logs or so. |
|
No problem re code. Logs/diagnostic data is enough.
e.g.
TL;DR We will need to isolate logs and SR dump files, compress those and upload them here. Do note that the chunked transfer mode is essentially abusing the hardware. I have no idea if it will not cause undefined behavior after some time (e.g. overheating). I will try to repro this locally. Thank you again :) |
Summary
Adds support for the DSLogic Plus hardware revision shipping with a Pango FPGA in place of the original Xilinx Spartan-6. The device enumerates as
2a0e:0034("USB-based DSL Instrument v2") and ships with theDSLogicPlus-pgl12-2.binbitstream.DreamSourceLab has been transitioning the DSLogic series away from Spartan parts to Pango (PGL12 family) silicon. The newer hardware speaks a different USB command transport than the existing flat-opcode protocol the upstream
dreamsourcelab-dslogicdriver implements, so--scanrecognised the device only after a USB-ID addition, and any capture attempt hung on opcode collisions (e.g. the legacyDS_CMD_START=0xb2collides with the new firmware'sCMD_CTL_RD=0xb2).This change keeps the existing V1 (flat-opcode) path untouched for all currently-supported PIDs and adds a parallel V2 (envelope) path that the Pango variant binds to.
Approach
A
struct dslogic_protocol_opsvtable inprotocol.hdecouples wire-format-specific operations from the rest of the driver:Each profile in
supported_device[]gains aprotocol_versionfield (DSL_PROTO_V1orDSL_PROTO_V2) and anopspointer. All existing entries are tagged V1 and bound to a newdslogic_v1_opstable whose entries are thin façades over the unchanged V1 functions (no behaviour change for existing hardware). The 0x0034 entry is tagged V2.protocol_v1.c(new) holds the V1 façades.protocol_v2.{c,h}(new) hold the V2 envelope implementation: three-opcode transport (CMD_CTL_WR/RD_PRE/RD) with actl_headerselector, register/NVM access wrappers, FPGA bitstream upload (the multi-step PROG_B/INIT_B/GPIF_DONE/FPGA_DONE/LED sequence), an 8-step security challenge over the I²C-mapped SEC_CTRL/DATA registers, the FPGA arm sequence with thestruct DSL_settingblob, acquisition start/stop, and a two-stage stop that issuesCTR0_ADDR := bmFORCE_RDYbeforeDSL_CTL_STOPso the FPGA capture engine releases cleanly.The Pango variant also ships its FX2 firmware in internal flash and presents the product string
"USB-based DSL Instrument v2", so the existinghas_firmwareproduct-string probe is extended to recognise it and skip the legacy FX2 firmware upload (which would otherwise renumerate the device to0x0020running the V1 firmware).The V2 envelope protocol, security challenge, FPGA arm sequence,
struct DSL_settinglayout, and register addresses all mirror DSView 1.3.2'slibsigrok4DSL/hardware/DSL/reference implementation byte-for-byte. The new files inprotocol_v2.{c,h}carry the original Bert Vermeulen and DreamSourceLab copyrights alongside the new contributor line; both projects are GPLv3 so the license stack is compatible.What works
sigrok-cli --scanrecognises the device (PID0x2a0e:0x0034, product string "USB-based DSL Instrument v2")bitsformat in well under a secondWhat's not in this change
sigrok-firmware. For now users must placeDSLogicPlus-pgl12-2.bin(extracted from DSView) at$prefix/share/sigrok-firmware/dreamsourcelab-dslogic-plus-fpga.fw. A follow-up should extendsigrok-fwextract-dreamsourcelab-dslogicinsigrok-utilto fetch it.struct DSL_setting_ext32(gated onCAPS_FEATURE_LA_CH32) is intentionally not added; the 16-channel Plus does not need it.Test plan
makebuilds cleansigrok-cli --scanrecognises a connected2a0e:0034devicesigrok-cli -d dreamsourcelab-dslogic -c samplerate=1000000 --samples 1000 -O bitsreturns 1000 samples within ~1 s--scansigrok-cli --scan+ a small capture on an unmodified DSLogic / DSLogic Pro / DSLogic Plus (Spartan) to confirm no regression in the V1 path