Other Parts Discussed in Thread: UNIFLASH
Hi,
I have an issue with the automatic rollback when doing an OTA update of the cc3235modsf.
I'm writing the file /sys/mcuflashimg.bin, calling sl_Stop, PRCMHibernateCycleTrigger and testing the new firmware. If it succeed, I call sl_FsCtl(SL_FS_CTL_BUNDLE_COMMIT, ...).
I am expecting the file to be automatically reverted to the previous one if it does not get validated by the commit during its first start, or automatically rollbacked after a few seconds if the file is not functional at all. When testing with a functional firmware it works fine. But when writing a bad file I get two unexpected behavior:
1: When closing the file with sl_FsClose(FileHandle, FS_CERTIFICATE_FILE_NAME, buff, KEY_SIZE); It returns 0 even though the key is not the proper one.
2: The cc does not wake up afterwards. I need to reset it externally
Some more info:
To open the file, I'm using the flags:
uint32_t flags = SL_FS_OVERWRITE;
flags |= SL_FS_CREATE;
flags |= SL_FS_CREATE_FAILSAFE;
flags |= SL_FS_WRITE_BUNDLE_FILE;
flags |= SL_FS_CREATE_MAX_SIZE(FW_MAX_FILE_SIZE);
flags |= SL_FS_CREATE_SECURE;
flags |= SL_FS_CREATE_PUBLIC_WRITE;
The SlFsFileInfo_t.Flags is 0x258 after the new file has been written.
The bundle state is 1 after the file has been written, and 2 after sl_Stop has been called.
I have tried as well with calling Platform_CommitWdtConfig (as found in ota_cloud example) to set the watchdog, but without success.
I'm using the latest sdk 3_30_01_02 and service pack 4.4.1.3_3.1.0.5_3.1.0.19
With a similar procedure on the cc3220modasf, I get the error SL_ERROR_FS_WRONG_SIGNATURE_SECURITY_ALERT when calling sl_FsClose()
Do you have any idea what could be the issue?
Do not hesitate to ask for more information.
Best regards,
Cédric