Page 1 of 2

ESP32 INSTR_RAM

Posted: Mon Feb 25, 2019 2:40 pm
by JSchaef
Hi,
how can I increase/change the size of INSTR_RAM and/or DATA_RAM?
I'm using VisualGDB and at the end of the compiling run I get the following summary:

Code: Select all

------------------- Memory utilization report -------------------
Used DATA_FLASH: 257KB out of 8192KB (3%) [+80]
Used INSTR_FLASH: 1002KB out of 3264KB (30%) [+48]
Used INSTR_RAM: 127KB out of 128KB (99%)
Used DATA_RAM: 88KB out of 320KB (27%)
I thought, when moving to an ESP32 with external PSRAM (WROVER with 8MB ext. PSRAM) the (mapped) RAM size will be increased.
Maybe I'm using the wrong switches...

Any ideas?
Regards
Jorg

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 11:58 am
by JSchaef
Any ideas?

Regards
Jorg

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 1:10 pm
by WiFive
You can't use psram as iram.

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 1:16 pm
by JSchaef
Ok, I understand.

But can I change the size of INSTR_RAM / DATA_RAM?
(I mean, my program needs more INSTR_RAM.)
Where is the configuration for this?

Best regards
Jorg

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 1:29 pm
by WiFive
You can probably make iram bigger and reduce heap by modifying linker scripts.

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 1:38 pm
by JSchaef
Thanks for your response.

How / where can I change it?
I haven't done it before.

Regards
Jorg

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 1:47 pm
by WiFive

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 2:51 pm
by JSchaef
Hi Wifive,

do I understand it right, that I can change the "len" in line 31, lets say to 0x40000?
Is this new memory area (with the greater range of 0x40000) from 0x40080000 to 0x400C0000 free, or is mapped to something else?
What is the max. size for this?

Second, where is the "CONFIG_TRACEMEM_RESERVE_DRAM" defined in line 81?

Regards
Jorg

Re: ESP32 INSTR_RAM

Posted: Tue Mar 05, 2019 11:00 pm
by WiFive
No, every sector you add to iram you have to take away from internal heap so you might run out of that too. You should only add as little as possible and try to reduce your iram usage.

Re: ESP32 INSTR_RAM

Posted: Wed Mar 06, 2019 6:47 am
by JSchaef
Yes, I know.

So back to my question:
I changed the line 31 to an incremented size ("len").
Now I recompiled the whole project - but nothing was changed in IRAM size.

Do I have to compile the esp32.ld first? (But this should be linker file)
Or is it the wrong file and I have to change the IRAM somwhere else?

Regards
Jorg