-->
Page 1 of 1

ICACHE_FLASH_ATTR and existing C++ code

PostPosted: Tue Dec 29, 2015 4:09 pm
by jadamcrain3
I am trying to get a C++ library running on esp8266, but am having trouble with the following linker message:

section `.text' will not fit in region `iram1_0_seg

Various searches have lead me to believe that the culprit is that my existing library doesn't use ICACHE_FLASH_ATTR on its functions. Annotating the every function in the existing library is a deal breaker... its just too big. I've gotten this library running on an 8-bit AVR w/ 8K of SRAM before, so this should be easy!

Are there any tricks I can use to tell the linker to put an entire set of things in flash w/o having to manually change an existing library.

thanks,
Adam

Re: ICACHE_FLASH_ATTR and existing C++ code

PostPosted: Thu Feb 11, 2016 10:19 am
by Michael Rochelle
I have the same problem and haven't been able to find a solution. Did you find anything? I'm starting to evaluate other chips now because of this.

Re: ICACHE_FLASH_ATTR and existing C++ code

PostPosted: Thu Feb 11, 2016 12:11 pm
by jadamcrain3
No, I never found an adequate solution. My library compiled just fine, but I was never able to resolve the memory issues.

Re: ICACHE_FLASH_ATTR and existing C++ code

PostPosted: Thu Feb 11, 2016 2:27 pm
by bouvrais
jadamcrain3 wrote:No, I never found an adequate solution. My library compiled just fine, but I was never able to resolve the memory issues.

I invite you to consult this forum entry which I created a few days ago. Basically I was having a similar issue. It turns out it is relatively easy to place your library in irom by editing you linker script (all credits go to dkinzer and jcmvbkbc).
Hope it helps.

JU