I was writting a small software to make my different arduinos talk through some nrf24l01+.
All is fine but I'd like to have the mac adress not inside the software (means building a new for each arduino), but setting it in the eeprom during software write by avrdude.
The max address is an hexa 5 bytes such as : 0xFF1F1F1F00
I've been searching for hours to send anything in the eeprom by trying various files formats (intel hex, raw binary, hexadecimal) but failed at all.
My command line looks like this:
The optiboot bootloader that is used on Arduino will always read/write from program memory even when avrdude asks it to read/write EEPROM.
The following command is sent by avrdude when attempting to read EEPROM:
avrdude: Send: t [74] . [00] . [04] E [45] [20]
Notice the "E" indicating that the type of memory it would like to read is EEPROM.
The following snippit is taken from optiboot.c
/* Write memory, length is big endian and is in bytes */
else if(ch == STK_PROG_PAGE) {
// PROGRAM PAGE - we support flash programming only, not EEPROM
It does not check to see if EEPROM or FLASH needs to be read.
I was able to read/write EEPROM with avrdude and my STK500 board connected to the ISP header on my Uno R3 with no problems.
Arduino nano V3.00 and I'm working under linux. EDIT: it's a 3.00 not a 1.00 ...
So thank you PaulS and jgoulder. It seems that it won't be so easy than I expected.
I planned to upgrade the bootloader because I don't know where it comes from and which version I use. And also it is has a bug with watchdog timer (infinite reset loop).
I'll take a look inside bootladers mechanics to find one that better suits my needs. Do you have one in mind that could be right?
/* Write memory, length is big endian and is in bytes */
else if(ch=='d') {
length.byte[1] = getch();
length.byte[0] = getch();
flags.eeprom = 0;
if (getch() == 'E') flags.eeprom = 1;
for (w=0;w<length.word;w++) {
buff[w] = getch(); // Store data in buffer, can't keep up with serial data stream whilst programming pages
}
if (getch() == ' ') {
if (flags.eeprom) { //Write to EEPROM one byte at a time
address.word <<= 1;
for(w=0;w<length.word;w++) {
As far as compatibility with the Nano or the version of the IDE you are using, I will defer to someone else.