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

Add custom esp32 libs to save some iram space #4324

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jp-bennett
Copy link
Collaborator

This adds the results from a build of https://github.com/espressif/esp32-arduino-lib-builder v4.4 with the extra sdkconfig options of:

CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM=y
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_ESP_WIFI_IRAM_OPT=n
CONFIG_ESP32_WIFI_RX_IRAM_OPT=n
CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=n
CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=n
CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=0
CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=n
CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=n

Which reduces iram usage from
Used static IRAM: 130970 bytes ( 102 remain, 99.9% used) to Used static IRAM: 113762 bytes ( 17310 remain, 86.8% used)

This pr turns it on for just the tbeam target, since that's all I've tested it on.

@caveman99
Copy link
Member

I'd not overwrite the files but host the modified tool chain on a GitHub and just link it instead of the stock one. Pretty much like we use the rp2040 of earlphilower

@jp-bennett
Copy link
Collaborator Author

jp-bennett commented Jul 25, 2024

@caveman99 I totally agree, and spent several hours trying to do exactly that, and failed to find the magic incantation to make it work. I'm sure it's possible, but this approach is what actually compiled and worked.

I'll take another shot at including it as a framework-package, and see if I can find how to do it.

Edit: Yeah, once again I hit the same problem, rooted in the frustrating lack of documentation on how to do this. I can specify my compiled libs using platform_packages = platformio/framework-arduinoespressif32-libs and it compiles, but the output firmware doesn't actually use the custom changes. No change in iram usage.

@mskvortsov
Copy link
Contributor

@jp-bennett You may want to grab a platformio package zip from https://github.com/mskvortsov/meshtastic-esp32-arduino-libs, I've put your sdkconfig options into there. And I'm ok if you want to import that repo into the meshtastic github organization.

@github-actions github-actions bot added the Stale label Nov 20, 2024
@github-actions github-actions bot closed this Nov 27, 2024
@thebentern thebentern reopened this Nov 27, 2024
@github-actions github-actions bot removed the Stale label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants