Ran out of IRAM, possible to repurpose SRAM/DRAM?

p-rimes
Posts: 89
Joined: Thu Jun 08, 2017 6:20 pm

Ran out of IRAM, possible to repurpose SRAM/DRAM?

Postby p-rimes » Fri Jan 24, 2020 6:21 pm

I ran out of IRAM; needing too many optimizations as well as apptrace and other features.

I’ve read several forum posts where others have ran out of DRAM and repurposed IRAM to get more data. I have the OPPOSITE problem — is there some memory which could be repurposed to fit more executable memory?

Wifi, lwIP and SPI master routines are the most important for my application, I could also somehow modify the other features (apptrace, other small components) to use less IRAM if it is not possible to repurpose other memory.

Any suggestions on reducing IRAM usage or finding other places to store the code?

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

Re: Ran out of IRAM, possible to repurpose SRAM/DRAM?

Postby WiFive » Sun Jan 26, 2020 9:26 am

Technically yes sram1 can be used as iram but unsupported

p-rimes
Posts: 89
Joined: Thu Jun 08, 2017 6:20 pm

Re: Ran out of IRAM, possible to repurpose SRAM/DRAM?

Postby p-rimes » Fri Jan 31, 2020 5:50 pm

Hi WiFive,

Thanks for that tip! I was hoping that was the case. Now I'm investigating whether that IRAM (in SRAM0 or SRAM1) can be accelerated via the cache. Based on the TRM, I think that there is no icache, only dcache. (So, SRAM1 should be just as fast as SRAM0, if I repurpose it for instruction code). Does that match your understanding?

ESP_Sprite
Posts: 9027
Joined: Thu Nov 26, 2015 4:08 am

Re: Ran out of IRAM, possible to repurpose SRAM/DRAM?

Postby ESP_Sprite » Sat Feb 01, 2020 9:14 am

FWIW, all internal memory is zero-cycle; there's no possibility to accelerate it using cache as it already is extremely fast. For external memory (flash/spiram), the cache is shared: both instructions as well as data end up in the same cache.

l.wuyts
Posts: 7
Joined: Wed Mar 24, 2021 12:48 pm

Re: Ran out of IRAM, possible to repurpose SRAM/DRAM?

Postby l.wuyts » Thu Apr 01, 2021 8:53 am

I'm having the exact same issue and I would like to try expanding the IRAM section as well.
How did you do this? Are there any drawbacks from doing this?

Laurens

Who is online

Users browsing this forum: Majestic-12 [Bot] and 68 guests