Linking Libraries to Flash ICACHE_FLASH_ATTR

EliteScientist
Posts: 10
Joined: Sat Nov 21, 2015 5:08 pm

Linking Libraries to Flash ICACHE_FLASH_ATTR

Postby EliteScientist » Fri Feb 12, 2016 12:19 am

Is there any way to link libraries directly to flash? I'm using a couple libraries and going through their source code and adding ICACHE_FLASH_ATTR to every function is a deal breaker. There are a ton of functions. Including these libraries are causing me to get an
xtensa-lx106-elf/bin/ld: .output/eagle/debug/image/eagle.app.v6.out section `.text' will not fit in region `iram1_0_seg' error.

are there any options to link static libs directly to flash?

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Re: Linking Libraries to Flash ICACHE_FLASH_ATTR

Postby dkinzer » Fri Feb 19, 2016 12:18 am

You can write a different linker script that will force code from specific libraries into the Flash section. Go look at the Arduino code base where they use the technique to ensure that library routines are in Flash.
Don Kinzer
Beaverton, OR, USA

EliteScientist
Posts: 10
Joined: Sat Nov 21, 2015 5:08 pm

Re: Linking Libraries to Flash ICACHE_FLASH_ATTR

Postby EliteScientist » Mon Mar 07, 2016 9:01 am

dkinzer wrote:You can write a different linker script that will force code from specific libraries into the Flash section. Go look at the Arduino code base where they use the technique to ensure that library routines are in Flash.


Thanks.

russus
Posts: 14
Joined: Thu Nov 10, 2016 8:56 pm

Re: Linking Libraries to Flash ICACHE_FLASH_ATTR

Postby russus » Wed Jan 18, 2017 6:15 pm

You can write a different linker script that will force code from specific libraries into the Flash section


Is there any chance this process is explained somewhere? What needs to be modified in linker script in order for the library to go to flash.

Thanks

tobewinner
Posts: 45
Joined: Tue Jan 19, 2016 2:39 pm

Re: Linking Libraries to Flash ICACHE_FLASH_ATTR

Postby tobewinner » Thu Apr 06, 2017 12:38 am

dkinzer wrote:You can write a different linker script that will force code from specific libraries into the Flash section. Go look at the Arduino code base where they use the technique to ensure that library routines are in Flash.

I compile third_party/lwip myself, and the same problem(segmentled section `.text' will not fit in region `iram1_0_seg') happened, can you explain a little about how to force the lib into flash section.
thx

Who is online

Users browsing this forum: No registered users and 60 guests