-->
Page 1 of 1

SDK Libaries consume tooooooooooo much iRam1_0_seg. How?

PostPosted: Mon Dec 23, 2019 11:49 pm
by esp8266_abc
Recenetly, we hope our project codes upgradedd from old libphy to new version, but to find that libphy_1134(in SDK2.1.0) and libphy_libphy_1136(in SDK2.2.0) will occupy additional 0x32C=812Bytes(around), compared with libphy from SDK1.5.4. And if upgraded to ibphy_1143(in SDK3.0.1), there is additional 0x474=1140Bytes of iRam1_0_seg cumsumption !!

However, considering only 32KB for iRam_0_seg and Other SDK libaries aldready takes around 27KBytes of iRam_0_seg and leave user codes only less than 5KBytes of Non-ICACHE iRam1_0_seg barely no. Why Espressif SDK still continues to consume iRam1_0_Seg further?

We tried to place the text codes of libphy.a into ICACHE iRom0 seg, but brings about failures of exceptipn 0 IllegalInstructionCause. All code that could be placed into ICACHE iRom0 of the SDK libaries are placed by our project, but still has no additional iRam1_0_seg for new version of libphy.a. Then How?

Re: SDK Libaries consume tooooooooooo much iRam1_0_seg. How

PostPosted: Fri Dec 27, 2019 4:46 am
by eriksl
Apparently Espressif added code to interrupt handlers or other code that needs to be in IRAM. So no use placing it in FLASH (like you did).

There are some ways to make up room in IRAM without having to resort to moving Espressif code that must be there. For example by using the -Os compiler flag (and NOT using -O3, do not add it, in contrary to what's mentioned here and there, you can't use both at the same time).

Also take notice of the information Espressif gave with recent SDK binary updates. If you follow the suggestions, you will have more IRAM space at your disposal. If you don't, it will be less.

Re: SDK Libaries consume tooooooooooo much iRam1_0_seg. How

PostPosted: Mon Jan 13, 2020 2:38 pm
by eriksl
Without the SDK libraries you won't be able to do any WiFi. Or most other stuff, for most people...