Hi
Target : AT91R40008 Bootloader : own Main : will be someone else's
What is the best s/w only way to 'unmap' ?
I need main to be able to drop into my bootloader which starts by remapping stuff, and I want the bootloader to assume that SRAM is at 0x300000 (in case main has screwed up the remapped ones) for remapping purposes, just as it has to during a genuine powerup.
But if I just jump directly from main to my (flash boot) reset vector, it can't use 0x300000 because it's been mapped already.
I could maybe force a watchdog reset which would apparently do this job, but is there a cleaner way ?
Yes, the processor has a reset reason register (RSIR - Reset Source Identification Regiseter). But that wasn't his question. His question was how he can differentiate between an intentional watchdog reset and an unintentional one. Hence, my suggestion to first check the reset reason register if it was a watchdog reset, and then check the "magic" variable to see if the watchdog reset was intentional.