Hello,
I am setting up a Zephyr project using custom hardware with the nRF52840 microcontroller. I am working from the Echo example (ncs/v2.5.0/zephyr/samples/drivers/i2s/echo/src/main.c), however, my application is TX direction only. My audio code is running in its own thread. I am setting up control signals (Start/stop audio, select audio to play) from separate threads and passing them in using a message queue.
At this point, I am able to pass in a Play Audio signal, and I can see that I2S clocks start operating and clock out data. Then, I get an error in my logs: "<err> i2s_nrfx: Next buffers not supplied on time".
I want my audio thread to supply a block of audio data to the I2S peripheral, then yield so other threads can run. I would like to have my audio thread wake up when the I2S peripheral signals that the next buffers are needed. I've found that the old nrfx SDK has a signal for this: NRFX_I2S_STATUS_NEXT_BUFFERS_NEEDED. However, I don't see any mention of this in the Zephyr I2S Echo example.
How do I detect the NRFX_I2S_STATUS_NEXT_BUFFERS_NEEDED in Zephyr with the new SDK?
Or, if this is not the right signal for Zephyr, how do I detect that I need to send the I2S peripheral the next buffers, and wake up my audio thread to execute that work?