Remedy for overflow of iram0_0_seg?

jsam589
Posts: 74
Joined: Sat Aug 17, 2019 9:31 pm

Remedy for overflow of iram0_0_seg?

Postby jsam589 » Wed Feb 05, 2020 2:40 am

I have an application that was working nicely until I added a call to enter deep sleep. I then got the overflow and failure from linker shown below. I have tried changing from Debug to Release compiler option, and this eliminates the error (for now). However, I will soon be activating Bluetooth and I have seen other posts suggesting that may again overflow this segment. I am using IDF release/v4.0 commit b0d6c01b0.

One forum post mentioned editing components/esp32/ld/esp32.ld in the IDF, which I have also tried and that seems to work. I changed 0x20000 to 0x28000 and it built okay.
  • What is the limit, and any caveats, on increasing this value?
    Is there a way to have a local *.ld file in my project to override this value without editing the actual IDF file?

Code: Select all

[100%] Linking CXX executable knt.elf
/home/se/Esp_Idf_Versions/4_0rel_b0d6c01b0/tools/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: knt.elf section `.iram0.text' will not fit in region `iram0_0_seg'
/home/se/Esp_Idf_Versions/4_0rel_b0d6c01b0/tools/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: IRAM0 segment data does not fit.
/home/se/Esp_Idf_Versions/4_0rel_b0d6c01b0/tools/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: region `iram0_0_seg' overflowed by 205 bytes
collect2: error: ld returned 1 exit status
Original line in components/esp32/ld/esp32.ld:

Code: Select all

/* IRAM for PRO cpu. Not sure if happy with this, this is MMU area... */
  iram0_0_seg (RX) :                 org = 0x40080000, len = 0x20000

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Remedy for overflow of iram0_0_seg?

Postby WiFive » Wed Feb 05, 2020 4:09 am

You are extending into iram1 which is also used as heap memory and apptrace memory

jsam589
Posts: 74
Joined: Sat Aug 17, 2019 9:31 pm

Re: Remedy for overflow of iram0_0_seg?

Postby jsam589 » Wed Feb 05, 2020 2:00 pm

WiFive wrote: "You are extending into iram1 which is also used as heap memory and apptrace memory"

Is it okay to do this? Will the iram1 allocation be adjusted automatically?

What is the usual solution to the error of not fitting into iram0_0_seg? It seems to happen to quite a few people.

A colleague on my same project has seen this when she activated Bluetooth. In my case, it showed up when I pulled in deep sleep.

How can we address this safely and still get the functionality working that we need?

Thanks!

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Remedy for overflow of iram0_0_seg?

Postby WiFive » Wed Feb 05, 2020 7:31 pm

No it is not adjusted automatically.

emp32_32
Posts: 9
Joined: Mon Jan 31, 2022 7:02 pm

Re: Remedy for overflow of iram0_0_seg?

Postby emp32_32 » Sun May 22, 2022 1:04 pm

Hello jsam589,

Did you ever receive an answer to your question "How can we address this safely and still get the functionality working that we need?" ?

Who is online

Users browsing this forum: Google [Bot] and 90 guests