针对Simplicity Studio 4,使用串口命令擦出Flash里面存储的OTA image文件
Platform:Simplicity Studio 4、EmberZNet SDK 6.4.1.0
【SPP】Content:
有时候在使用EmberZNet协议栈对设备做OTA升级测试的时候,flash一块区域会存储着我们的镜像文件,当从新下载不同固件版本的文件时,会因为OTA自检到FLASH存在不同版本的IMAGE文件而自动升级到之前的版本,故在此情况下就需要擦出一下之前保存的image文件;
本次实现使用串口发送0x64的时候,实现擦除,在串口回调添加下面代码,打开协议栈串口打印:
boolean emberProcessCommand(int8u *input, int8u sizeOrPort)
{
int8u dat;
while (EMBER_SUCCESS == emberSerialReadByte(sizeOrPort, &dat))
{
if (100 == dat)
{
EmberAfOtaStorageStatus status;
emberAfGuaranteedPrint("[1:app]Enter the wipe out function\r\n");
status = emberAfOtaStorageClearTempDataCallback();
emberAfGuaranteedPrint("[2:app]status=%d\r\n",status);
}
}
return FALSE;
}
当串口发送完0x64后,打印:
Delaying 141 seconds before starting OTA client
[1:app]Enter the wipe out function
[1:ota]Starting erase from offset 0x00000000 to 0x00032000
[3:ota]Erasing page 1 of 50[2:ota]Waiting 102 ms for erase to complete.
[2:app]status=4
[3:ota]Erasing page 2 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 3 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 4 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 5 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 6 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 7 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 8 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 9 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 10 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 11 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 12 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 13 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 14 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 15 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 16 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 17 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 18 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 19 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 20 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 21 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 22 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 23 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 24 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 25 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 26 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 27 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 28 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 29 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 30 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 31 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 32 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 33 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 34 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 35 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 36 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 37 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 38 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 39 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 40 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 41 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 42 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 43 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 44 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 45 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 46 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 47 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 48 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 49 of 50[2:ota]Waiting 102 ms for erase to complete.
[3:ota]Erasing page 50 of 50[2:ota]Waiting 102 ms for erase to complete.
[5:ota]EEPROM Erase complete
打印EEPROM Erase complete即擦除完成;