Problems with HAL_I2S_Receive_IT
I need to receive I2S from from a device which digitises microphone audio and acts as an I2S master
I have use the STM32 Cube configuation tool to set I2S3 as a Half-Duplex Slave
When I call
HAL_I2S_Receive_IT()
I the code receives the callback into
void SPI3_IRQHandler(void)
And I use this to update some buffer pointers, before calling HAL_I2S_Receive_IT() again, to continue to receive the audio stream.
However even though the I2S master is still sending data, which I have verified using a logic analyser on the I2S bus.
void SPI3_IRQHandler(void) is not called again.
I looked to see if I needed to clear any flags which were perhaps preventing subsequent calls to the ISR,but I can't see anything in the I2S HAL to do this, and I don't know even whether that is the cause of the problem
Effecively I'm calling HAL_I2S_Receive_IT() from inside the SPI3_IRQHandler() ISR, and I don't know whether that is not allowed?
Or whethere is something else I need or do after the callback.
Also.
There seem to be 2 different non-blocking I2S receieve, and transmit, functions
HAL_I2S_Receive_IT() and HAL_I2S_Receive_DMA()
The "DMA" version does not not include "IT" in its function title, but I presume that there must be an interrupt generated when the DMA transfer is complete ???
Which one of these 2 functions should I be using for non-blocking reception of I2S data as a slave device ?
And does anyone have any idea's why I'm only getting an interrupt in response to the first call to HAL_I2S_Receive_IT()