stm32F4 USB to I2S using CubeIDE DMA-I2S send bytes twice (stammers)
Hello, I try to setup a working example of UAC1.0 USB to I2S - stereo 48kHz 16 bits on a stm32F4 discovery card (with CS43L22 CODEC). I try to get the project developed as far as possible on existing code from ST:
- STM32CubeIDE generated code,
- The board Drivers/BSP code for the audio part,
- inpiration from audio stand alone examples from other F4 boards.
But this is not working correctly: bit of part of music with cracks and noises. With a Logic Analyser (LA), I looked at the I2S and it is clearly wrong. There are variants, but basically, it stammers. Instead of 0x0000, 0xDE1F, 0x0000, 0xCA... it gives something like 0x0000, 0x0000, 0xDEDE, 0xCACA, 0x0000, 0x0000. Please see attached snaposhots, with buffer content after breakpoint at usbd_audio.c Sync function, and the corresponding Logic Analyser capture. Values correspond between with Dec=> Hex conversion, except the "stammer".
I have the record and playback example working, from USB board. I normally use the same BSP and board drivers code. The I2C and CS42L22 configs are the same. The configuration of the I2S and associated DMA look the same… In that case, the LA captures are correct.
I struggle to find what could cause this. I ddin't touched the Driver/BSP code of the discovery board.
Help warmly welcomed.
JMF
