Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

ESP32 Huge jump in Program Size for minimal program #11269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
brownrb opened this issue Apr 21, 2025 · 1 comment
Closed
1 task done

ESP32 Huge jump in Program Size for minimal program #11269

brownrb opened this issue Apr 21, 2025 · 1 comment

Comments

@brownrb
Copy link

brownrb commented Apr 21, 2025

Board

ESP32 Dev Module

Device Description

No other board. Just ESP32 Dev Module,

Hardware Configuration

None

Version

latest stable Release (if not listed below)

IDE Name

Arduino IDE 2.3.5

Operating System

Windows 11

Flash frequency

80 Mhz

PSRAM enabled

no

Upload speed

115200

Description

I was trying to upgrade an existing ESP32 Program but even with all program options disabled the program size was 90%.

I decided to write a minimal program and report the program size for different ESP32 Core, from 2.0.13 to 3.2.0
Here are the results


Arduino IDE 2.3.5
ESP32 Dev Module
nullprog.ino as shown in next section

ESP32 Core 2.0.13
Sketch uses 257465 bytes (19%) of program storage space.
Global variables use 21432 bytes (6%) of dynamic memory

ESP32 Core 2.0.17
Sketch uses 258113 bytes (19%) of program storage space.
Global variables use 21432 bytes (6%) of dynamic memory

ESP32 Core 3.0.0
Sketch uses 889873 bytes (67%) of program storage space.
Global variables use 40724 bytes (12%) of dynamic memory,

ESP32 Core 3.1.3
Sketch uses 903108 bytes (68%) of program storage space.
Global variables use 44724 bytes (13%) of dynamic memory

ESP32 Core 3.2.0
Sketch uses 905882 bytes (69%) of program storage space.
Global variables use 46304 bytes (14%) of dynamic memory

My Question then is
Why the huge jump in program size from ESP32 Core 2.0.13 to Core 3.2.0
19% Program space to 69% program space,

I can no longer program the esp32 boards with the application (Weather station) because the program size is now (using Core 3.2.0) in excess of 100%.

Is there something I am missing here or perhaps not understanding the huge jump in program size from 2.x to 3.x of the ESP32 Core versions?

Any suggestions most welcome.

regards
Robert

Sketch

//nullprog.ino
#include <Arduino.h>
#include <WiFiServer.h>
#include <WiFiClient.h>
#include <ArduinoJson.h>
#include "SPIFFS.h"
#include <WiFi.h>
#include <Math.h>
#include <Wire.h>

void setup() {}

void loop() {}

Debug Message

None, comparing output program size for different Core versions

Other Steps to Reproduce

No, just run the nullprog.ino
test results speak for themselves

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@brownrb brownrb added the Status: Awaiting triage Issue is waiting for triage label Apr 21, 2025
@ValdayMl
Copy link

ValdayMl commented Apr 22, 2025

You can resize the partitions by allocating more space for app0 and app1 by reducing SPIFFS. For example app 1408 Spiffs 828:
`# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,

otadata, data, ota, 0xe000, 0x2000,

app0, app, ota_0, 0x10000, 0x160000,

app1, app, ota_1, 0x170000,0x160000,

spiffs, data, spiffs, 0x330000,0xD0000,`

I myself do not really understand why the idf kernel has grown so much in size. The second surprise for you will be the use of RAM. Personally, I will have to switch to esp32 with a larger memory size of 8-16 MB. But the fact that there is little RAM left threatens the use of esp32 at all. Something simple is still possible, but multifunctional devices with the current psram policy have already reached 60 KB and less free for me. Which no longer allows using https.

@Jason2866 Jason2866 removed the Status: Awaiting triage Issue is waiting for triage label Apr 22, 2025
@Jason2866 Jason2866 converted this issue into discussion #11274 Apr 22, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants