In the latest SDK - 6.10.00.05, there seems to a bug in OtaLib.c as shown below
Inside OTA_set function
case EXTLIB_OTA_SET_OPT_DECLINE_UPDATE: /* check if after OTA_STATE_CHECK_ARCHIVE_NEW_UPDATE state */ if (pOtaLib->State != OTA_STATE_REQ_FILE_URL) { _SlOtaLibTrace(("OTA_set: ERROR EXTLIB_OTA_SET_OPT_DECLINE_UPDATE in wrong state = %d\r\n", pOtaLib->State)); return OTA_OPT_ERROR_WRONG_STATE; } /* close all connection from last OTA updates and back to IDLE */ pOtaLib->ConsecutiveOtaErrors = 0; _OtaCleanToIdle(pOtaLib); break;
The State check must be done against OTA_STATE_CHECK_ARCHIVE_NEW_UPDATE instead of OTA_STATE_REQ_FILE_URL
Anyway this section is triggered only when the update is declined and hence it may not have a direct impact.