Skip to content

ESP32 Huge jump in Program Size for minimal program #11274

Answered by me-no-dev
brownrb asked this question in Q&A
Discussion options

You must be logged in to vote

I dug deep into this and here is my conclusion:

  • Size increase comes from the WiFi library after the network layer refactoring in v3
  • It is present on empty sketch, because we always instantiate the WiFi object
  • This was true even before, but now we include proper destructors for the AP and STA interfaces
  • The destructors call WiFi.mode() internally, which in turn links to all low level WiFi and Netif init/deinit methods
  • Commenting out the calls to WiFi.mode() in the destructors, brings back the flash size to 300+KB

Now with that said:

  • There is no real scenario, where you will include the WiFi library, but never use it. If you will use only ETH/PPP, then include Network.h instead.
  • Any use …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ValdayMl
Comment options

Comment options

You must be logged in to vote
1 reply
@ValdayMl
Comment options

Answer selected by me-no-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #11269 on April 22, 2025 11:16.