I have an arduino mega2560 running with a watchdog. Bootloader is "stk500boot_v2_mega2560.hex" Everything is fine.
But I get no access to the MCUSR flag.
Looking at the source of the bootloader: ... (starting line 567 ..) uint8_t mcuStatusReg; mcuStatusReg = MCUSR;
asm volatile ("cli"); asm volatile ("wdr"); MCUSR = 0; ...
You see why I get everytime 0 from the MCUSR.
The idea is to make the mcuStatusReg public (global) so that I can make it by an
external uint8_t mcuStatusReg
So my question is: How can I compile the bootloader on Windows 7 x64 (I tried a day to do it. Without success).
Or is there any other idea how to get the value of MCUSR after a watchdog or brownout reboot?