0
\$\begingroup\$

I am using esp32 dev kit with 4Mb memory Arduino IDE

I have noticed when wifi example is running almost 50% of program space is used.

after some research, I have set memory configuration to no OTA/app code 3mb /spiff 1mb

still, I need more memory for app code

if I use a 16mb flash esp32 what is the maximum available/configurable app code space?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ A lot of the space is used by RTOS, networking stack, utilities and various components that you may or may not use. The actual code you add will not account for increasing the program space that much. Are you sure the 1MB default code partition will not suffice, or you're just worried that it's already 50% full? \$\endgroup\$
    – anrieff
    Commented Nov 12, 2019 at 13:34
  • \$\begingroup\$ @anrieff yes since it has taken already 50% I have doubt on how to deal with other libs? \$\endgroup\$
    – oppo
    Commented Nov 12, 2019 at 19:29

1 Answer 1

1
\$\begingroup\$

Your concern may be unfounded.

Yes, the stock ESP32 app is about 0.5 megabytes, which is 50% of the default 1MB app partition. However, any code you write, or any libraries you add to it are not going to consume the other 50% that quickly.

In my experience the code you add will barely register at all. When I started a project some time ago - that was my first impression, too ("whoa, the `hello world' stuff takes 500kB, wtf?"). But after two years and many, many thousands of lines of code, it has grown to only 73% of the allowable space, and the project is finished. What I mean is that you should worry about partitioning and insufficient space only after you actually exhaust it. I'd suggest keeping the default partitioning, especially if you're considering using the OTA update functionality - it is a very useful thing if you can use it in your specific case.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.