I implemented the secure boot and flash encryption on the device. When I was performing the OTA I got at
. I was using the encrypted .bin file for OTA.image at 0x180000 has invalid magic byte error
Here is my partition table:
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild,,,,
nvs, data, nvs, 0x14000, 0x6000,
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x1000,
factory,0, factory,, 1400K,
ota_0,0, ota_0, , 1400K,
ota_1,0, ota_1, , 200K,
file, data,spiffs, ,0x6000,
Code: Select all
1172 23222 [OTA Agent Task] [INFO ][MQTT][232220] (MQTT connection 0x3ffb5f30) MQTT PUBLISH operation queued.
1173 23222 [OTA Agent Task] [prvRequestFileBlock_Mqtt] OK: $aws/things/FW_246F2824E888/streams/AFR_OTA-042eecf3-3b72-49ed-b19e-e3b374752a1e/get/cbor
1174 23222 [OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [WaitingForFileBlock] Event [RequestFileBlock] New state [WaitingForFileBlock]
1175 23253 [OTA Agent Task] [prvIngestDataBlock] Received file block 248, size 4096
1176 23254 [OTA Agent Task] [prvIngestDataBlock] Remaining: 5
1177 23254 [OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [WaitingForFileBlock] Event [ReceivedFileBlock] New state [WaitingForFileBlock]
1178 23265 [OTA Agent Task] [prvIngestDataBlock] Received file block 250, size 4096
1179 23266 [OTA Agent Task] [prvIngestDataBlock] Remaining: 4
1180 23266 [OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [WaitingForFileBlock] Event [ReceivedFileBlock] New state [WaitingForFileBlock]
1181 23273 [iot_thread] State: WaitingForFileBlock Received: 252 Queued: 0 Processed: 0 Dropped: 0
1182 23277 [OTA Agent Task] [prvIngestDataBlock] Received file block 249, size 4096
1183 23278 [OTA Agent Task] [prvIngestDataBlock] Remaining: 3
1184 23278 [OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [WaitingForFileBlock] Event [ReceivedFileBlock] New state [WaitingForFileBlock]
1185 23289 [OTA Agent Task] [prvIngestDataBlock] Received file block 251, size 4096
1186 23290 [OTA Agent Task] [prvIngestDataBlock] Remaining: 2
1187 23290 [OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [WaitingForFileBlock] Event [ReceivedFileBlock] New state [WaitingForFileBlock]
Current Epoch Time: [ 1622486890 ]
Epoch Start Time: [ 1622486668 ]
Value of config bootloader num pin factory reset 0
1188 23303 [OTA Agent Task] [prvIngestDataBlock] Received file block 252, size 4096
1189 23304 [OTA Agent Task] [prvIngestDataBlock] Remaining: 1
1190 23304 [OTA Agent Task] [prvOTAAgentTask] Called handler. Current State [WaitingForFileBlock] Event [ReceivedFileBlock] New state [WaitingForFileBlock]
1191 23312 [OTA Agent Task] [prvIngestDataBlock] Received file block 253, size 2352
I (233290) ota_pal: No such certificate file: certs/device. Using aws_ota_codesigner_certificate.h.
1192 23313 [OTA Agent Task] [prvIngestDataBlock] Received final expected block of file.
1193 23313 [OTA Agent Task] [prvStopRequestTimer] Stopping request timer.
1194 23383 [iot_thread] State: WaitingForFileBlock Received: 256 Queued: 0 Processed: 0 Dropped: 0
Current Epoch Time: [ 1622486891 ]
Epoch Start Time: [ 1622486668 ]
Value of config bootloader num pin factory reset 0
1195 23416 [OTA Agent Task] [prvIngestDataBlock] File receive complete and signature is valid.
1196 23416 [OTA Agent Task] [prvStopRequestTimer] Stopping request timer.
1197 23416 [OTA Agent Task] [prvUpdateJobStatus_Mqtt] Msg: {"status":"IN_PROGRESS","statusDetails":{"self_test":"ready","updatedBy":"0x1020024"}}
1198 23416 [OTA Agent Task] [INFO ][MQTT][234160] (MQTT connection 0x3ffb5f30) MQTT PUBLISH operation queued.
1199 23416 [OTA Agent Task] [INFO ][MQTT][234160] (MQTT connection 0x3ffb5f30, PUBLISH operation 0x3ffd8028) Waiting for operation completion.
E (234600) esp_image: image at 0x180000 has invalid magic byte
E (234600) boot_comm: mismatch chip ID, expected 0, found 32025
E (234600) boot_comm: can't run on lower chip revision, expected 1, found 37
W (234610) esp_image: image at 0x180000 has invalid SPI mode 103
W (234620) esp_image: image at 0x180000 has invalid SPI size 6
E (234630) ota_pal: aws_esp_ota_end failed!
1200 23444 [OTA Agent Task] [INFO ][MQTT][234440] (MQTT connection 0x3ffb5f30, PUBLISH operation 0x3ffd8028) Wait complete with result SUCCESS.
1201 23444 [OTA Agent Task] [prvUpdateJobStatus_Mqtt] 'IN_PROGRESS' to $aws/things/FW_246F2824E888/jobs/AFR_OTA-OTA-SecureBoot2/update
Current Epoch Time: [ 1622486892 ]ed eOTA_JobEvent_Activate callback from OTA Agent.
Epoch Start Time: [ 1622486668 ]
Value of config bootloader num pin factory reset 0
1203 23501 [iot_thread] State: WaitingForFileBlock Received: 256 Queued: 0 Processed: 0 Dropped: 0
Current Epoch Time: [ 1622486893 ]
Epoch Start Time: [ 1622486668 ]
Value of config bootloader num pin factory reset 0
1204 23630 [iot_thread] State: WaitingForFileBlock Received: 256 Queued: 0 Processed: 0 Dropped: 0
Current Epoch Time: [ 1622486894 ]
Epoch Start Time: [ 1622486668 ]
Value of config bootloader num pin factory reset 0
1205 23750 [iot_thread] State: WaitingForFileBlock Received: 256 Queued: 0 Processed: 0 Dropped: 0
Current Epoch Time: [ 1622486895 ]
Epoch Start Time: [ 1622486668 ]
Value of config bootloader num pin factory reset 0
1206 23866 [iot_thread] State: WaitingForFileBlock Received: 256 Queued: 0 Processed: 0 Dropped: 0
I (238900) wifi: state: run -> init (0)
I (238900) wifi: pm stop, total sleep time: 184187776 us / 234073527 us
I (238900) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
iot_wifi 95-event handler
I (238900) WIFI: SYSTEM_EVENT_STA_DISCONNECTED: 8
iot_wifi 95-event handler
I (238910) BTDM_INIT: BT controller compile version [9891bc6]
I (238920) wifi: flush txq
I (238920) wifi: stop sw txq