cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F469I-DISCO CS43L22 Audio Codec

Kneepatch
Senior

Hi! I am trying to generate a sine wave on my CS43L22 audio codec chip and use the included stereo jack on my STM32F469I-DISCO board. I'm using the STM32Cube IDE. There is one .WAV player example that I can't get to build in the IDE that's closely related to what I want to do, but it doesn't use STMCube. The closest project that I found on the internet is something like this, but it's running on a different board and uses I2S instead of SAI:

STM32F4 Discovery board - Keil 5 IDE with CubeMX: Tutorial 28 - I2S Audio Codec - CS43L22 - YouTube

Based on my research, I think the process of getting this running looks something like this:

  1. Assign pins in STMCube for Audio Reset, I2C2 (chip config), and SAI1 (clock)
  2. Configure I2C2 and SAI1 in STMCube
  3. Write code to utilize the chip

Any resources, advice, or examples that I can look at? Much appreciated!

1 REPLY 1
Kneepatch
Senior

OK, so I finally got audio to output on the chip. However, I don't know if it's possible to play a different stream on the left and right headphones without using a .WAV file. I say that because the function that you call only allows you to point to one buffer:

uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size)

I get the same sound on both sides L and R. Is it possible to assign a separate buffer to L and R so you can play a different sound on the Left and right side of a speaker / headphones?