Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Having trouble achieving smaller memory footprint #2210

Answered by pschatzmann
jberezin asked this question in Q&A
Discussion options

After reading your Blog article here: https://www.pschatzmann.ch/home/2025/09/23/arduino-audio-tools-using-less-memory/ I tried out a small test case using PlatformIO,

Here are my results with a stripped down app: (empty setup and loop)
ini file:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 6.4% (used 21032 bytes from 327680 bytes)
Flash: [== ] 17.8% (used 233241 bytes from 1310720 bytes)

After adding library reference:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
https://github.com/pschatzmann/arduino-audio-tools

and adding the include statement:

#include "AudioTools.h"
// put function declarations here:
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}

I gain a lot more flash usage:
RAM: [= ] 8.7% (used 28556 bytes from 327680 bytes)
Flash: [==== ] 37.7% (used 494289 bytes from 1310720 bytes)

Can anyone tell me what I am doing wrong? I am wondering if including the library directly from github could be the issue. Or am I using different hardware than you were (I am using an audiokit 2.2).

You must be logged in to vote

What ESP32 core version did you use to test ?
Here is the result with the actual 3.3.2 release using IDF 5.5.1

Replies: 1 comment 7 replies

Comment options

So that would be a platformio problem then!
Did you double check that the right version of the AudioTools is loaded ?

You must be logged in to vote
7 replies
Comment options

I will check it now and try downloading it manually instead.

Comment options

I installed the Arduino IDE 2.3.6. This time I downloaded the 1.20 version from releases as a zip file (https://github.com/pschatzmann/arduino-audio-tools/releases) and installed it into the arduino IDE.

After building it is still using a lot more flash than your example:

Sketch uses 523457 bytes (39%) of program storage space. Maximum is 1310720 bytes.
Global variables use 27380 bytes (8%) of dynamic memory, leaving 300300 bytes for local variables. Maximum is 327680 bytes.

image
Comment options

I updated to arduino 2.3 6 with identical results.

Comment options

What ESP32 core version did you use to test ?
Here is the result with the actual 3.3.2 release using IDF 5.5.1

image
Answer selected by pschatzmann
Comment options

Why would you still use these obsolete versions ?
Actually there is no 2.3.6 ESP32 core version in the board manager !

Comment options

I meant arduino IDE 2.3.6. I think you found the problem with the esp32 core version. I will find the newest one and try it.

Comment options

Yep, turned updates on:

Sketch uses 264443 bytes (20%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20768 bytes (6%) of dynamic memory, leaving 306912 bytes for local variables. Maximum is 327680 bytes.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /