最近在看BlueNRG ota升级代码时有一个疑惑,ota_sw_ac
tivation变量是一个未初始化的值,按照ram特性上电应该是一个随机值,那么在OTA_Check_ServiceManager_Operation()函数中判断值就可能存在偶然的误操作?
if (ota_sw_activation == OTA_APP_SWITCH_OP_CODE_GO_TO_OTA_SERVICE_MANAGER) //Go to OTA Service manager { /* Unlock the Flash */ flash_sw_lock = FLASH_UNLOCK_WORD; /* Set Invalid valid tag x OTA Application with OTA Service Manager for allowing jumping to OTA Service manager */ FLASH_ProgramWord(APP_WITH_OTA_SERVICE_ADDRESS + OTA_TAG_VECTOR_TABLE_ENTRY_OFFSET, OTA_INVALID_OLD_TAG); /* Lock the Flash */ flash_sw_lock = FLASH_LOCK_WORD; /* Reset Service Manager ram location */ ota_sw_activation = OTA_INVALID_OLD_TAG; }