HTTP OTA causing Guru error from cached memory accessed

BrookR
Posts: 15
Joined: Fri Mar 22, 2024 11:30 am

HTTP OTA causing Guru error from cached memory accessed

Postby BrookR » Thu May 08, 2025 2:42 pm

ESP-IDF v5.3.2
ESP32S3 chip rev v0.2
partition table: 2 large OTA partitions no factory partition

Hi all,

I've been wrestling this guru error for some time and I'm stuck not knowing what is calling cached memory during the update.

I'm using the following within my code:
esp_mesh_lite (master v1.0.2)
mqtt
ADC
I2C
1 GPIO IRAM interupt
LEDC
FreeRTOS
HTTPS OTA

Order of failiure;
1. Set the OTA flag
2. OTA task wakes other made takes sleep till OTA flag not set
3. File grabbed successfully
4. IDF monitor shows below image
Image
5. devkit resets and continues

I'm using Clion with esp-idf plugin for the debugger and I can't trace the function or process that is operating in the background when this happens. Best I can do is the following image seems to show the same thing the monitor does -> Image

Anyone got experience with these guru errors?

Thanks,
BR
Last edited by BrookR on Tue May 13, 2025 7:13 am, edited 2 times in total.
Thanks,
BR

BrookR
Posts: 15
Joined: Fri Mar 22, 2024 11:30 am

Re: HTTP OTA causing Guru error from cached memory accessed

Postby BrookR » Thu May 08, 2025 2:43 pm

images attached

backtrace image 1
debugger image 2
Attachments
debugger_grab on crash.png
debugger_grab on crash.png (193.49 KiB) Viewed 137 times
Backtrace_debug.png
Backtrace_debug.png (189.8 KiB) Viewed 137 times
Thanks,
BR

BrookR
Posts: 15
Joined: Fri Mar 22, 2024 11:30 am

Re: HTTP OTA causing Guru error from cached memory accessed

Postby BrookR » Fri May 09, 2025 2:41 pm

```
D (00:33:29.842) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:29.847) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:29.861) esp_https_ota: Written image length 210944
D (00:33:29.864) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:29.883) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:29.885) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=487, ridx=0
D (00:33:29.889) HTTP_CLIENT: http_on_body 487
D (00:33:29.893) main: HTTP_EVENT_ON_DATA, len=487
D (00:33:29.899) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:29.910) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.214) HTTP_CLIENT: need_read=537, byte_to_read=512, rlen=512, ridx=487
D (00:33:30.216) HTTP_CLIENT: http_on_body 512
D (00:33:30.216) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.222) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.234) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.241) HTTP_CLIENT: need_read=25, byte_to_read=25, rlen=25, ridx=999
D (00:33:30.248) HTTP_CLIENT: http_on_body 25
D (00:33:30.252) main: HTTP_EVENT_ON_DATA, len=25
D (00:33:30.257) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.271) esp_https_ota: Written image length 211968
D (00:33:30.274) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:30.293) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.295) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:30.299) HTTP_CLIENT: http_on_body 512
D (00:33:30.303) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.309) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.320) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.328) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=512, ridx=512
D (00:33:30.335) HTTP_CLIENT: http_on_body 512
D (00:33:30.339) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.344) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.359) esp_https_ota: Written image length 212992
D (00:33:30.361) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:30.380) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.383) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:30.387) HTTP_CLIENT: http_on_body 512
D (00:33:30.391) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.396) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.408) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.415) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=512, ridx=512
D (00:33:30.422) HTTP_CLIENT: http_on_body 512
D (00:33:30.426) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.432) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.487) esp_https_ota: Written image length 214016
D (00:33:30.489) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:30.502) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.505) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:30.508) HTTP_CLIENT: http_on_body 512
D (00:33:30.512) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.518) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.529) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.538) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=512, ridx=512
D (00:33:30.544) HTTP_CLIENT: http_on_body 512
D (00:33:30.548) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.554) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.568) esp_https_ota: Written image length 215040
D (00:33:30.570) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:30.589) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
V (00:33:30.591) transport_base: poll_read: select - Timeout before any socket was ready!
D (00:33:30.592) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:30.604) HTTP_CLIENT: http_on_body 512
D (00:33:30.608) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.613) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
V (00:33:30.613) transport_base: poll_read: select - Timeout before any socket was ready!
V (00:33:30.633) mqtt_client: esp_mqtt_handle_transport_read_error: transport_read(): call timed out before data was ready!
D (00:33:30.633) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.652) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=512, ridx=512
D (00:33:30.659) HTTP_CLIENT: http_on_body 512
D (00:33:30.663) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.668) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.683) esp_https_ota: Written image length 216064
D (00:33:30.685) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:30.705) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.708) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:30.711) HTTP_CLIENT: http_on_body 512
D (00:33:30.715) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.720) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.731) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.739) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=512, ridx=512
D (00:33:30.747) HTTP_CLIENT: http_on_body 512
D (00:33:30.751) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.756) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.770) esp_https_ota: Written image length 217088
D (00:33:30.773) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:30.792) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.795) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:30.798) HTTP_CLIENT: http_on_body 512
D (00:33:30.802) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.808) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.819) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.828) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=512, ridx=512
D (00:33:30.834) HTTP_CLIENT: http_on_body 512
D (00:33:30.838) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.843) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.890) esp_https_ota: Written image length 218112
D (00:33:30.891) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:30.905) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.907) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:30.911) HTTP_CLIENT: http_on_body 512
D (00:33:30.915) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:30.920) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.931) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:30.940) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=7, ridx=512
D (00:33:30.947) HTTP_CLIENT: http_on_body 7
D (00:33:30.950) main: HTTP_EVENT_ON_DATA, len=7
D (00:33:30.956) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:30.967) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:31.062) HTTP_CLIENT: need_read=505, byte_to_read=505, rlen=505, ridx=519
D (00:33:31.064) HTTP_CLIENT: http_on_body 505
D (00:33:31.064) main: HTTP_EVENT_ON_DATA, len=505
D (00:33:31.070) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:31.084) esp_https_ota: Written image length 219136
D (00:33:31.086) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:31.106) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:31.109) HTTP_CLIENT: need_read=1024, byte_to_read=512, rlen=512, ridx=0
D (00:33:31.112) HTTP_CLIENT: http_on_body 512
D (00:33:31.116) main: HTTP_EVENT_ON_DATA, len=512
D (00:33:31.121) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:31.132) HTTP_CLIENT: is_data_remain=1, is_chunked=0, content_length=219824
D (00:33:31.141) HTTP_CLIENT: need_read=512, byte_to_read=512, rlen=176, ridx=512
D (00:33:31.148) HTTP_CLIENT: http_on_body 176
D (00:33:31.152) main: HTTP_EVENT_ON_DATA, len=176
D (00:33:31.157) event: no handlers have been registered for event ESP_HTTP_CLIENT_EVENT:4 posted to loop 0x3fca99c0
D (00:33:31.168) HTTP_CLIENT: http_on_message_complete, parser=0x3fcc42ac
D (00:33:31.175) HTTP_CLIENT: is_data_remain=0, is_chunked=0, content_length=219824
D (00:33:31.185) esp_https_ota: Written image length 219824
D (00:33:31.188) event: no handlers have been registered for event ESP_HTTPS_OTA_EVENT:5 posted to loop 0x3fca99c0
D (00:33:31.208) HTTP_CLIENT: is_data_remain=0, is_chunked=0, content_length=219824
D (00:33:31.209) esp_https_ota: Connection closed
I (00:33:31.211) esp_image: segment 0: paddr=00200020 vaddr=3c020020 size=0ce04h ( 52740) map
Guru Meditation Error: Core / panic'ed (Cache disabled but cached memory region accessed).
Write back error occurred while dcache tries to write back to flash
The following backtrace may not indicate the code that caused Cache invalid access


Core 0 register dump:
PC : 0x4208ef03 PS : 0x00060934 A0 : 0x820668fc A1 : 0x3fcc0b40
--- 0x4208ef03: sha_ll_fill_text_block at D:/ESP/esp-idf-v5.3/components/hal/esp32s3/include/hal/sha_ll.h:138 (discriminator 1)
(inlined by) sha_hal_hash_block at D:/ESP/esp-idf-v5.3/components/hal/sha_hal.c:75 (discriminator 1)

A2 : 0x00000002 A3 : 0x3c117780 A4 : 0x00000010 A5 : 0x00000000
A6 : 0x00000000 A7 : 0xa01f8000 A8 : 0x00000010 A9 : 0x6003b0bc
A10 : 0x00000001 A11 : 0x6c2bfb8f A12 : 0x00060520 A13 : 0x00000002
A14 : 0x00000120 A15 : 0x3fcba820 SAR : 0x00000004 EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0x00000000
--- 0x40056f5c: memcpy in ROM
0x40056f72: memcpy in ROM



Backtrace: 0x4208ef00:0x3fcc0b40 0x420668f9:0x3fcc0b60 0x42066b2d:0x3fcc0b80 0x42061dde:0x3fcc0bc0 0x42023a4c:0x3fcc0be0 0x420235af:0x3fcc0c00 0x4202371f:0x3fcc0c40 0x4202378c:0x3fcc0ca0 0x420238fe:0x3fcc0ce0 0x4202398d:0x3fcc0d10 0x420221c6:0x3fcc0d30 0x4204edc1:0x3fcc0e60 0x4200d743:0x3fcc0e80 0x4037cebe:0x3fcc10d0
--- 0x4208ef00: sha_ll_fill_text_block at D:/ESP/esp-idf-v5.3/components/hal/esp32s3/include/hal/sha_ll.h:139
(inlined by) sha_hal_hash_block at D:/ESP/esp-idf-v5.3/components/hal/sha_hal.c:75
0x420668f9: esp_sha_block_mode at D:/ESP/esp-idf-v5.3/components/mbedtls/port/sha/dma/sha.c:167
0x42066b2d: esp_sha_dma at D:/ESP/esp-idf-v5.3/components/mbedtls/port/sha/dma/sha.c:331
0x42061dde: mbedtls_sha256_update at D:/ESP/esp-idf-v5.3/components/mbedtls/port/sha/dma/esp_sha256.c:171
0x42023a4c: bootloader_sha256_data at D:/ESP/esp-idf-v5.3/components/bootloader_support/src/idf/bootloader_sha.c:32
0x420235af: process_segment_data at D:/ESP/esp-idf-v5.3/components/bootloader_support/src/esp_image_format.c:734
0x4202371f: process_segment at D:/ESP/esp-idf-v5.3/components/bootloader_support/src/esp_image_format.c:600
0x4202378c: process_segments at D:/ESP/esp-idf-v5.3/components/bootloader_support/src/esp_image_format.c:521
0x420238fe: image_load at D:/ESP/esp-idf-v5.3/components/bootloader_support/src/esp_image_format.c:148
0x4202398d: esp_image_verify at D:/ESP/esp-idf-v5.3/components/bootloader_support/src/esp_image_format.c:294
0x420221c6: esp_ota_end at D:/ESP/esp-idf-v5.3/components/app_update/esp_ota_ops.c:353
0x4204edc1: esp_https_ota_finish at D:/ESP/esp-idf-v5.3/components/esp_https_ota/src/esp_https_ota.c:656

```

new debug log
Last edited by BrookR on Tue May 13, 2025 7:13 am, edited 1 time in total.
Thanks,
BR

BrookR
Posts: 15
Joined: Fri Mar 22, 2024 11:30 am

Re: HTTP OTA causing Guru error from cached memory accessed

Postby BrookR » Mon May 12, 2025 8:16 am

Update:
I've found that the IRAM interrupt was a contributing factor but not the cause of the issue. Since removing it I've had a mixture of failed writing to flash or the same guru errors.

Update 2:
I've stitched HTTPS_OTA into the local_control example of mesh_lite v1.0.2 with MQTT over TCP, and confirmed it works practically. I've matched what functions are used in my main project and the cached memory issue still appears when process_segment_data is used.
Thanks,
BR

BrookR
Posts: 15
Joined: Fri Mar 22, 2024 11:30 am

Re: HTTP OTA causing Guru error from cached memory accessed

Postby BrookR » Tue May 13, 2025 7:12 am

Hi All,

Consider the issue solved! Well at least half solved, I've found the code where just not found a way to fully patch it yet :lol:

The issue, bizarrely was caused due to the Mesh_lite config being called and set via a function call in app_main() instead of being set via menuconfig or prior to flashing. I'm not sure how the cached memory is/was being accessed after the function has returned, so will investigate further.

If I use the below set up as seen in the "local_control" example from esp_mesh_lite lib then the app works

Code: Select all

esp_mesh_lite_config_t mesh_lite_config = ESP_MESH_LITE_DEFAULT_INIT();
esp_mesh_lite_init(&mesh_lite_config);
esp_mesh_lite_start();
How I was calling the set up was via NVS and then using the set functions within the mesh_lite lib to push the settings after in initial default was called, example seen below

Code: Select all

if (nvs_open("MAX_LAYER", NVS_READWRITE, &nvsHandle) != ESP_OK) {
        mesh_lite_config.max_level = CMSN_MESH_LAYER;
    } else {
        int8_t max_layer = 0;
        err = nvs_get_i8(nvsHandle, "MAX_LAYER", &max_layer);
        mesh_lite_config.max_level = (err == ESP_OK) ? max_layer : CMSN_MESH_LAYER;
        nvs_close(nvsHandle);
    }
    //...further nvs calls for different cfg settings
    esp_mesh_lite_init(&mesh_lite_config);
    esp_mesh_lite_start();
Thanks,
BR

BrookR
Posts: 15
Joined: Fri Mar 22, 2024 11:30 am

Re: HTTP OTA causing Guru error from cached memory accessed

Postby BrookR » Tue May 13, 2025 1:51 pm

Update:

Calling or setting the below will have an adverse affect on the mesh ocnfig,

Code: Select all

mesh_lite_config.ap_ssid = "mySSSID" 
Thanks,
BR

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests