Other Parts Discussed in Thread: UNIFLASH
Hi,
Customer doesn't plan to OTA upgrade with bundle tar file since they want to save some code space.
However while following the procedure below, /sys/mcuimg.bin was roll back.
1. Open /sys/mcuimg.bin with the following flags:
FsOpenFlags = SL_FS_CREATE;
FsOpenFlags |= SL_FS_OVERWRITE;
FsOpenFlags |= SL_FS_CREATE_SECURE;
FsOpenFlags |= SL_FS_CREATE_FAILSAFE;
FsOpenFlags |= SL_FS_CREATE_PUBLIC_WRITE;
FsOpenFlags |= SL_FS_WRITE_BUNDLE_FILE;
FsOpenFlags |= SL_FS_CREATE_MAX_SIZE( MaxSize ),
sl_FsOpen((const unsigned char*)g_OtaFile.filename, FsOpenFlags, &token);
2. Write the application image into /sys/mcuimg.bin: sl_FsWrite((int32_t)g_OtaFile.handle,g_OtaFile.offset, (uint8_t *)buffer,(uint32_t)length);
3. sl_Stop() and then sl_Start()
4. Invoke sl_FsCtl(SL_FS_CTL_BUNDLE_COMMIT, token, NULL, (uint8_t *)&FsControl, sizeof(SlFsControl_t), NULL, 0, NULL);
sl_FsCtl returned SUCCEEDED. But the application is still the original one after MCU reset.
Would you let us know if there is any problem for the above procedures? Thanks!
Regards,
Yonghua