Restore to Factory
129
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
File System
NOTE:
If the Wi-Fi calibration mode is configured as one time, the Wi-Fi calibration is not
regenerated when invoking the restore-to-factory-default method (the current calibration is
used).
While the restore-to-factory operation is in process, the networking subsystem is in lock
state. Most of the functions are blocked and will return an error
SL_ERROR_INCOMPLETE_PROGRAMMING.
The only procedure requiring a SOP setting of 010 is the UART-programming.
For the CC3220/R/S/F device, after the programming stage the SOP setting should be 000,
because it has implication on the restore-to-factory function.
For the CC3220/R/S/F device, if the SOP is configured as UART-programming mode, which
is 010(SOP2=1, SOP1=0, SOP0=0), the following scenario may occur:
1. Restore to factory is called.
2. Device-reset occurs during the restore-to-factory extraction stage.
3. The device is halted.
•
The following steps overcome the halt situation:
(a) Set the SOP to 000.
(b) POR the device, and the restore to factory is completed successfully.
8.13.1 Restore to Factory by the Host
To trigger the restore-the-factory image by SOP, the following steps are required:
1. From the host, invoke the restore function as in the following example. The function is synchronous; it
returns when the process is finished.
2. Hibernate-reset the device:
•
CC3120: sl_Stop, sl_Start
•
CC3220/R/S/F: sl_Stop, PRCMHibernateCycleTrigger()
Examples:
_i32 slRetVal;
SlFsRetToFactoryCommand_t RetToFactoryCommand;
_i32 Status, ExtendedStatus;
RetToFactoryCommand.Operation = SL_FS_FACTORY_RET_TO_IMAGE;
Status = sl_FsCtl( (SlFsCtl_e)SL_FS_CTL_RESTORE, 0, NULL , (_u8 *)&RetToFactoryCommand ,
sizeof
(SlFsRetToFactoryCommand_t), NULL, 0 , NULL );
if
((_i32)Status < 0)
{
/*error*/
//Status is composed from Signed error number & extended status
Status = (_i16)Status>> 16;
ExtendedStatus = (_u16)slRetVal& 0xFFFF;
break
;
}
//Reset
sl_Stop(10);
sl_Start(NULL, NULL, NULL);
_i32 slRetVal;
SlFsRetToFactoryCommand_t RetToFactoryCommand;
_i32 Status, ExtendedStatus;
RetToFactoryCommand.Operation = SL_FS_FACTORY_RET_TO_DEFAULT;
Status = sl_FsCtl( (SlFsCtl_e)SL_FS_CTL_RESTORE, 0, NULL , (_u8 *)&RetToFactoryCommand ,
sizeof
(SlFsRetToFactoryCommand_t), NULL, 0 , NULL );
if
((_i32)Status < 0)
{
/*error*/
//Status is composed from Signed error number & extended status
Status = (_i16)Status>> 16;