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

greengnu
Posts: 66
Joined: Wed May 08, 2019 8:45 pm

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

Postby greengnu » Tue Aug 05, 2025 9:31 am

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?

MicroController
Posts: 2672
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Tue Aug 05, 2025 1:13 pm

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.

Who is online

Users browsing this forum: Qwantbot and 3 guests