Skip to content
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

Custom Arduino Build to save on code size? #136

Open
DedeHai opened this issue May 31, 2024 · 1 comment
Open

Custom Arduino Build to save on code size? #136

DedeHai opened this issue May 31, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@DedeHai
Copy link

DedeHai commented May 31, 2024

@softhack007 we recently had a quick discussion in discord about reducing code size as there seem to be many options, described here:
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/performance/size.html

this is however using the Espressif IDF and not the arduino platform. There is the option to custom compile the arduino platform:
https://community.platformio.org/t/using-arduino-framework-point-to-custom-sdkconfig-h-file/12622/3
https://github.com/espressif/esp32-arduino-lib-builder

is this something you are aware of already?

@DedeHai DedeHai added the enhancement New feature or request label May 31, 2024
@softhack007
Copy link
Collaborator

Hi @DedeHai,
I've seen your message - right now I'm busy with getting a new WLEDMM release ready. I'll come back to the topic afterwards.

Actually, I have no experience with using ESP-IDF 'kconfig' for creating a custom IDF component for arduino-esp32. Just I would be careful about this, because it's very easy to drop a component that might later be needed in some usermod.

About making "LTO" the default for compiling - i have played with it some time ago; it does help, however I see some potentially problematic areas:

  • usermods use a lot of external libs (not under WLED control), and you'll never know if any of these is not working correctly with -flto.
  • debugging and reading stack traces becomes impossible with LTO. Most developers don't know how to build a debug config (and debug firmware is too large any way for a standard 4MB partition), so there will be a lot of "wtf" if we just add -flto without a simple fallback solution.
  • Additionally, when user "in the field" have crashes, we're sometimes lucky to get a stack dump. These stack traces will become useless when the firmware was build with -flto...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants