Start and Stop
28
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Device
Example:
_i16 Status, Role;
Role = sl_Start(NULL, NULL, NULL);
if
(ROLE_STA == Role)
{
/* Main application */
}
Status = sl_Stop(100);
/* 100 ms Timeout */
if
( Status )
{
/* error */
}
3.3.3 Hibernate and Shutdown
Hibernate is the lowest-device power mode which keeps the RTC running. In this mode, the device is
powered off, except for the hibernate logic. In this state the volatile memory of the SimpleLink Wi-Fi device
is not maintained, but the RTC is maintained, which provides faster boot time and maintains the system
date and time. The SimpleLink Wi-Fi device goes into the hibernate state when the correct hardware (HW)
lines are set (RESET / HIB) on a call to sl_Stop.
Full shutdown is the lowest power state of the device. In this state both the volatile memory and the RTC
are not maintained. The initialization process from full shutdown takes longer compared to initializing from
hibernate. The SimpleLink device goes into full shutdown state when the correct HW lines are set on a call
to sl_Stop.
3.3.4 Lock State
The device enters a lock state due to one of the following conditions:
•
The restore to factory defaults is currently in process, and the device unlocks when the process is
finished.
•
The device INIT failed and an inaccurate error is sent with the INIT-complete error asynchronous
event. The device INIT-complete may then fail due to calibration failure or integrity failure of the file-
system data structure
•
The security alerts threshold was exceeded. The SimpleLink Wi-Fi device provides a software
tampering detection mechanism with a security-alert counter. This procedure detects integrity violation
of the following: file-system data, secure-authentication files, or system files. When the device reaches
the security alerts threshold (three by default or predefined with Image Creator), it locks.
•
A critical security alert occurs.
In the lock state only a few commands are allowed. The list of the enabled commands follows:
•
Program a new image
•
Restore to factory defaults
•
Get current version
•
Get storage information (retrieves the number of security alerts and the storage properties)
Any other API issued in locked state returns one of the following error codes:
SL_RET_CODE_DEV_LOCKED (-2011L) //Device was found locked during its init, commands are
blocked by the driver
SL_ERROR_NOT_ALLOWED_NWP_LOCKED (-14343L) //Device is currently lock
Recovery from the lock state depends on the reason for the lock. If the lock is due to processing the
restore to factory function, then the device automatically unlocks when finished. In all other cases, to
recover from the lock state the device can be programed or restored to factory image.
3.3.5 Initialization Sequence
During the INIT sequence, the host driver runs the following key steps: