ESP32 sketches take more space than Arduino Uno

tomxygen
Posts: 5
Joined: Thu Jan 03, 2019 7:28 pm

ESP32 sketches take more space than Arduino Uno

Postby tomxygen » Thu Jan 03, 2019 7:32 pm

I just connected my ESP32 to the Arduino IDE.
I noticed however that the same sketch (blinking the onboard LED) takes 174860 bytes (13%) of program storage space. Maximum is 1310720 bytes. Global variables use 13748 bytes (4%) of dynamic memory, leaving 313932 bytes for local variables. Maximum is 327680 bytes, while on the Arduino UNO takes 928 bytes (2%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

Why?

Is there a way to fix it?

User avatar
Vader_Mester
Posts: 230
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: ESP32 sketches take more space than Arduino Uno

Postby Vader_Mester » Sat Jan 05, 2019 2:03 pm

The 2 chips are very very different! The uno is an 8bit device, the ESP32 is a 32bit device. So in a nutshell, an instruction and a simple variable in the uno only takes up 1 or 2 bites of memory, while in the ESP, 1 instruction and one variable takes up 4bytes. About 4x the size

Additionally the functionality and software framework is very different.
Consider this analogy:
Arduino Uno: Nokia 3310
ESP32: Samsung Galaxy S9 :D
There are 2 types of programmer people: The Expert programmer and The Smart programmer

The Expert programmer easily writes any code from scratch.
The Smart programmer uses his google/github powers first ;)

Who is online

Users browsing this forum: Google [Bot] and 19 guests