I'm having some difficulties understanding how EEPROM address space is managed. Fact is (as far as I understood):
- it is possible to have local variables on the EEPROM (e.g. using the EEMEM macro of avr-gcc)
- it is possible to have recursive function calls
- hence I can have recursive functions with local variables residing in the EEPROM memory space
- this means it is (in this case) unknown at compile time how much EEPROM space I'll use
So, how is this managed? Is there a stack-like something on the EEPROM?
Also, if there is something like this: how does it deal with user-forced fixed-address variables? Say I force to compiler to give me a variable x at address 0x0FFF. If the EEPROM stack (assuming there is something like this) starts at 0x000, how does it avoid overwriting x?
Probably this nothing people normally worry about, but I'm just curious and want to understand the details...
Cheers! Philipp