Page 1 of 1

using i2s with psram

Posted: Tue Sep 15, 2020 1:18 pm
by trapozac
Hi,
i wrote a program that uses i2s 8bit parallel single channel in lcd mode.Data transfered with DMA. Now i want to use psram because internal ram of the esp32 is not enough. But psram could not use for a DMA allocation.
How can i use i2s to transfer data from psram?
ıf psram can be used without DMA, how can i use it?
Thank you all in advance.

Re: using i2s with psram

Posted: Wed Sep 16, 2020 8:00 am
by ESP_Sprite
Sorry, external memory can't be used for DMA on the ESP32. (It will be in future chips; I don't recall if the -S2 can already do that.) You need to add a buffer in internal memory that is DMA'able, and use memcpy to move data from/to that buffer, then use I2S to read from that buffer.

Re: using i2s with psram

Posted: Wed Sep 16, 2020 2:29 pm
by trapozac
Can i use i2s without DMA

Re: using i2s with psram

Posted: Wed Sep 16, 2020 5:41 pm
by PeterR
I2C does not need DMA.
Obviously things get a bit more tricky CPU performance, latency & interrupts etc wise if you do not DMA.

Can I ask why you think you do not have enough internal memory? My understanding is that even task stacks may be placed in PSRAM now which allows you to have pretty much all the ESP SRAM. That would seem preferable over not using DMA and then other interrupts etc taking a slice out of your non DMA I2C.
That said I have not looked hard at the ESP buses & especially how other peripheral DMA might affect.

Re: using i2s with psram

Posted: Thu Sep 17, 2020 8:14 am
by ESP_Sprite
Peter: The subject is I2S here, not I2C.

trapozac: There is no documented way to have I2S not use DMA. Suggest you use the copy-to-internal-memory trick I suggested.