I have an EEPROM variable in my bootloader that signals whether the bootloader should run the application or should listen for data on a communication channel. The idea is taken from here: https://www.avrfreaks.net/sites/d.... The variable is called APP_RUN and the inital value is set to 1 since the app should normally run. I need access to this variable in both the application and the bootloader. What is the best way to implement this? Should I simply define the variable as
uint8_t EEMEM APP_RUN = 1;
in both the bootloader and my application? I could then generate an EEPROM file from my application hex file and flash it onto the microcontroller. (If I use the EEPROM file generated from the bootloader I lose the non-bootloader-related EEPROM variables in my application). I'm not sure whether this is the way to go though, is there maybe a way to somehow merge the EEPROM files from both the bootloader and application hex files (similar to how the .hex files themselves get merged into one hex file that can be flashed onto the mcu)?