Electronic – AVRDUDE: Write EEPROM bytes without file

avravrdudeeeprom

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.

Best Answer

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.