This is a Windows port of the LibXSVF JTAG SVF/XSVF player for FTDI chips.
build_x86.bat- Explicitly builds 32-bit versionbuild_x64.bat- Explicitly builds 64-bit versionMakefile- For manual nmake builds
-
LibUSB + FTDI D2XX Drivers and Library
- Download from: https://ftdichip.com/drivers/d2xx-drivers/
- Download from: https://github.com/libusb/libusb/releases
- Install the CDM drivers
- Create a
ftdilibfolder in your project directory - Copy these files from the CDM package into
ftdilib:ftd2xx.h(andWinTypes.hif present)i386folder (for 32-bit builds)amd64folder (for 64-bit builds)
-
Compiler (one of the following):
- Visual Studio (any recent version) with C++ support
- MinGW-w64 (recommended: https://www.mingw-w64.org/)
- MSYS2 with mingw-w64 toolchain
You MUST match the architecture of:
- The FTDI library (i386 = 32-bit, amd64 = 64-bit)
- Your compiler target (x86 = 32-bit, x64 = 64-bit)
- The ftd2xx.dll at runtime
- Ensure you have the
ftdilibfolder set up with the FTDI libraries - Run the correct batch file from the appropriate Visual Studio command prompt:
- For 32-bit: Use "x86 Native Tools Command Prompt for VS"
- For 64-bit: Use "x64 Native Tools Command Prompt for VS"
For 32-bit:
- Open "x86 Native Tools Command Prompt for VS"
- Navigate to the source directory
- Run:
nmake /f Makefile
For 64-bit:
- Open "x64 Native Tools Command Prompt for VS"
- Navigate to the source directory
- Run:
nmake /f Makefile
- Open a command prompt
- Navigate to the source directory
- Run:
mingw32-make USE_MINGW=1
- Threading: Disabled pthread-based background reading (can be re-enabled with Windows threads if needed)
- Time Functions: Added Windows implementations for
gettimeofday()andusleep() - getopt: Added a simple getopt implementation for command-line parsing
- File I/O: Set binary mode for stdin/stdout to handle binary files correctly
- Headers: Replaced Unix-specific headers with Windows equivalents
- Control Port: Was removed entirely as it's not needed for J-Runner functionality
The usage is the same as the Linux version:
xsvftool-ftd2xx.exe -s file.svf # Play SVF file
xsvftool-ftd2xx.exe -x file.xsvf # Play XSVF file
xsvftool-ftd2xx.exe -c # Scan JTAG chain
xsvftool-ftd2xx.exe -l # List FTDI devicesCommon options:
-v: Verbose output (repeat for more verbosity)-f 1M: Set frequency to 1 MHz-p: Show progress-J "Device Name": Specify JTAG port by name-j 0: Specify JTAG port by index
-
"library machine type 'x64' conflicts with target machine type 'x86'"
- You're mixing 32-bit and 64-bit components
- Solution: Use the correct Visual Studio command prompt:
- For 32-bit: "x86 Native Tools Command Prompt"
- For 64-bit: "x64 Native Tools Command Prompt"
- Make sure the FTDI library matches (i386 for 32-bit, amd64 for 64-bit)
-
"FTDI device not found"
- Ensure FTDI drivers are installed
- Check device name with
-loption - Try running as Administrator
-
"ftd2xx.dll not found"
- Copy the correct ftd2xx.dll to the same directory as the .exe:
- For 32-bit exe: use 32-bit ftd2xx.dll
- For 64-bit exe: use 64-bit ftd2xx.dll
- Or add the FTDI driver directory to your PATH
- Copy the correct ftd2xx.dll to the same directory as the .exe:
-
Build errors
- Verify the
ftdilibfolder exists and contains the required files - Ensure you have the correct architecture (x64/x86) libraries
- Check that
ftd2xx.his in theftdilibfolder
- Verify the
- The Windows port has background reading disabled by default
- For better performance with large files, consider enabling BLOCK_WRITE in the source
- Synchronous mode (
-S) is more reliable but slower
- Background reading with threads is not implemented (can be added using Windows threads)
- Some timing precision may be reduced compared to Linux
- USB performance may vary depending on Windows USB driver stack