Short answer: PEBCAK
Longer answer (but not all inclusive):
1) "sleep" is a shell command, not a system command.
It only effects the execution path of the script that contains it.
2) Where / How are these scripts being called?
3) If you do succeed in putting the processor to sleep, then you need a hardware event from some hardware that is still running to wake it.
4) Writing less than a full erase block of data to flash will cause the "short write" to be cached (somewhere, there are several places) in the system or within the flash chip's controller itself.
Shutting down the power to the flash and its internal controller before it completes one of its erase and re-program functions (while the operation is in progress) will at best result in a corrupted, non-recoverable, erase (storage) block in the flash. At worse, a corrupted, non-recoverable internal control structure (then it is unsolder flash chip, solder in a new one time).
You really should try to understand the system and its hardware before trying to take control of it outside of its normal dependence system.
PS: You are in the wrong thread.
This thread is about responding to system events, not about trying to manufacture them.
If you can't find a thread about your subject here, start your own, they are cheap here.
Last edited by knc1; 06-02-2013 at 08:02 AM.
|