AWS freeRTOS OTA failure for Nordic 52840

Hi,

I had ran the “mqtt hello” and “device shadow” demo successfully,

but the ota demo can’t run,

I think the key issue is:

[OTA Agent Task] [prvUpdateJobStatus_Mqtt] Msg: {“status”:“FAILED”,“statusDetails”:{“reason”:“aborted: 0x03000000”}}

&

[prvUpdateJobStatus_Mqtt] ‘FAILED’ to $aws/things/test_nordic/jobs/AFR_OTA-yy/update

I found the 0x03000000 mean “General out of memory error”,

the size of the image.hex is 737.3 KB, i did’t add any file and only modify the parameter : breakpoint / thing name

Could you please tell me how can i solve this problem, thanks.

Here are my hardware and log:

IDE: SEGGER Embedded Studio with segger-arm-gcc
FreeRTOS version: newest
Mobile sdk : newest (android)
hardware: noredic nrf52840dk

[iot_thread] [INFO ][DEMO][0] ---------STARTING DEMO---------
[iot_thread] [INFO ][INIT][0] SDK successfully initialized.
[iot_thread] [INFO ][DEMO][20] No networks connected for the demo. Waiting for a network connection.
[BLE] [ERROR][BLE_HAL][16980] PM_UNKNOWN, 0.
[BLE] [ERROR][BLE_HAL][16980] sd_ble_gattc_exchange_mtu_request() on connection 0x0 returned busy, will retry.
[BLE] [INFO ][DEMO][16980] BLE Connected to remote device, connId = 0
[iot_thread] [INFO ][DEMO][16980] Successfully initialized the demo. Network type for the demo: 2
[iot_thread] [INFO ][MQTT][16980] MQTT library successfully initialized.
[iot_thread] OTA demo version 0.9.2
[iot_thread] Creating MQTT Client…
[iot_thread] Connecting to broker…
[iot_thread] [INFO ][MQTT][18280] Establishing new MQTT connection.
[iot_thread] [INFO ][MQTT][18290] (MQTT connection 200155f8, CONNECT operation 200157d0) Waiting for operation completion.
[iot_thread] [INFO ][MQTT][18380] (MQTT connection 200155f8, CONNECT operation 200157d0) Wait complete with result SUCCESS.
[iot_thread] [INFO ][MQTT][18380] New MQTT connection 20004760 established.
[iot_thread] Connected to broker.
[iot_thread] [OTA_AgentInit_internal] OTA Task is Ready.
[OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [Ready] Event [Start] New state [RequestingJob]
[OTA Agent Task] [INFO ][MQTT][18390] (MQTT connection 200155f8) SUBSCRIBE operation scheduled.
[OTA Agent Task] [INFO ][MQTT][18390] (MQTT connection 200155f8, SUBSCRIBE operation 2001daf0) Waiting for operation completion.
[OTA Agent Task] [INFO ][MQTT][18970] (MQTT connection 200155f8, SUBSCRIBE operation 2001daf0) Wait complete with result SUCCESS.
[OTA Agent Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/test_nordic/jobs/$next/get/accepted
[OTA Agent Task] [INFO ][MQTT][18970] (MQTT connection 200155f8) SUBSCRIBE operation scheduled.
[OTA Agent Task] [INFO ][MQTT][18970] (MQTT connection 200155f8, SUBSCRIBE operation 200157d0) Waiting for operation completion.
[iot_thread] State: Ready Received: 0 Queued: 0 Processed: 0 Dropped: 0
[OTA Agent Task] [INFO ][MQTT][19550] (MQTT connection 200155f8, SUBSCRIBE operation 200157d0) Wait complete with result SUCCESS.
[OTA Agent Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/test_nordic/jobs/notify-next
[OTA Agent Task] [prvRequestJob_Mqtt] Request #0
[OTA Agent Task] [INFO ][MQTT][19550] (MQTT connection 200155f8) MQTT PUBLISH operation queued.
[OTA Agent Task] [INFO ][MQTT][19550] (MQTT connection 200155f8, PUBLISH operation 200157d0) Waiting for operation completion.
[OTA Agent Task] [INFO ][MQTT][19840] (MQTT connection 200155f8, PUBLISH operation 200157d0) Wait complete with result SUCCESS.
[OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [RequestingJob] Event [RequestJobDocument] New state [WaitingForJob]
[OTA Agent Task] [prvParseJobDoc] Size of OTA_FileContext_t [64]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ clientToken: 0:test_nordic ]
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: execution
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: jobId
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: jobDocument
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: afr_ota
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: protocols
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: files
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: filepath
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: filesize
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: fileid
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: certfile
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: sig-sha256-ecdsa
[OTA Agent Task] [prvDefaultCustomJobCallback] Received Custom Job inside OTA Agent which is not supported.
[OTA Agent Task] [prvParseJobDoc] Ignoring job without ID.
[iot_thread] State: RequestingJob Received: 1 Queued: 0 Processed: 0 Dropped: 0
[iot_thread] State: WaitingForJob Received: 1 Queued: 0 Processed: 0 Dropped: 0

[OTA Agent Task] [prvParseJobDoc] Size of OTA_FileContext_t [64]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ jobId: AFR_OTA-yy ]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ protocols: [“MQTT”] ]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ streamname: AFR_OTA-99ab8167-c279-40b7-ad41-62d88b229d67 ]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ filepath: / ]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ filesize: 754945 ]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ fileid: 0 ]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ certfile: / ]
[OTA Agent Task] [prvParseJSONbyModel] Extracted parameter [ sig-sha256-ecdsa: MEUCIBKDUjB7z+IAiV5mEaP9WSloMYj6… ]
[OTA Agent Task] [prvParseJobDoc] Job was accepted. Attempting to start transfer.
[OTA Agent Task] [prvUpdateJobStatus_Mqtt] Msg: {“status”:“FAILED”,“statusDetails”:{“reason”:“aborted: 0x03000000”}}
[OTA Agent Task] [INFO ][MQTT][97940] (MQTT connection 200155f8) MQTT PUBLISH operation queued.
[OTA Agent Task] [INFO ][MQTT][97940] (MQTT connection 200155f8, PUBLISH operation 2001e210) Waiting for operation completion.
[OTA Agent Task] [INFO ][MQTT][98200] (MQTT connection 200155f8, PUBLISH operation 2001e210) Wait complete with result SUCCESS.
[OTA Agent Task] [prvUpdateJobStatus_Mqtt] ‘FAILED’ to $aws/things/test_nordic/jobs/AFR_OTA-yy/update
[OTA Agent Task] [prvOTA_Close] Context->0x20004890
[OTA Agent Task] [prvOTAAgentTask] Handler failed. Current State [WaitingForJob] Event [ReceivedJobDocument] Error Code [603979776]
[OTA Agent Task] [prvParseJobDoc] Size of OTA_FileContext_t [64]
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: execution
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: jobId
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: jobDocument
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: afr_ota
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: protocols
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: files
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: filepath
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: filesize
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: fileid
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: certfile
[OTA Agent Task] [prvParseJSONbyModel] parameter not present: sig-sha256-ecdsa
[OTA Agent Task] [prvDefaultCustomJobCallback] Received Custom Job inside OTA Agent which is not supported.
[OTA Agent Task] [prvParseJobDoc] Ignoring job without ID.
[OTA Agent Task] [prvOTA_Close] Context->0x2001d7f4
[iot_thread] State: WaitingForJob Received: 3 Queued: 0 Processed: 0 Dropped: 0
[iot_thread] State: WaitingForJob Received: 3 Queued: 0 Processed: 0 Dropped: 0
[iot_thread] State: WaitingForJob Received: 3 Queued: 0 Processed: 0 Dropped: 0
[iot_thread] State: WaitingForJob Received: 3 Queued: 0 Processed: 0 Dropped: 0

1 Like

Hello Jason,

Thank you for reporting this issue and sharing the logs.

The issue seems to be due to using hex file for over the air update instead of binary file. We only support binary file for OTA and if you check the size of binary file it must be much smaller.

The OTA process requires two application banks on the 1 MB of flash available on nrf52840, one is used for executing current image and another one for receiving the OTA image which can be of the max size 0x66000 (417,792).

Please let me know if this works or if you have more questions regarding this.

2 Likes

Hi pvyawaha,

Thanks for your suggestions,

I had finished the OTA demo when I changed the IDE settings Hex ->bin file type.

The size of image reduce to 262.6KB, and done the OTA demo by checking different versions.

Thank you so much.

Jason

1 Like