using i2s with psram

trapozac
Posts: 4
Joined: Sun May 10, 2020 2:37 pm

using i2s with psram

Postby trapozac » Tue Sep 15, 2020 1:18 pm

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.

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

Re: using i2s with psram

Postby ESP_Sprite » Wed Sep 16, 2020 8:00 am

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.

trapozac
Posts: 4
Joined: Sun May 10, 2020 2:37 pm

Re: using i2s with psram

Postby trapozac » Wed Sep 16, 2020 2:29 pm

Can i use i2s without DMA

PeterR
Posts: 511
Joined: Mon Jun 04, 2018 2:47 pm

Re: using i2s with psram

Postby PeterR » Wed Sep 16, 2020 5:41 pm

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.
& I also believe that IDF CAN should be fixed.

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

Re: using i2s with psram

Postby ESP_Sprite » Thu Sep 17, 2020 8:14 am

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.

Who is online

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