Out of memory in mbedTLS

Open
#2,341 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
c, erlang
Domain
embedded-iot

Research direction

Start by locating where AtomVM configures mbedTLS and how ESP32 builds handle the two sdkconfig options, CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC and CONFIG_MBEDTLS_DYNAMIC_BUFFER. Check how the settings interact with regular and PSRAM-enabled ESP32 builds. Done means HTTPS tile downloads no longer run out of memory on the affected setup while both memory configurations remain supported.

Written by the indexing model from the issue text.

Description

I tried to download an open street map tile from their server using https on ESP32.
mbedTLS failed with an out of memory. It seems that the following sdkconfig options fix the problem:
Probably there is some sort of pre-allocated somewhere.

CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y

(I actually selected SPI ram option).

Shoud be changed to be the default? How to make this work both with regular and PSRAM enabled ESP32?

Dominant language
Erlang
Stars
2.3k
Forks
171
Avg merge
4d 11h
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from atomvm/AtomVM

All issues in atomvm/AtomVM

Similar issues

More Embedded & IoT issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.