mbedTLS Memory Allocation in SPIRAM (AFR 202012.00)


I am trying to allocate mbedTLS memory in SPIRAM. I changed mbedTLS memory allocation scheme from “Internal memory” to “External SPIRAM” in the menuconfig. I was unable to create TLS connection. It raised following log…
326 33343 [Network Manage ] ERROR: Handshake failed with error code :
327 33343 [Network Manage ] TLS_Connect fail (0x1, xxxxxx-ats.iot.us-east-1…)
328 33343 [Network Manage ] [ERROR][NET][333430] Failed to establish new connection. Socket status: -1.

Please be note that I was successfully connected to AWS IoT Core when used Internal memory. [Note: xxxxxx placed intentionally for this post]

Notable Project Settings:
AFR Board - esp32_wrover_kit
AFR Version - 202012.00
IDF Version - ESP-IDF v3.3-163-g601a03e
TCP/IP stack - lwIP
Internet Connectivity - WiFi
SPIRAM Configuration:

[Note: I disabled SPIRAM workaround code, though I am using ESP chip revision 1. iram0 segment overflowed if I enable SPIRAM workaround code]

I appreciate your time and feedback to resolve this. Thanks :slight_smile:


The issue has resolved. If anyone use PSRAM (SPI RAM) with esp32 chips silicon revision 1, SPIRAM workaround code MUST be enabled.


Thank you for taking time to report back.