Skip to main content
EDeYo.1
Associate II
April 10, 2020
Solved

Multi-Channel I2S Hardware Design on an STM32F413/423

The microcontroller will be doing little else besides some very light processing on the audio data. The I2S source has a single MCK, SCK, WS, and 4 stereo outputs (3 of which will be used), and the I2S source can ONLY function as a master device, leaving me to use the STM32 as a slave. I see that there is a CKIN pin for I2S labelled as I2S2_CKIN. Looking at the clock routing diagram in the datasheet, it looks like that can be routed to the I2SPLL before being distributed back to I2S peripherals (1,4,5 as well as 2,3). I'll likely provide that as an option in hardware so that I can choose between the external I2S clock input or using the HSI/HSE clock. My question lies in the fact that all of the I2S data channels share WS and SCLK signals. Do I need to buffer/split these signals to go to each peripheral instance, or is there a way that they can be synced between peripherals in firmware? I don't see the mechanism to do it right off the bat in firmware, but looking for someone who may have run into the same issue!

Thanks!

This topic has been closed for replies.
Imen.DBest answer
ST Technical Moderator
December 22, 2021

Hello @Community member​ 

Thank you for bringing these posts to my attention, and sorry for the delayed reply on this as I was on vacation.

I need to know for which product to be more specific. So, I can just give general Inputs:

The kernel clock if needed does not need to be synchronous or frequency accurate like for the master mode. In some devices (generally old IPs) the kernel clock may still be requested. In those cases, there is generally a minimum frequency ratio to respect w.r.t. the serial bitclock.

I'll make sure to post more details here as soon as I hear back from our team.

Hello @EDeYo.1​ ,

If you are using SPI/I2S blocks in slave mode, as far as I know, there is no way to synchronize those IPs internally. The WS provided by the external audio device must be distributed to the WS input of each SPI/I2S block. The same applies for SCK signal.

The STM32F413/423 also embed a SAI, it can help you to save 2 IOs, but with the cost of using a SAI and one SPI/I2S. The SAI contains 2 sub-block, and they can share their WS and SCK.

Note that there is only one SAI, and if you need a third I2S link then an SPI/I2S is needed as well.

Also the SAI can handle multi-channel, if it is supported by your external audio codec, you may save IOs. Handling is maybe a bit more complicated, but it really depends on the application.

Hope my answer helped you!

Thanks

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks

11 replies

waclawek.jan
Super User
December 27, 2021

Hi Imen,

Thanks for the answer.

Jan

@Imen DAHMEN​