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

Heap init code improvements and updates #8458

Merged
merged 5 commits into from
Feb 15, 2022

Conversation

mhightower83
Copy link
Contributor

@mhightower83 mhightower83 commented Jan 22, 2022

Moved secondary heap init code to flash.

  External -24 IRAM, +32 IROM
  IRAM     -76 IRAM, +64 IROM

General updates to umm_init call path and defines to better align with upstream. Name changes: UMM_INIT_HEAP with UMM_CHECK_INITIALIZED, umm_init_stage_2 with _umm_init_heap, and umm_init_common with umm_init_heap.

Add file umm_cfgport.h to hold port-specific values. Stay focused on heap initialization only move-related defines.

Improved comments.

Created a wrapper function for running pre-SDK code from flash.
Updated hwdt_app_entry to use it.

Update umm_init with the option to run from ICACHE.
Added build define UMM_INIT_USE_ICACHE to move umm_init call path to flash.
Added build define UMM_INIT_USE_IRAM to move umm_init call path back to IRAM.
Using ICACHE frees up 160 bytes of IRAM at a cost of 208 bytes of IROM.

Defaults to no change, umm_init call path will be in IRAM.
Defaults with umm_init call path in ICACHE.

Moved secondary heap init code to flash.
  External -24 IRAM, +32 IROM
  IRAM     -76 IRAM, +64 IROM

General updates to umm_init call path and DEFINES to better align with
upstream. Name changes: UMM_INIT_HEAP with UMM_CHECK_INITIALIZED,
umm_init_stage_2 with _umm_init_heap, and umm_init_common with umm_init_heap.

Add file umm_cfgport.h to hold port-specific values. Stay focused
on heap initialization only move-related defines.

Improved comments.

Created a wrapper function for running pre-SDK code from flash.
Updated hwdt_app_entry to use it.

Update umm_init with option to run from ICACHE.
Added build define UMM_INIT_USE_ICACHE to move umm_init call path to flash.
When used frees up 160 bytes of IRAM at a cost of 208 bytes of IROM

Defaults to no change, umm_init call path will be in IRAM.
@d-a-v
Copy link
Collaborator

d-a-v commented Jan 25, 2022

Defaults to no change, umm_init call path will be in IRAM.

Would it be more efficient to change default settings ?

Other than that, LGTM and thanks !

@mhightower83
Copy link
Contributor Author

@d-a-v I was being over-cautious. The experience we have with using switching cache on and off before the SDK initializes is with HWDT Stack Dump, which for me has worked fine without issue. I don't know how often it gets used. I also used it in one of the methods in my "ideas for config erase" PR. So I played it safe and left it as an option to turn on.

Hmm, if we have a while before the next dot release and you guys feel comfortable with the change, I could switch the default around?

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 28, 2022

Hmm, if we have a while before the next dot release and you guys feel comfortable with the change, I could switch the default around?

We think it is OK to go this way !

Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@d-a-v d-a-v added the alpha included in alpha release label Jan 29, 2022
@d-a-v d-a-v merged commit 7356cd1 into esp8266:master Feb 15, 2022
@mhightower83 mhightower83 deleted the pr-umm_init_heap branch April 21, 2022 19:36
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request Nov 18, 2024
* Heap init code improvements and updates

Moved secondary heap init code to flash.
  External -24 IRAM, +32 IROM
  IRAM     -76 IRAM, +64 IROM

General updates to umm_init call path and DEFINES to better align with
upstream. Name changes: UMM_INIT_HEAP with UMM_CHECK_INITIALIZED,
umm_init_stage_2 with _umm_init_heap, and umm_init_common with umm_init_heap.

Add file umm_cfgport.h to hold port-specific values. Stay focused
on heap initialization only move-related defines.

Improved comments.

Created a wrapper function for running pre-SDK code from flash.
Updated hwdt_app_entry to use it.

Update umm_init with option to run from ICACHE.
Added build define UMM_INIT_USE_ICACHE to move umm_init call path to flash.
When used frees up 160 bytes of IRAM at a cost of 208 bytes of IROM

Defaults to no change, umm_init call path will be in IRAM.

* Changed default to use IROM for umm_init() and option to revert back to UMM_INIT_USE_IRAM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha included in alpha release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants