Regain 15k of iram0_1 space from the espressif libraries!
Posted: Sun Jun 28, 2015 6:03 pm
You can free up about 15K of iram0_1 used by the espressif libraries by making a few simple changed to your linker script.
Example: I am using eagle.app.v6.new.2048.ld in my projects
This file is located in the SDK, ld directory
Find these next two lines in your linker script
(they are before two iram1_0_seg sections at the end of the file
} >dram0_0_seg :dram0_0_bss_phdr
/* __stack = 0x3ffc8000; */
Move the one .irom0.text section (at the very end of the file)
to just after the /* __stack = 0x3ffc8000; */ comment above
In my modified version I added libpp. which moved it into irom instead of iram0_1, this saves about 15K of iram - more then all other other libraries combined - the impact to overall speed is still to be determined but it is working for me.
.irom0.text : ALIGN(4)
{
_irom0_text_start = ABSOLUTE(.);
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
/* you can relocate libraries from ram cache by including them here */
/* gcc hal phy pp net80211 lwip wpa main m */
/* Mike Gore */
*libpp.a:(.literal .text .literal.* .text.*)
_irom0_text_end = ABSOLUTE(.);
} >irom0_0_seg :irom0_0_phdr
Example: I am using eagle.app.v6.new.2048.ld in my projects
This file is located in the SDK, ld directory
Find these next two lines in your linker script
(they are before two iram1_0_seg sections at the end of the file
} >dram0_0_seg :dram0_0_bss_phdr
/* __stack = 0x3ffc8000; */
Move the one .irom0.text section (at the very end of the file)
to just after the /* __stack = 0x3ffc8000; */ comment above
In my modified version I added libpp. which moved it into irom instead of iram0_1, this saves about 15K of iram - more then all other other libraries combined - the impact to overall speed is still to be determined but it is working for me.
.irom0.text : ALIGN(4)
{
_irom0_text_start = ABSOLUTE(.);
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
/* you can relocate libraries from ram cache by including them here */
/* gcc hal phy pp net80211 lwip wpa main m */
/* Mike Gore */
*libpp.a:(.literal .text .literal.* .text.*)
_irom0_text_end = ABSOLUTE(.);
} >irom0_0_seg :irom0_0_phdr