Press "Enter" to skip to content

SFP-Master for Windows

SFP-Master is a SFP I2C programming by using commodity hardware such as popular CH341a, for this, you can program your SFP Sticks without buying expansive commercial programmer for hobby, tinkering and developer

Today, I managed to port bigbigmdm/SFP-Master to Windows by using MSYS2 (MinGW64) cross-compile, despite original code was coded for Linux, I have fork and modified for Win32 build direction, which still can compile for Linux.

Download

The per-compiled and libusb driver can be found at my GitHub:

https://github.com/Anime4000/SFP-Master/releases

⚠️ In-order SFP-Master to work, libusb driver is required, the zip package has the driver, remove existing and install, scroll down to Driver section below how to do it

Build from Source

Before proceed, make sure your MSYS2 environment is up to date! If not, follow this:

Update MSYS2

Update Repo

pacman -Syu

Reopen MSYS2 (MinGW64) and paste this:

pacman -Su

Install Development, libusb, qt5:

pacman -S --needed base-devel git subversion mercurial nasm yasm cmake msys2-runtime-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-cross-binutils mingw-w64-x86_64-libusb mingw-w64-x86_64-qt5

Clone Repo

git clone https://github.com/Anime4000/SFP-Master

Enter build folder

mkdir SFP-Master/build
cd SFP-Master/build

Configure

cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG -static" -DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG -static"

Make Build

mingw32-make

Make Portable

To make SFP-Master works outside MSYS2 (MinGW) Environment, do this:

ldd SFP-Master.exe | awk '/mingw64/ {print $3}' | xargs -I {} cp {} .
cp -r /mingw64/share/qt5/plugins/platforms ./
cp -r /mingw64/share/qt5/plugins/styles ./

Create SFP-Master.cmd

This serve launch script with proper QT5 environment

@title SFP-Master for Windows (amd64)
@echo off
@cd /d "%~dp0"
set QT_PLUGIN_PATH=%CD%
SFP-Master.exe

Done!

Now you have build the SFP-Master for Windows from source code!

Driver

Despite SFP-Master is for Linux that relying on libusb library, your existing CH341a driver by WCH wont work, thus CH341a hardware need to use libusbK driver instead:

Remove WCH

Install libusb0

Verify the Driver

This show libusb0 driver has successfully installed, any program that use libusb and ch341a can use!

How to use

Welp, using this program are quite straightforward, if your SFP stick is password protected, press CTRL+P to bring up password fields, with correct password, you can change I2C EEPROM value

SFP I2C data need correct checksum, make sure run checksum before flashing!

AreaAddressDescription
🟩A0Vendor Data, Properties
🟪A1Unused/Vendor Specific
🟥A2DDM and Password at 0x17B – 0x17E
🟨A3Unused/Vendor Specific

That’s it!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.