esp_https_server: Could not allocate memory

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

esp_https_server: Could not allocate memory

Postby Baldhead » Mon Apr 18, 2022 11:15 pm

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.

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: esp_https_server: Could not allocate memory

Postby ESP_Sprite » Tue Apr 19, 2022 3:28 am

...you sure you didn't actually run out of memory?

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: esp_https_server: Could not allocate memory

Postby Baldhead » 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.

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: esp_https_server: Could not allocate memory

Postby Baldhead » Tue Apr 19, 2022 4:29 am


stdenits
Posts: 24
Joined: Sun May 17, 2020 3:18 pm

Re: esp_https_server: Could not allocate memory

Postby stdenits » Tue Apr 19, 2022 10:43 am

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.
Last edited by stdenits on Thu Apr 21, 2022 4:13 pm, edited 3 times in total.

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: esp_https_server: Could not allocate memory

Postby Baldhead » Tue Apr 19, 2022 5:39 pm

spiram:

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

mbedTLS:

Memory allocation strategy:
External spiram

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: esp_https_server: Could not allocate memory

Postby Baldhead » Tue Apr 19, 2022 7:24 pm

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.

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: esp_https_server: Could not allocate memory

Postby Baldhead » Tue Apr 19, 2022 11:51 pm

@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.

stdenits
Posts: 24
Joined: Sun May 17, 2020 3:18 pm

Re: esp_https_server: Could not allocate memory

Postby stdenits » Wed Apr 20, 2022 3:05 am

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.

Who is online

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