Skip to main content

Flash ROM to Cart

Flash ROM to Cart is the built-in tool for programming FlashKit-MD cartridges directly from the editor. It communicates with Krikzz's FlashKit-MD hardware over USB serial using the Web Serial API.

Use it to flash your game to a cartridge for testing on real hardware, read/write SRAM save data, and manage flash saves.

Getting Started

  1. Connect a FlashKit-MD device to your computer via USB.
  2. Open the tool from Game > Flash ROM to Cart.
  3. Click Connect — the editor will request access to the serial port.
  4. Once connected, the connection bar shows the device ID and flash chip info.

Click Get Info to query the flash chip. If the chip is in the known database, its name is shown (e.g. "S29GL032 — 4.0MB") instead of raw hex IDs.

Flash Last Export

After exporting a ROM from the editor (Game > Export As > ROM), the Flasher automatically detects the exported file. A Flash Last Export button appears showing the ROM filename — click it to flash the ROM to the connected cartridge in one step.

This is the fastest way to iterate: export → flash → test on hardware.

ROM Operations

The ROM operations section provides low-level access to the flash cart:

OperationDescription
Read ROMDump the cartridge contents to a .bin file. Specify the size and start address.
Write ROMFlash a .bin file to the cartridge. Erases the target region first, then programs using AMD Unlock Bypass mode.
EraseErase a region of flash (rounded to sector boundaries).
VerifyRead back the cartridge and compare against a file byte-by-byte.
CancelCancel any running operation.

The Verify after write checkbox (enabled by default) automatically verifies the data after a Write ROM operation.

Cart Info

  • Read Header — reads the Mega Drive ROM header and shows the game name, region code (J/U/E/W), and declared ROM size.
  • Detect Size — auto-detects the actual ROM size by scanning for address mirroring. This avoids dumping 4 MB of repeated data from a smaller ROM.

Flash Chip Identification

When you click Get Info, the tool queries the flash chip via CFI (Common Flash Interface) and looks up the manufacturer/device IDs in a built-in database. Recognized chips include models from AMD/Spansion, Macronix, Winbond, ST/Numonyx, SST, and others commonly found in flash cartridges.

SRAM

If the cartridge has battery-backed SRAM or FRAM, the Flasher can read and write save data.

  1. Click Detect SRAM to check for SRAM and determine its size.
  2. Read SRAM downloads the save data in emulator-compatible format (stripped — only the actual data bytes, not the raw 16-bit bus data). The resulting .srm file works directly with emulators.
  3. Write SRAM accepts either format:
    • Stripped (emulator .srm files) — automatically converted to raw bus format before writing.
    • Raw (bus format, 2x the data size) — written as-is. The format is auto-detected based on file size vs. detected SRAM size.

After writing, the data is automatically verified (only the SRAM data bytes are compared — the garbage high bytes on the 16-bit bus are ignored).

For more information on SRAM saving, see the Save System documentation.

Flash Saves

Games built with flash saving (configured in Settings > Cartridge) store save data directly in the ROM's flash chip. The Flasher can detect and manage these save regions.

  1. Click Detect Flash Saves to read the ROM header and locate the save sectors.
    • ROMs with "FL" in the header use explicitly defined sector addresses.
    • ROMs with "RA" auto-detect the last two equal-size sectors from the flash chip's CFI data.
  2. After detection, the tool shows the sector addresses and total save region size.

Export / Import Save Data

  • Export Save Data — downloads both save sectors as a single binary file. Use this to back up save data before flashing a new ROM.
  • Import Save Data — erases the save sectors and programs the data from a previously exported file. The file size must match the save region exactly.

Save Slots

The tool can parse the SGDK flash save format used by the engine:

  • Walk the blob chain in the active sector
  • List which slots have data and their sizes
  • Read individual slot data

For more information on flash saving, see the Save System documentation.

Troubleshooting

Device not detected

  • Make sure the FlashKit-MD is connected via USB and powered on.
  • Try a different USB cable or port.
  • On macOS, no additional drivers are typically needed for FTDI-based devices.

Serial port permission denied (Linux)

On Linux, the error Failed to open serial port: FILE_ERROR_ACCESS_DENIED means your user doesn't have permission to access the USB serial device. There are two ways to fix this:

Option 1: Add your user to the dialout group (recommended)

sudo usermod -aG dialout $USER

You must log out and back in (or reboot) for the group change to take effect.

Option 2: Install a udev rule (no logout required, applies system-wide)

Create a file at /etc/udev/rules.d/99-flashkit.rules with the following content:

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", MODE="0666"

Then reload the rules and re-trigger device detection:

sudo udevadm control --reload-rules && sudo udevadm trigger

This grants all users read/write access to FTDI USB serial devices (vendor ID 0403), which is what the FlashKit-MD uses. The rule takes effect immediately for newly plugged devices — no logout needed.

Future improvement

The udev rule could be bundled with the Linux DEB/RPM installer packages so users don't need to configure permissions manually. The rule file would be installed to /etc/udev/rules.d/ as part of the package post-install step.

Erase or write errors

  • Ensure the cartridge is firmly seated in the FlashKit-MD.
  • If an operation fails mid-write, the flash may be in an undefined state. Try erasing the affected region before writing again.
  • Check the log output for specific error codes.

Web Serial API not supported

The Flasher requires a Chromium-based browser engine. In Electron (which MD Engine uses), Web Serial is enabled by default. If you see the "not supported" banner, check that your Electron version is up to date.