tulipcc icon indicating copy to clipboard operation
tulipcc copied to clipboard

CONFIG_SPIRAM_FETCH_INSTRUCTIONS and CONFIG_SPIRAM_RODATA eat up PSRAM

Open bwhitman opened this issue 1 year ago • 2 comments

on CC, we were using

CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y

Which eats up about 3.5MB of SPIRAM. (Basically putting the entire firmware in SPIRAM)

The reason we do this is because it helps us write to the screen while SPI-heavy things are happening (writes to flash, OTA, wifi operations). With these off, you get extra RAM but see glitches in the display while these operations run. From the ESP docs:

image

We should figure out how to balance this -- we could move our AMY presets and other const vars to a separate partition and keep code in SPIRAM. We could also decide the glitches are not that important to avoid. Worth some testing.

For now, I will set them OFF and watch the glitches.

bwhitman avatar Feb 18 '24 02:02 bwhitman

(Also wonder if just having FETCH_INSTRUCTIONS on but RODATA off helps us keep the size down and mitigates glitches. We don't store any RODATA afaik besides AMY patches/PCM samples. Oh, and fonts.)

bwhitman avatar Feb 18 '24 02:02 bwhitman

Doing wifi ops does "jiggle" the screen with this setting as it currently is. It's not that annoying to me. It's worst when doing OTA updates, as it downloads ~4MB and writes to flash. One option we have is to put the AMY patches in /sys/ as a binary blob (or just having them in a separate partition). I will look into this but won't make this a requirement for r10 release as i do not believe the jiggles to be a real problem. Sort of zx spectrum vibes

bwhitman avatar Mar 21 '24 13:03 bwhitman

I'm going to keep this on. With a 2MB heap for MP, we can run all the music apps and there's still 540KB left over for things. I'm going to be making some memory optimizations later, but i think we should leave this on as it impacts speed in #198 .

bwhitman avatar May 26 '24 20:05 bwhitman