Skip to content

integratedcomputersolutions/i2c-eeprom-flasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Pico 2W Intel Hex EEPROM Programmer

A web-based Intel Hex file programmer for I²C EEPROMs using the Raspberry Pi Pico 2W.

Features

  • WiFi connectivity with web interface.
  • Upload Intel Hex files via browser.
  • Writes to I²C EEPROM connected to GPIO 4 (pin 6, SDA) and GPIO 5 (pin 7, SCL).
  • Real-time programming status feedback.

Hardware Requirements

  • Raspberry Pi Pico 2W.
  • I²C EEPROM BR24G04NUX-3 and others (as found on Variscite's carrier boards).
  • Pull-up resistors (typically 4.7kΩ) for I²C lines (if not built into your EEPROM module).

Wiring

Pico 2W          EEPROM
PIN 6 (GP4) -> SDA
PIN 7 (GP5) -> SCL
3.3V        -> VCC
GND         -> GND

Important: Ensure your EEPROM is rated for 3.3V operation.

Software Requirements

  1. Pico SDK
  2. CMake (version 3.13 or higher)
  3. ARM GCC compiler

Build Instructions

1. Setup Pico SDK

# Clone the Pico SDK
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init

# Set environment variable
export PICO_SDK_PATH=/path/to/pico-sdk

2. Build the Project

# Create the build directory and configure the project, using Ninja
cmake -G Ninja -S . -B build

# build
cmake --build build

This will generate hex_eeprom_programmer.uf2 in the build directory.

3. Flash to Pico 2W

  1. Hold the BOOTSEL button while connecting the Pico 2W to your computer
  2. The Pico will appear as a USB mass storage device
  3. Copy hex_eeprom_programmer.uf2 to the device
  4. The Pico will automatically reboot and start running

Usage

1. Connect to WiFi

The device automatically connects to the WiFi network "hermione" with password "Thisisatest".

2. Find the IP Address

Connect a serial terminal (115200 baud) to see the IP address:

# On Linux/Mac
screen /dev/ttyACM0 115200

# Or use minicom
minicom -D /dev/ttyACM0 -b 115200

You'll see output similar to:

I2C initialized on GPIOS SDA=4, SCL=5

I2C Bus Scan
   0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
00 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
10 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
20 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
30 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
40 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
50 .  .  .  .  @  @  .  .  .  .  .  .  .  .  .  .
60 .  .  .  .  .  .  .  .  @  .  .  .  .  .  .  .
70 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
Done.

Reading at EEPROM_ADDR 0x54...
   0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
00 0x56 0x43 0x02 0x73 0x79 0x6d 0x2d 0x31 0x2e 0x36 0x00 0x00 0x00 0x00 0x00 0x00
10 0x00 0x00 0x00 0x8f 0x1a 0xd7 0xea 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff

Connecting to WiFi...
Connected to WiFi
IP Address: 192.168.1.xxx
HTTP server started on port 80
Ready to receive Intel Hex files

3. Access the Web Interface

Open a web browser and navigate to the IP address shown (e.g., http://192.168.1.xxx)

4. Upload Intel Hex File

  1. Click "Choose File" and select your .hex file
  2. Click "Upload and Program"
  3. The system will parse the Intel Hex format and write to the EEPROM
  4. You'll see a success message with the number of bytes written

Configuration

WiFi Settings

Edit in main.cpp:

#define WIFI_SSID "hermione"
#define WIFI_PASSWORD "Thisisatest"

I²C EEPROM Address

The default EEPROM address is 0x54. If your EEPROM uses a different address, modify:

#define EEPROM_ADDR 0x54  // Change this to match your EEPROM

I²C Pins

The default pins are:

  • SDA: GP4 on pin 6
  • SCL: GP5 on pin 7

To change, modify:

#define I2C_SDA_GPIO 4
#define I2C_SCL_GPIO 5

Supported Intel Hex Format

The programmer supports standard Intel Hex format:

  • Record type 00 (Data records)
  • Record type 01 (End of File)

Each line in the hex file should follow this format:

:BBAAAATTHHHH...HHCC

Where:

  • BB = Byte count
  • AAAA = Address
  • TT = Record type
  • HH = Data bytes
  • CC = Checksum

Troubleshooting

WiFi Connection Fails

  • Verify SSID and password are correct
  • Ensure 2.4GHz WiFi is available (Pico W doesn't support 5GHz)
  • Check that WiFi network is in range

EEPROM Write Fails

  • Verify I²C connections and pull-up resistors
  • Check EEPROM address matches your device
  • Ensure EEPROM is not write-protected
  • Verify EEPROM power supply is stable at 3.3V

Cannot Access Web Interface

  • Confirm Pico is connected to WiFi (check serial output)
  • Verify you're on the same network as the Pico
  • Try pinging the IP address

Notes

  • The EEPROM write cycle includes a 5ms delay for compatibility with most EEPROMs
  • For large files, writing may take several seconds
  • The web interface has a 2KB buffer for incoming data - very large hex files may need to be split

License

This project is provided as-is for educational and development purposes.

About

I²C EEPROM flasher based on the Raspberry Pi PICO 2W

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published