Skip to content

make SPIRAM optional#116

Open
Lukaswnd wants to merge 13 commits into
esphome-libs:mainfrom
Lukaswnd:main
Open

make SPIRAM optional#116
Lukaswnd wants to merge 13 commits into
esphome-libs:mainfrom
Lukaswnd:main

Conversation

@Lukaswnd

@Lukaswnd Lukaswnd commented Apr 9, 2026

Copy link
Copy Markdown

Added the HUB75_EXTERNAL_FRAMEBUFFERS flag, which defaults to 0, except for the ESP32 P4.
When HUB75_EXTERNAL_FRAMEBUFFERS == 1, the Framebuffer(s) is/are allocated in the SPIRAM, this also works in the gdma and i2s implementation.
If the Flag is set to 1, even though the SOC does not even support SPIRAM it's set to 0 and a compile warning is logged.

Also I did not see a reason why the i2s implementation for the esp32 should be limited to 10mhz. I set it to 20mhz and it works great for me.

And I fixed the parlio implementation for the C6 - or SOCs with don't support parlio tx loop transmission (SOC_PARLIO_TX_SUPPORT_LOOP_TRANSMISSION). It's not true dma any more, because it uses a callback once the transmission is done and restarts it (multiple times per second).

I tested everything with HUB75_EXTERNAL_FRAMEBUFFERS == 1and HUB75_EXTERNAL_FRAMEBUFFERS == 0 except the S2 stuff, because I don't own one. I tested it with pioarduino in an Arduino Project with fast moving Text on a 128x64 and 64x32 panel. I did not test the IDF related stuff, which I think is only the Kconfig file. What I can say about it:
ESP32 does not support DMA from the SPIRAM, so it does not work at all, display stays empty.
ESP32S3 works as expected, I had to reduce the speed to 8 mhz, because of the limited SPI bandwith and other modules like wifi also using it.
ESP32P4 works as expected, the framebuffer takes up a lot of memory though.
ESP32C6 works, but not that great. I see a lof of ghosting but my bad setup for the C6 could be the reason for that, or the general Situation with the C6 not having looping transmissions.

Edit: since I only Build Arduino Projects, I also did not test the latest IDF v6.

@stuartparmenter

Copy link
Copy Markdown
Collaborator

Thanks for submitting - have been wanting to get psram buffers in for s3 for a while. I suspect clock rate is pretty different between octal and quad setups. I'll go through the psram/c6/clock rate changes here when I get a chance over the next few days.

@stuartparmenter stuartparmenter self-assigned this Apr 9, 2026
@mattdchap

Copy link
Copy Markdown

Are you saying we might be able to use PSRAM for the buffers on an Octal S3? This would be great as I'm trying to drive 3-panels but running out of SRAM memory.

@stuartparmenter

Copy link
Copy Markdown
Collaborator

I suspect so, should be fast enough. I'll try to get this reviewed and tested in the next few days, haven't had enough time in front of actual hardware the last few weeks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants