I am using FreeRTOS on an Atmel SAM7S-256 with the IAR toolchain. While I have a proprietary board design, we can assume for the moment that I am using the Atmel development kit, as they are very similar.
I am writing a boot loader that is supposed to allow updating the code in the SAM flash. I am writing the new code to an external SPI flash when it is downloaded over USB, doing the appropriate checks to ensure that code is intact. Once it is entirely downloaded and verified, it is then written to the SAM flash. Once done, I am trying to reset the processor. However, I must not understand how to reset correctly, because when I merely make the reset function in Cstartup.s79 public and call it, the RTOS does not appear to start up again. I tried just simply resetting the processor without writing new code to it, to make sure I took any erroneous code update out of the equation. Same result - RTOS locks up.
Can someone help me by describing the correct way to have my code reset the processor, as if it were being first powered up?