Hello.
The TRM seems to imply that one can create a buffer in PSRAM memory, and use EDMA to send out via the I2S peripheral (for parallel output LCD mode).
However, any attempts I try produce garbage output when any of the buffer is allocated to the ESP32-S2's PSRAM.
What is this the case? The TRM seems to imply this is possible. However, I have not been able to find any examples.
ESP32-S2 External RAM / PSRAM + I2S LCD + DMA
Re: ESP32-S2 External RAM / PSRAM + I2S LCD + DMA
You can allocate critical buffers that require high-speed access in internal SRAM instead of PSRAM. You can use PSRAM for less critical data that doesn’t need high-speed access.
Re: ESP32-S2 External RAM / PSRAM + I2S LCD + DMA
I don't want to use the SRAM. I want to use the PSRAM.
The TRM says you can use it for I2S and LCD output, but I there's no guidance anywhere on how to achieve this in code.
The TRM says you can use it for I2S and LCD output, but I there's no guidance anywhere on how to achieve this in code.
-
- Posts: 9307
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S2 External RAM / PSRAM + I2S LCD + DMA
It should just work like internal RAM, with the exception that your memory needs to be aligned to the cache line size of the psram cache. Also, you need to make sure data is not stuck in that cache, as the CPU reads/writes from cache while DMA interacts directly with the underlying PSRAM; this means that you'll need to flush the cache for the data memory before starting the DMA transfer. Also note that DMA descriptors can only be in internal RAM.
Re: ESP32-S2 External RAM / PSRAM + I2S LCD + DMA
Thanks ESP_Sprite.
If I used say the esp-camera example (https://github.com/espressif/esp32-camera) and re-write it to be an LCD output instead, do you think that could potentially do the trick? I see a bunch of PSRAM data alignment stuff in this code.
If I used say the esp-camera example (https://github.com/espressif/esp32-camera) and re-write it to be an LCD output instead, do you think that could potentially do the trick? I see a bunch of PSRAM data alignment stuff in this code.
-
- Posts: 9307
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S2 External RAM / PSRAM + I2S LCD + DMA
Erm, possibly? It certainly has a lot of the components you'd need.
Re: ESP32-S2 External RAM / PSRAM + I2S LCD + DMA
I created a working example for 24 bit parallel LCD output on the esp32s2 that uses the internal SRAM for the DMA buffer.
However, if I attempt to use MALLOC_CAP_SPIRAM as the DMA buffer source, it does not matter what settings I try, the device sends garbage out across all the mapped GPIOs that does not resemble the buffer data in any way. No settings seem to change this behaviour.
https://github.com/mrcodetastic/esp32s2 ... /tree/main
@Sprite, any possibility you could eye-ball to see what could be going wrong?
Specifically: https://github.com/mrcodetastic/esp32s2 ... el_dma.cpp
Any help appreciated.
However, if I attempt to use MALLOC_CAP_SPIRAM as the DMA buffer source, it does not matter what settings I try, the device sends garbage out across all the mapped GPIOs that does not resemble the buffer data in any way. No settings seem to change this behaviour.
https://github.com/mrcodetastic/esp32s2 ... /tree/main
@Sprite, any possibility you could eye-ball to see what could be going wrong?
Specifically: https://github.com/mrcodetastic/esp32s2 ... el_dma.cpp
Any help appreciated.
Who is online
Users browsing this forum: No registered users and 151 guests