You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FreeRTOS ISR stack is placed in the data section, resulting in kilobytes of zeroes being needlessly embedded in the binary and loaded at startup.
Expected Behavior
Unless there is some performance/initialisation reason not to, this should be placed in bss (or noinit, if possible) for a small but free reduction in binary size.
More Info
Simply changing .data to .section .bss, "aw" here saves ~3kB by default on ESP32 (with CONFIG_FREERTOS_ISR_STACKSIZE=1536 and portNUM_PROCESSORS=2):
github-actionsbot
changed the title
ISR stack section adds kilobytes of empty data to binary
ISR stack section adds kilobytes of empty data to binary (IDFGH-7635)
Jun 19, 2022
@boarchuz Putting it into .bss is fine AFAIK. Strictly speaking, we should be placing the interrupt stacks into one of the .section .dram sections (in case CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY) is enabled.
Can unused port_IntStackTop be removed?
Possibly since it's currently not used. But I assume it was added in case any debugging code can easily access the ISR stack.
I'll get someone to relocate the interrupt stack and tidy up the code.
@Dazza0@o-marshmallow Sorry for the late feedback on this.
I have just noticed that anything with DRAM_ATTR will be placed in DRAM 'data' section (even zero-initialised variables) so, unfortunately, this change has not had the desired effect.
I understand this is a very low priority so I will avoid a new issue but please consider a fix if you see this comment. Thankyou.
Environment
Problem Description
The FreeRTOS ISR stack is placed in the data section, resulting in kilobytes of zeroes being needlessly embedded in the binary and loaded at startup.
Expected Behavior
Unless there is some performance/initialisation reason not to, this should be placed in bss (or noinit, if possible) for a small but free reduction in binary size.
More Info
Simply changing
.data
to.section .bss, "aw"
here saves ~3kB by default on ESP32 (with CONFIG_FREERTOS_ISR_STACKSIZE=1536 and portNUM_PROCESSORS=2):esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S
Lines 45 to 54 in 16a4ee7
The text was updated successfully, but these errors were encountered: