Skip to content

EEPROM Utilities

Three tools manage the SkyWalker-1’s I2C EEPROM (24Cxx-family at address 0x51): eeprom_write.py for flashing firmware images, eeprom_dump.py for reading EEPROM contents, and eeprom_probe.py for testing I2C addressing methods.

The EEPROM stores the Cypress FX2 boot firmware in C2 IIC format. The FX2 loads this firmware automatically on every power-up. Writing incorrect data to the EEPROM will prevent the device from enumerating on USB.

Terminal window
pip install pyusb

eeprom_write.py is the full-featured EEPROM management tool with four subcommands.

SubcommandPurpose
infoParse and display C2 header from a .bin file (offline, no device needed)
backupDump current EEPROM contents to a file
verifyCompare a .bin file against current EEPROM contents
flashWrite a C2 firmware image to the EEPROM

Parse and display the C2 header and load records from a firmware binary without connecting to the device.

Terminal window
python3 tools/eeprom_write.py info firmware.bin
C2 Image: firmware.bin
File size: 9512 bytes
========================================
Header:
Format: C2 (Large EEPROM, code loads to internal RAM)
VID: 0x09C0 (Genpix)
PID: 0x0203 (SkyWalker-1)
DID: 0x0000
Config: 0x40 (400kHz I2C)
Load Records:
[0] 1023 bytes -> 0x0000-0x03FE [02 18 8d 78 7f e4 f6 d8...]
[1] 1023 bytes -> 0x03FF-0x07FD [...]
...
[9] 115 bytes -> 0x23F7-0x2469 [...]
[10] END MARKER -> entry point: 0xE600
Total firmware: 9472 bytes in 10 segments
Entry point: 0xE600 (LJMP target after boot)
EEPROM footprint: 9512 bytes (0x2528)
Terminal window
sudo python3 tools/eeprom_write.py backup -o my_backup.bin
Specify read size
sudo python3 tools/eeprom_write.py backup -o my_backup.bin --max-size 16384
FlagDescription
-o, --output FILEOutput file (default: skywalker1_eeprom.bin)
--max-size BYTESMaximum bytes to read (default: 16384)

Read the EEPROM and compare byte-by-byte against a local .bin file. Reports any mismatches with offset and expected vs. actual values.

Terminal window
sudo python3 tools/eeprom_write.py verify firmware.bin

Exit code 0 = match, 1 = mismatch.

The flash workflow includes built-in safety measures: image validation, VID/PID check, automatic backup, countdown timer, write verification.

  1. Validate the C2 image file (header format, VID/PID match, record integrity)
  2. Connect to the SkyWalker-1 and check device VID/PID against the image
  3. Backup the current EEPROM contents to a timestamped file
  4. Wait 3 seconds with a countdown (Ctrl-C to abort)
  5. Write the image in 16-byte page-aligned chunks with 10 ms write cycle delays
  6. Verify by reading back and comparing every byte
Flash with all safety checks
sudo python3 tools/eeprom_write.py flash firmware.bin
Dry run (shows what would happen, writes nothing)
sudo python3 tools/eeprom_write.py flash firmware.bin --dry-run
Skip backup (not recommended)
sudo python3 tools/eeprom_write.py flash firmware.bin --no-backup
Force flash with VID/PID mismatch
sudo python3 tools/eeprom_write.py flash firmware.bin --force
FlagDescription
FILEC2 firmware image (positional, required)
--dry-runValidate and show plan without writing
--no-backupSkip pre-flash EEPROM backup
--forceOverride VID/PID mismatch check
ParameterValue
I2C slave address0x51 (7-bit)
Vendor command (write)I2C_WRITE (0x83)
Vendor command (read)I2C_READ (0x84)
Page size16 bytes (conservative for 24Cxx)
Write cycle time10 ms per page
Maximum image size16,384 bytes (16 KB)

The EEPROM stores firmware in the Cypress C2 IIC second-stage boot format:

FieldOffsetSizeDescription
Marker010xC2 (large EEPROM, external memory)
VID12USB Vendor ID, little-endian (0x09C0)
PID32USB Product ID, little-endian (0x0203)
DID52Device ID, little-endian
Config71Boot config (0x40 = 400 kHz I2C)
Records8+varCode segments: [len_hi][len_lo][addr_hi][addr_lo][data...]
Endlast4[0x80][0x01][entry_hi][entry_lo] (entry point = 0xE600)

For a full description of the storage format, see Firmware Storage Formats.