bootloader and program sharing eeprom variable

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

most of my eeprom variables are defined normally, but i need a byte that the bootloader reads. And of course, this can't be automatically placed by the compiler. Can I declare an eeprom variable in such a way, that the compiler will understand this?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sure:

eeprom_update_byte((uint8_t *))0x1234, 37);

Writes 37 to absolute location 0x1234.

Of course you have to be careful that the linker isn't already placing something in location 0x1234. But if you work from the end backwards you should be OK.