Page 1 of 1

esp_https_server: Could not allocate memory

Posted: Mon Apr 18, 2022 11:15 pm
by Baldhead
Hi,

Before update the project to esp32-s3 the program worked.

What can be the problem ?

esp-idf version: v5.0-dev-2485-g04bcc17dcc

Thank's.

Re: esp_https_server: Could not allocate memory

Posted: Tue Apr 19, 2022 3:28 am
by ESP_Sprite
...you sure you didn't actually run out of memory?

Re: esp_https_server: Could not allocate memory

Posted: Tue Apr 19, 2022 4:12 am
by Baldhead
From what i remember there was 160kB of static ram for dynamic allocation and over 7 MB of psram. I had configured in menuconfig to first try to allocate memory in psram.

Re: esp_https_server: Could not allocate memory

Posted: Tue Apr 19, 2022 4:29 am
by Baldhead

Re: esp_https_server: Could not allocate memory

Posted: Tue Apr 19, 2022 10:43 am
by stdenits
Hi.
Sorry for not creating a separate thread.

I have the same error at ESP32S3. I don't know when the HTTPS server stopped working - while it was working, I was doing other things. Was debugging a new device today and got this:

Code: Select all

E (2288) esp_https_server: Could not allocate memory
Looks like it can not allocate memory for server certificates.
Certificates are presented in the same way as in the example.

Attached the log from the UART terminal to the message.

Baldhead wrote:
Tue Apr 19, 2022 4:12 am
From what i remember there was 160kB of static ram for dynamic allocation and over 7 MB of psram. I had configured in menuconfig to first try to allocate memory in psram.
Could you provide the full name of the option? The search returned the allocation only for the BT BLE stack.

Re: esp_https_server: Could not allocate memory

Posted: Tue Apr 19, 2022 5:39 pm
by Baldhead
spiram:

Try to allocate memories of wifi and lwip in spiram firstly. If failed, allocate internal memory.

mbedTLS:

Memory allocation strategy:
External spiram

Re: esp_https_server: Could not allocate memory

Posted: Tue Apr 19, 2022 7:24 pm
by Baldhead
The error is because the certificate name changed from cacert to servercert.

I took the certificates from the example in esp-idf folder and put them in the certs folder of my project. I also edited the cmakelists with the new name and also changed the servercert name in my application.

now i need to know how my websocket client will be able to access the websocket server with this new certificate.

Re: esp_https_server: Could not allocate memory

Posted: Tue Apr 19, 2022 11:51 pm
by Baldhead
@ESP_Sprite,

Could you ask the espressif staff to look carefully at this ?

Eight months have passed.

https://github.com/espressif/esp-idf/is ... 1103254506

Thank's.

Re: esp_https_server: Could not allocate memory

Posted: Wed Apr 20, 2022 3:05 am
by stdenits
Baldhead wrote:
Tue Apr 19, 2022 7:24 pm
The error is because the certificate name changed from cacert to servercert.
Yes. Now server starts, but got handshake error. Tnanks.