Page 1 of 1

ESP32 sketches take more space than Arduino Uno

Posted: Thu Jan 03, 2019 7:32 pm
by tomxygen
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?

Re: ESP32 sketches take more space than Arduino Uno

Posted: Sat Jan 05, 2019 2:03 pm
by Vader_Mester
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