espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
257 stars 154 forks source link

OTA MQTT | assert failed: spinlock_acquire spinlock.h:75 (lock) (CA-209) #112

Closed StevenB56 closed 2 years ago

StevenB56 commented 2 years ago

Hi,

I have a issue using OTA MQTT demo. After downloading the new firmware, the ESP32 restarts following an error and starts the update again, endlessly.

I (111678) AWS_OTA: Received valid file block: Block index=192, Size=4096 I (111698) AWS_OTA: Number of blocks remaining: 2 I (111698) AWS_OTA: Current State=[WaitingForFileBlock], Event=[ReceivedFileBlock], New state=[WaitingForFileBlock] I (111718) coreMQTT: Packet received. ReceivedBytes=4218. I (111718) coreMQTT: De-serialized incoming PUBLISH packet: DeserializerResult=MQTTSuccess. I (111718) coreMQTT: State record updated. New state=MQTTPublishDone. I (111728) coreMQTT: Invoking subscription callback of matching topic filter: TopicFilter=$aws/things/+/streams/#, TopicName=$aws/things/OTA_Device_3103_1512/streams/xxxxxxxxxx/data/cbor I (111748) AWS_OTA: Received data message callback, size 4121. I (111758) AWS_OTA: Received valid file block: Block index=193, Size=4096 I (111778) AWS_OTA: Number of blocks remaining: 1 I (111778) AWS_OTA: Current State=[WaitingForFileBlock], Event=[ReceivedFileBlock], New state=[WaitingForFileBlock] I (111778) coreMQTT: Packet received. ReceivedBytes=2122. I (111788) coreMQTT: De-serialized incoming PUBLISH packet: DeserializerResult=MQTTSuccess. I (111798) coreMQTT: State record updated. New state=MQTTPublishDone. I (111798) coreMQTT: Invoking subscription callback of matching topic filter: TopicFilter=$aws/things/+/streams/#, TopicName=$aws/things/OTA_Device_3103_1512/streams/xxxxxxxxxx/data/cbor I (111818) AWS_OTA: Received data message callback, size 2025. I (111828) AWS_OTA: Received valid file block: Block index=194, Size=2000 I (111838) AWS_OTA: Received final block of the update. I (111848) corePKCS11: PKCS #11 successfully initialized. assert failed: spinlock_acquire spinlock.h:75 (lock) Backtrace:0x40375c2a:0x3fced8000x4037b955:0x3fced820 0x40382c21:0x3fced840 0x4037f519:0x3fced960 0x420130b2:0x3fced980 0x42013453:0x3fced9a0 0x42011f87:0x3fced9f0 0x4200d211:0x3fceda20 0x4200d297:0x3fceda50 0x4200d545:0x3fceda90 0x4200d5c3:0x3fcedac0 0x4200d684:0x3fcedaf0 0x42009c1d:0x3fcedb10 0x4200a121:0x3fcedb30 0x4200a88d:0x3fcedb60 0x4200a167:0x3fcedbb0 0x4200a1f6:0x3fcedbe0 0x4200a701:0x3fcedc10 0x4200858d:0x3fcedc30 0x42003090:0x3fcedc50 0x4037f3dd:0x3fcedc70 ELF file SHA256: 7fae8ff717b81a89 Rebooting... ESP-ROM:esp32s3-20210327 ...

I am compiling directly from VSCode. I tried on an ESP32 and an ESP32-S3 and with the esp-idf version 4.3.2 and version 4.4 without success. Do you have an idea of ​​the problem ?

Thanks

StevenB56 commented 2 years ago

I tried with the OTA HTTP demo, I have the same problem! The error is different, but it's in the same place: after downloading all the firmware.

StevenB56 commented 2 years ago

Going directly through ESP-IDF, there are additional logs. But unfortunately I'm still stuck.

I (43531) AWS_OTA: Received valid file block: Block index=40, Size=4096
I (43551) AWS_OTA: Received final block of the update.
I (43551) corePKCS11: PKCS #11 successfully initialized.

assert failed: spinlock_acquire spinlock.h:75 (lock)

Backtrace:0x40081b8e:0x3ffd9bc00x400885ed:0x3ffd9be0 0x4008fa1d:0x3ffd9c00 0x4008c129:0x3ffd9d20 0x400e2289:0x3ffd9d40 0x400e25db:0x3ffd9d60 0x400e1167:0x3ffd9db0 0x400dc5c5:0x3ffd9de0 0x400dc64b:0x3ffd9e10 0x400dc8d3:0x3ffd9e50 0x400dc93e:0x3ffd9e80 0x400dc9f8:0x3ffd9eb0 0x400d90d7:0x3ffd9ed0 0x400d95a6:0x3ffd9ef0 0x400d9ced:0x3ffd9f20 0x400d95eb:0x3ffd9f70 0x400d9676:0x3ffd9fa0 0x400d9b61:0x3ffd9fd0 0x400d7b9a:0x3ffd9ff0 0x400d2e30:0x3ffda010 0x4008bff1:0x3ffda030
0x40081b8e: panic_abort at D:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/panic.c:402

0x400885ed: esp_system_abort at D:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/esp_system.c:121

0x4008fa1d: __assert_func at D:/Espressif/frameworks/esp-idf-v4.4/components/newlib/assert.c:85

0x4008c129: spinlock_acquire at D:/Espressif/frameworks/esp-idf-v4.4/components/esp_hw_support/include/soc/spinlock.h:75 (inlined by) xPortEnterCriticalTimeout at D:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/port.c:288

0x400e2289: vPortEnterCritical at D:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/include/freertos/portmacro.h:578
 (inlined by) initialize_nvs_partition at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/corePKCS11/port/core_pkcs11_pal.c:63

0x400e25db: PKCS11_PAL_FindObject at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/corePKCS11/port/core_pkcs11_pal.c:236

0x400e1167: C_FindObjects at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/corePKCS11/corePKCS11/source/portable/mbedtls/core_pkcs11_mbedtls.c:3141

0x400dc5c5: prvGetCertificateHandle at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/port/ota_pal.c:257

0x400dc64b: prvGetCertificate at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/port/ota_pal.c:308

0x400dc8d3: otaPal_ReadAndAssumeCertificate at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/port/ota_pal.c:366

0x400dc93e: otaPal_CheckFileSignature at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/port/ota_pal.c:414

0x400dc9f8: otaPal_CloseFile at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/port/ota_pal.c:496
0x400d90d7: ingestDataBlockCleanup at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/ota-for-aws-iot-embedded-sdk/source/ota.c:2648

0x400d95a6: ingestDataBlock at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/ota-for-aws-iot-embedded-sdk/source/ota.c:2720

0x400d9ced: processDataHandler at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/ota-for-aws-iot-embedded-sdk/source/ota.c:1185

0x400d95eb: executeHandler at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/ota-for-aws-iot-embedded-sdk/source/ota.c:2816

0x400d9676: receiveAndProcessOtaEvent at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/ota-for-aws-iot-embedded-sdk/source/ota.c:2893

0x400d9b61: OTA_EventProcessingTask at D:/ESP-IDF/tesssst/esp-aws-iot/libraries/ota-for-aws-iot-embedded-sdk/ota-for-aws-iot-embedded-sdk/source/ota.c:2918

0x400d7b9a: otaThread at d:\esp-idf\tesssst\esp-aws-iot\examples\ota\ota_mqtt\build/../main/ota_demo_core_mqtt.c:1477

0x400d2e30: pthread_task_func at D:/Espressif/frameworks/esp-idf-v4.4/components/pthread/pthread.c:195 (discriminator 15)

0x4008bff1: vPortTaskWrapper at D:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/port.c:131

ELF file SHA256: cfebb78e0b3cd33f

Rebooting...
ets Jun  8 2016 00:22:57