2020-03-13 08:49 AM
When using SAI for I2S, STM32CubeIDE does not give you the option to choose Mono mode. It's only option is Stereo Mode. However, STM32 SAI HAL supports both SAI_STEREOMODE as well as SAI_MONOMODE, so I think this should be an option.
2020-03-19 12:26 PM
Hello @SHamm.18 ,
Could you please share your project ? I need to know which serie and version used.
Best Regards,
Khouloud
2020-03-19 04:11 PM
I2S as a standard bus is inherently and specifically 2 channel.
From this viewpoint, what would you expect from a mono setting to do? What is your target codec?
JW
2020-03-19 05:03 PM
I am using a Nucleo-L432KC with STM32CubeIDE 1.2.0. If I enable SAI1 in I2S mode, the only option is for Output Mode is Stereo, though the SAI HAL file supports Mono mode as well.
2020-03-19 05:05 PM
I am using I2S with a mono .wav file. If I use I2S in stereo mode, the .wav file is played twice as fast. By manually changing hsai_BlockA1.Init.MonoStereoMode to mono mode in sai.c, the .wav file plays normally
2020-03-19 11:02 PM
Well, given CubeMX is just a clicking configurator to Cube, if there's a working setup in Cube, it probably should be settable in CubeMX.
Nevertheless, I was still curious, what does that mean from I2S point of view. but reading the I2S chapter in RM, it's probably just setting the SAI_xCR1.MONO bit, which in Tx duplicates slot 0 data into slot 1 in hardware, and in Rx discards slot 1 data (this ought to be borne in mind when using this feature for Rx).
JW
2020-03-21 03:06 AM
That MONO bit is a really nice option if one needs to work with mono streams, because then you don't have to waste CPU and RAM on repacking that unnecessary second channel. :)
2020-03-23 01:59 AM
Hello @SHamm.18 , You're right, issue confirmed and it will be fixed.
Best Regards,
Khouloud
2021-11-05 08:34 AM
Where do I find this bit on STM32F411?
2021-11-05 09:05 AM
STM32F411 does not have the SAI interface.
JW