Stack Pointer init value
I tested something with Atmel Studio 6.1. I realized that the SP in debugging is set to 4101h (ATmega1284P) at start with no prologue code like the optiboot has - without .initN sections.
The optiboot says that it is done by hardware reset (SP = RAMEND) except of ATmega8,16,32. However for the ATmega1284P, the RAMEND is 40FFh, not 4101h.
* Is it bug in AS6.1?
* How about real MCU, is it true that hardware reset initialize the SP to 40FFh? I cannot find info in the datasheet.