Page 1 of 1

ESP32-P4 is it possible to asynchronously fill a buffer with a repeating sequence using GDMA?

Posted: Tue Aug 05, 2025 9:31 am
by greengnu
So some of the esp32 SOCs suppor asynchronous memcopy using GDMA https://docs.espressif.com/projects/esp ... emcpy.html

but this requires to copy a full buffer to another buffer.

Let's say I want to fill a big buffer with a repeating sequence of the same 4 bytes (for example clearing a frame buffer to a specific color). I could issue a separate esp_async_memcpy for each 4 byte sequence, but that kinda defeats the purpose and I feel like the GDMA hardware should probably have a way to do this with a single asynchronous call.

Is there a way to do this? if not, is it maybe possible using bitscrambler on the P4?

Re: ESP32-P4 is it possible to asynchronously fill a buffer with a repeating sequence using GDMA?

Posted: Tue Aug 05, 2025 1:13 pm
by MicroController
I guess hardware-wise you should be able to DMA one buffer worth of data multiple times in a row. To fill e.g. a 128kB region you could use one source buffer with, say, 1kB of data and set up a liked list of 128 DMA descriptors all pointing to the same 1kB source.

You also may be able to set up the source (transmit channel) with a looped linked list (with no eof = endless transfer) and let only the destination (receive channel) limit the transfer length to what's actually needed.