When I wish to upgrade a firmware image, I use bank switching, and then attempt to reboot.
I first write the new image to the new bank, and then set GPNVM 2 (At this point I see that memory and variables gets "crazy" using the debugger view - probably the effect of the memory remapping).
Now I am trying to reboot using:
AIRCR=(AIRCR&VECTKEY_MASK)|VECTKEY|SYSRESETREQ
Which translates to
(*(uint32_t*)0xe000ed0cUL)=((*(uint32_t*)0xe000ed0cUL)&0x05fa0000UL)|0x05fa0000UL|(1<<2))
And it doesn't reboot - only external reset helps.
Few pointers:
1. This reboot macro usually works perfectly, just not after the bank switching.
2. After external reset takes place, the new FW boots OK.
3. I am using SAM3SD8.
Help, please....

Thanks!
Lior.