Skip to content

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USB2244 EEPROM Programmer

In-system configuration-EEPROM programmer for the Microchip USB2244 card‑reader controller. Read, edit, and program the board's settings (USB VID/PID, strings, power, LEDs, LUN map, …) over the controller's vendor SCSI interface — no external EEPROM programmer or bench tooling required.

Ships with both a desktop GUI (usb2244-gui) and a command‑line tool (usb2244). The configuration codec, image builder, and device transport are shared between the two and covered by an automated test suite, including a golden vector captured from a known‑good vendor write.

USB2244 EEPROM Programmer GUI


Features

  • Edit every configuration field — identity (serial, VID, PID, language ID, manufacturer, product), power (bus/self/wake, MaxPower in mA, per‑slot power bytes), attribute bit‑flags, device‑ID / SCSI‑inquiry strings, and the LUN map.
  • Per‑field documentation — hover any field (or its label) and its address, default, and description appear in the Help pane.
  • Changed‑value highlighting — any field whose value differs from the factory default is tinted light yellow, live as you type.
  • Read / Program with verify — programming writes the 512‑byte image, waits out the board's USB re‑enumeration, reads the config back, and verifies it byte‑for‑byte.
  • Settings files — save/load the configuration as human‑readable JSON; restore factory defaults at any time.
  • Batch programming — optional auto‑increment of the serial number after each successful program.
  • CLI for scripting and CI — build/inspect images offline and program boards from the command line.

Requirements

  • Windows (device access uses Windows \\.\PhysicalDrive SCSI pass‑through).
  • Python 3.11+.
  • Administrator privileges for any device operation (detecting, reading, or programming a board needs raw drive access). The editor, help, and JSON load/save work without elevation.

The configuration/help/JSON features are cross‑platform; only the device I/O is Windows‑ and Administrator‑specific.


Installation

python -m venv .venv
.venv\Scripts\activate
pip install -e .

This installs two entry points:

  • usb2244-gui — the desktop GUI
  • usb2244 — the command‑line tool

You can also run the GUI without installing:

python -m usb2244.gui

Using the GUI

Launch it from an Administrator terminal so it can see the board:

usb2244-gui

Layout (see screenshot above):

  • Toolbar / menusLoad / Save (JSON settings), Defaults (restore factory values), and the device actions Read and Program. The same actions live under the File and Device menus.
  • Device selector — pick the target board; Refresh rescans. If no board appears and you are not elevated, the status bar tells you device access requires Administrator.
  • Settings form — every field, grouped into Identity / Power / Attributes / Device IDs · Inquiry / LUNs. Fields that differ from the factory default are highlighted light yellow.
  • Help pane — shows the focused/hovered field's hex address, default value, and description.
  • Status bar — operation results (e.g. signature validity, VERIFIED, errors).

Typical workflow

  1. Click Read to load the attached board's current configuration.
  2. Edit fields as needed (validation runs inline; invalid values block programming).
  3. Click Program, confirm the (irreversible) write, and the tool writes, re‑enumerates, reads back, and reports VERIFIED or a byte‑level mismatch.
  4. Optionally tick Auto‑increment serial after each Program for batch runs.

⚠️ Programming is irreversible. Always Read/back up a board before writing if you may need to restore it.


Using the CLI

usb2244 <command> [options]

Device commands (need Administrator):

Command Description
list List USB2244 boards and their PhysicalDrive index
read Read & decode the board's config (-o saves the raw 256‑byte image)
backup Save the board's full 512‑byte EEPROM image (-o required)
write Program the board — --from-image or field flags; add --yes to actually write
set Read‑modify‑write specific fields on the board

File commands (offline, no hardware):

Command Description
build Build a 256‑byte .dat config image (--from a JSON file and/or field flags)
dump Decode and print a .dat config image
verify Check a .dat image for the required ata2 signature

Field flags (shared by build / write / set): --serial-number, --manufacturer, --product, --inquiry-vendor, --inquiry-product, --vid, --pid, --lang-id, --max-power, --bm-attributes, plus --increment-serial.

Examples:

# Inspect an attached board
usb2244 read

# Program a new product string + serial, with read-back verify
usb2244 set --product "Free Wili 4 Reader" --serial-number 000000225042 --yes

# Build an image offline and check it
usb2244 build -o myconfig.dat --vid 0x093C --product "Free Wili 4 Reader"
usb2244 dump myconfig.dat

How it works

The USB2244 stores its configuration in the first 256 bytes of an external 2‑wire EEPROM, validated by an ata2 signature. Rather than wiring up an EEPROM programmer, this tool updates it in system over USB using the controller's vendor SCSI commands (CF 54 03 to read pages, CF 54 04 to write the 512‑byte image), exactly as the vendor utility does — verified against a live golden capture.

The protocol and byte map were reverse‑engineered and documented here:

The Microchip USB2244 datasheet (DS00001979A) is not redistributed in this repository. Download it from the Microchip USB2244 product page.

Design and implementation records:


Project layout

src/usb2244/
  config.py      # configuration codec (encode/decode the 256-byte image)
  fields.py      # declarative registry of editable fields (drives the GUI + help)
  formmodel.py   # Tk-free conversion/validation between Config and form values
  programmer.py  # shared write -> re-enumerate -> read-back -> verify logic
  scsi.py        # Windows SCSI pass-through transport + device discovery
  imagefile.py   # 256-byte config <-> 512-byte EEPROM image
  cli.py         # command-line interface
  gui.py         # Tkinter desktop GUI
protocol/        # reverse-engineered protocol & EEPROM map docs
docs/            # design specs, implementation plans, screenshot
tests/           # pytest suite (incl. golden vendor-capture vector)

Development

pip install -e ".[dev]"
python -m pytest

The device transport is injectable, so the codec, form model, programmer, and CLI are tested without hardware; the GUI has a construction/behavior smoke test, and a golden 512‑byte vendor capture pins the encoder byte‑for‑byte.


License

Released under the MIT License.

The Microchip USB2244 datasheet is © Microchip Technology Inc. and is not included in this repository; obtain it from Microchip.

About

In-system configuration-EEPROM programmer (GUI + CLI) for the Microchip USB2244 card-reader controller

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages