# AVRDUDE: Write EEPROM bytes without file

Is it possible to write EEPROM bytes via AVRDUDE and an AVRISP mkII directly from the command line without needing an EEPROM file read from another chip? Kind of like how you can specify the fuse bytes directly at the command line.

I need to be able to change a single byte of the EEPROM but would rather not mess with a file.

• I'm not an AVRDUDE user so can't test it but try -U eeprom:w:0x55:m and see if you get 0x55 in the first EEPROM byte. Jul 2, 2013 at 4:27

The avrdude write command (-U) knows an 'immediate' mode (see the manual), which allows you to specify the bytes to be written directly.

The syntax is like

avrdude -U eeprom:w:0xff:m


But this mode doesn't allow you to specify the address of the byte to be written, so I presume it will start writing at address zero. This works great for fuses (where instead of 'eeprom' you use 'hfuse', 'lfuse' or 'efuse'), but not so much for real memory.

But you can always create a hex file (e.g. INTEL Hex records containing just the single byte with the address you need to change.

• OK... that's what I was hoping. I'll give it a shot. I don't need to specify the address since I only have one byte I need and it will always be at address 0. Jul 2, 2013 at 10:42
• You might also see if you could (perhaps with shell or /dev tricks) get it to read a pipe as input. Worst case, it's open source so you can add the missing features ;-) Jul 2, 2013 at 18:47
• You can't do it with offsets, the files are small enough that you could put every byte on a long command line with copy and paste, or in a bash script. Aug 15, 2019 at 6:10

Solution on Linux: write 0x10 to eeprom address 0x50

avrdude -t << END
write eeprom 0x50 0x10
quit
END

• Nice - a terminal mode and a here document. Someone like the original poster might prefer instead to pipe the data in from a script generating it and invoking avrdude, but the avrdude mode is the important part. Jul 14, 2020 at 14:18