Options to resolve: "IRAM0 segment data does not fit"

avidNewb
Posts: 6
Joined: Sat Jun 29, 2019 11:19 pm

Options to resolve: "IRAM0 segment data does not fit"

Postby avidNewb » Tue Jul 30, 2019 8:31 pm

Using Arduino IDE and ESP-IDF 1.0.2

I've got a very large project that I keep hitting the limits of IRAM for. Each time I refactor any code I can to decrease the load and end up removing the "IRAM_ATTR" attribute from one of my tasks. However, I'm running out of opportunities to do that and I'm not sure what issues may arrive when this project is in production from doing that.

I've considered switching to a board with PSRAM but I don't understand how that works in Arduino IDE. I tried compiling for an "ESP32 Dev Module" with PSRAM Enabled but this doesn't resolve the issue mentioned above. I don't currently have a board with PSRAM so I'm not sure if it is initializing the PSRAM or not.

I have a few questions:

1. Can external RAM resolve this issue? If so, how do I utilize it with an Arduino IDE project?
2. Is it advisable to remove some of the ESP-IDF items from IRAM to resolve this? Does anyone that has done this have suggestions on items to remove?
3. Is it possible to change the memory configuration to move some space from iram0_2_seg to iram0_0_seg?

If anyone has other suggestions, I am all ears.

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

Re: Options to resolve: "IRAM0 segment data does not fit"

Postby WiFive » Wed Jul 31, 2019 12:32 am

Why are you putting so much stuff in IRAM? Usually only very time sensitive stuff like interrupt callbacks should go there. Psram is only for dram not iram.

avidNewb
Posts: 6
Joined: Sat Jun 29, 2019 11:19 pm

Re: Options to resolve: "IRAM0 segment data does not fit"

Postby avidNewb » Wed Jul 31, 2019 4:24 am

It's an aquarium light controller with some tasks in IRAM such as the dimmer task. Other than that, I'm not really. I've moved almost everything out that I can. It's not even when I'm adding to these tasks that the error occurs. For instance, I'm working on esp now communication and somehow breached the IRAM0 limit when this task is not in IRAM. It's my understanding that variables can be placed there as well. I may be wrong on that.

avidNewb
Posts: 6
Joined: Sat Jun 29, 2019 11:19 pm

Re: Options to resolve: "IRAM0 segment data does not fit"

Postby avidNewb » Wed Jul 31, 2019 4:40 am

Update:
I now understand that the iram2 segment is actually flash so this doesn't help me.

Who is online

Users browsing this forum: No registered users and 49 guests