How to get an I2S DMA TX Complete Callback similar to HAL in STM32 on ESP32?

I have some Wavetable Oscillators that I’m porting from my project in STM32F303 because of this whole chip-shortage situation and was looking into the ESP32, I trawled through some examples and it seems that using IDF this should be possible however I couldn’t get my hands on anything concrete. My use case is as follows:

  1. Allocate memory for circular TX Buffer, set up I2S, run my “fillBuffer()” DDS routine.
  2. Start I2S DMA transmission using TX Buffer.
  3. Get callback on DMA_TX Half Complete. Update the first half of buffer using my"fillBuffer()" DDS routine , while DMA writes out the 2nd half.
  4. Get callback on DMA_TX Complete. Update the 2nd half of the buffer “fillBuffer()” DDS routine, while DMA writes out 1st half.
  5. Repeat.

I have found some use cases using FREERTOS tasks, but I am a n00b in terms of RTOS and honestly couldn’t make much sense of it.

Have you checked Plaits’ code?

Yes. My working F303 code is mostly derived from going through your code itself. This is more of a platform specific question for the ESP32.

Oh sorry, I misunderstood your message and thought you were porting in the other direction, from ESP32 to STM32.

I’m afraid I don’t know anything about ESP32.

Hah! Thanks for your help as always. Hope you’re doing good. This chip shortage is making me pivot to a different uC. Spent the last 2 years working on this project and now it feels like its pointless :frowning: