libusb_open_device_with_vid_pid() returns the first VID:PID match, so
with two ESP32-S3 cables connected, every invocation programmed the
same board. Replace it with a libusb_get_device_list() iteration that
also honours cable.bus_addr/device_addr (already exposed as
--busdev-num) and --usb-serial-num flag that matches the device
iSerialNumber by substring (useful with MAC-derived serials).
The -d /dev/ttyACM* path could not help: that's the CDC-ACM interface
(iface 0), while JTAG is on the vendor iface 2 reached via libusb;
ttyACM numbering and libusb enumeration order are independent.
Constraint: must keep existing single-board invocations working without flag changes
Confidence: high
Scope-risk: narrow
Directive: arguments struct uses positional aggregate init at main.cpp:120; new fields must add a matching slot
Not-tested: simultaneous two-board programming on real hardware (single-board path verified to build)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pass cable.vid and cable.pid to DirtyJtag constructor instead of using
hardcoded DIRTYJTAG_VID/PID. This allows users to use DirtyJTAG-compatible
firmware with custom USB VID/PID using the --vid and --pid flags:
openFPGALoader -c dirtyJtag --vid 0x1337 --pid 0x0001 bitstream.fs
This is useful for custom DirtyJTAG implementations, embedded microcontrollers
with built-in JTAG adapters, or devices that use MS OS 2.0 descriptors for
automatic WinUSB driver loading with different VID/PID.
The default VID/PID (0x1209:0xC0CA) is preserved for backward compatibility.
- copy dirtyjtag to esp_usb_jtag, it compiles
- copy protocol definiton, defines and private data/struct from openocd esp_usb_jtag.c
- ulx3s_esp board with esp32s3 cable
- esp_usb_jtag specify usb vid:pid in jtag.cpp
- hardcode usb interface and endpoints
- getting caps
- set chip id (not applicable for fpga)
- tms write done, untested
- cleanup and toggle clk
- 32bit counting
- setting divisor (todo read base freq)
- div range within 1-255
- base speed from descriptor
- fix doc typo with swapped tms/tdi some cleanup but it doesn't work.