Home/Support/Support Forum/How to use nccCheckForSoftwareRestart in NetOS Context
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How to use nccCheckForSoftwareRestart in NetOS Context

0 votes
Hi,
I try to detect, if the device did a 'coldboot (gets powered), or if we did a software reset. Therefore I thaught, I can use the nccCheckForSoftwareRestart. But this function returns false all the time.
The restart proces itself is done via customizeRestart() which calls customizeReset() which calls NAReset(). The NAReset function uses the watchdog to restart (example / implementation provided by Digi in BSP)
After the restart, the nccCheck function returns false.
Even if I try to set the software_restart flag, it does not return the correct value. As I told: I need this information in the NetOS context! Anyone experience with this?
Thanks in advance
asked Jan 20, 2015 in NET+OS by stschaef New to the Community (3 points)

Please log in or register to answer this question.

1 Answer

0 votes
You'd need something that will "survive" a reboot. The only two things I can think of that would "survive" a reboot would be either NVRAM or the FLASH file system.

Thus you could either:
1) Write a file to the FLASH file system in (for example) customizeRestart and then check for that file during reboot. If it is there then you were rebooted. You'd want to delete that file upon reboot.

2) Starting in NET+OS V7.4 and continuing ion V7.5 the devBoardParamType typedef (The structure of NVRAM described in the API reference manual at Hardware/BoardSupport->Development Board Parameters->Types->devBoardParams has a field entitled userData. This is a 292 byte space in the NVRAM structure that is open for developer use. So (again) in customizeRestart (for example) you could write a flag to NVRAM and then check for it when you reboot.

Either of these methods would give you something that would "survive" a reboot.
answered Jan 20, 2015 by dakotas_dad Veteran of the Digi Community (694 points)
...