Skip to content

Add custom esp32 libs to save some iram space#4324

Closed
jp-bennett wants to merge 4 commits into
masterfrom
custom-esp32
Closed

Add custom esp32 libs to save some iram space#4324
jp-bennett wants to merge 4 commits into
masterfrom
custom-esp32

Conversation

@jp-bennett

Copy link
Copy Markdown
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
Copy Markdown
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

jp-bennett commented Jul 25, 2024

Copy link
Copy Markdown
Collaborator Author

@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
Copy Markdown
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 Issues that will be closed if not triaged. 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 Issues that will be closed if not triaged. label Nov 28, 2024
@github-actions github-actions Bot added the Stale Issues that will be closed if not triaged. label Jan 28, 2025
@github-actions github-actions Bot closed this Feb 5, 2025
@jp-bennett jp-bennett deleted the custom-esp32 branch December 20, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale Issues that will be closed if not triaged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants