Here are the logs that i am getting in the terminal
i am sending url in json to esp32 (which is my http webserver) and starting ota task on that link but its giving error of memory allocation failed
logs during startup of ESP32
I (570) cpu_start: Application information:
I (575) cpu_start: Project name: template-app
I (580) cpu_start: App version: 7bcdc7e-dirty
I (586) cpu_start: Compile time: Feb 2 2022 22:32:05
I (592) cpu_start: ELF file SHA256: ec97cfa832198e8c...
I (598) cpu_start: ESP-IDF: v4.4-dev-3703-gddc44956bf-dirty
I (605) heap_init: Initializing. RAM available for dynamic allocation:
I (612) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (618) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (624) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (630) heap_init: At 3FFCC018 len 00013FE8 (79 KiB): DRAM
I (637) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (643) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (649) heap_init: At 4009AAC0 len 00005540 (21 KiB): IRAM
I (657) spi_flash: detected chip: generic
I (660) spi_flash: flash io: dio
I (676) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
log during ota start
I (40647) OTA: Starting OTA example<ESC>[0m<CR><LF>
I (40697) before OTA: [APP] Free memory: 121004 bytes<ESC>[0m<CR><LF>
E (40767) HTTP_CLIENT: Allocation failed<ESC>[0m<CR><LF>
E (40817) esp_https_ota: Failed to initialise HTTP connection<ESC>[0m<CR><LF>
I (40897) after OTA: [APP] Free memory: 124116 bytes<ESC>[0m<CR><LF>
E (40967) OTA: Firmware upgrade failed<ESC>[0m<CR><LF>
Please help me i am not getting much help on the internet in this issue While i figured out that this is heap size issue is there any way to clear all unnecessary heap before ota_start
Although i am also printing the availabe heap size before ota_start which is more than 110Kb still don't know what causing the issue.
looking forward for some breath taking solution
Thanks in advance !!!
cheers
[Resolved] ESP_HTTPS_OTA gives memory allocation failed error
-
- Posts: 6
- Joined: Wed Feb 02, 2022 5:43 pm
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP_HTTPS_OTA gives memory allocation failed error
It means either your memory is super-fragmented or you indeed try to allocate a too large chunk of memory. Which leads to the question: how much RAM are you actually trying to allocate there?
-
- Posts: 6
- Joined: Wed Feb 02, 2022 5:43 pm
Re: ESP_HTTPS_OTA gives memory allocation failed error
hello thankyou for your response
although i have resolved the issue the issue was occurring during client config so i just did this
esp_http_client_config_t config = {0};
config.url = "www.xyz.com/";
config.cert_pem = (char *)server_cert_pem_start;
config.event_handler = _http_event_handler;
config.timeout_ms = 2000;
config.keep_alive_enable = true;
and now its working
cheers !!!
although i have resolved the issue the issue was occurring during client config so i just did this
esp_http_client_config_t config = {0};
config.url = "www.xyz.com/";
config.cert_pem = (char *)server_cert_pem_start;
config.event_handler = _http_event_handler;
config.timeout_ms = 2000;
config.keep_alive_enable = true;
and now its working
cheers !!!
-
- Posts: 6
- Joined: Tue Mar 22, 2022 4:39 am
Re: [Resolved] ESP_HTTPS_OTA gives memory allocation failed error
Can you please share your OTA over the internet project? Maybe the procedure and code. Thanks
-
- Posts: 1
- Joined: Mon Feb 26, 2024 7:07 am
Re: [Resolved] ESP_HTTPS_OTA gives memory allocation failed error
hello ,Can you help me solve this problem? thanks!
Who is online
Users browsing this forum: Google [Bot] and 188 guests