I would also like to be able to reinitialize my data immediately prior
to reboot in order to allow application tasks to recover state
information so that they may start from some point other than
initialization.
Thanks in advance.
PC User wrote:
> Does anybody know how to initiate a restart/reboot through a user
> program? I would like to have the option in my application to reboot
> based on certain conditions.
>
Use reboot( ) in your code.
>
> I would also like to be able to reinitialize my data immediately prior
> to reboot in order to allow application tasks to recover state
> information so that they may start from some point other than
> initialization.
>
> Thanks in advance.
If you use the BOOT_NORMAL option (the default) memory is not cleared on a
reboot. You can either use memory above sysMemTop( ) and below
sysPhysMemTop( ), or memory that will not be overwritten by the boot
sequence, or non volatile memory (see the sysNvRam entries in the
reference manual). If the data to store is in a known location, you can
always initialise it using a reboot hook (see rebootHookAdd).
You really need to read the manuals before posting such trivial
questions ;-) There is a function called reboot() that will allow you
to programmatically reboot the target. A simple look in the index of
your reference guide would have found this function.
As for the second part, you need to declare some memory as reserved
(look for the USER_RESERVED_MEM macro in your BSP and in the manuals -
there is also a tech note about this on WindSurf I believe). Store the
state information in that memory prior to your reboot, and have the
tasks read from there when they start up again.
Make sure you rebuild and reprogram the bootrom on your board with a
version built using the same user reserved memory settings too,
otherwise the bootrom will zero it for you.
HTH,
John...
PC User <PCU...@hotmail.com> wrote in message news:<3bf417cf$0$43576$272e...@news.execpc.com>...