cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H SAI setting for 8-PDM microphones

YKiku.2
Associate

I would like to know how we can configure STM32H7's SAI(s) for 8-PDM microphone inputs (LR * 4 pairs). (16kHz sampling rate).

It seems MX allows us 6 mic with SAI1 and 2 mics with SAI4 but I'm not sure how we can set SAI1/4 exactliy for 8 mics (synchronized data acquisition I want)

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @YKiku.2​ ,

First let me welcome you to the STM32 Community and apologize for the late reply :smiling_face_with_smiling_eyes:

Thank you for having reported.

Actually, the Serial audio interfaces (SAI) documentation is a bit confusing and not clear enough, this was already reported internally to review SAI chapter in STM32H7 reference manual so that it will be aligned with real implementation of the peripheral.

Meanwhile, backing to STM32H742, STM32H743/753 and STM32H750 Reference Manual > 51.3 SAI implementation, Table 417. STM32H743/753/745/755/747/757 SAI interfaces, there is a note indicating that SAI1 & SAI4 instances have only up to 3 D input signals. So, these SAI instances can connect up to 6 microphones:

0693W00000Ba2VvQAJ.png 

In order to use 8-PDM microphones, you can configure two SAI in PDM mode (One with 6 mic, one with 2).

Note that some clock/data pins for the SAI1/SAI4 are shared (taking the STM32H742xI/G STM32H743xI/G devices for example):

  • SAI1_CK1 and SAI4_CK1 are on PE2
  • SAI1_D1 and SAI4_D1 is on PB2, PC1, PD6, PE6
  • SAI1_D2 and SAI4_D2 is on PE4
  • SAI1_D3 and SAI4_D3 is on PC5 and PF10

which unfortunately limits the usability of the SAI-PDM feature.

0693W00000Ba30tQAB.jpgFurther details about pin mapping are in Data Sheet > Table 9. Pin/ball definition.

Also, you can refer to the Interfacing PDM digital microphones using STM32 MCUs and MPUs Application note. It provides guidelines and examples based on STM32CubeMX and shows how to properly configure the STM32 device to acquire and handle raw data from the microphones in order to transform this raw data into standard data for audio. 

Moreover, a faulty number of microphone pairs will be displayed by STM32CubeMX in SAI4 Configuration Panel > Parameter Settings window tab > SAI A > Mic Pairs Nbr (3 instead of 1), when configuring SAI1-A to "PDM using Microphones pairs(1-2) and CK1 as clock" with a maximum number of Microphones pairs (5-6):

0693W00000Ba3AZQAZ.png 

This error in the CubeMX tool will be reported internally to be fixed. I'll keep you posted with the updates.

I hope this clarifies the situation and bring some help for you to create your project. Otherwise, feel free to raise any feedback/issue.

Even though this reply doesn’t directly solve the issue, I’m marking it as Best, since it will help clarify the current situation for other customers with the same question. I will post an update here once the issue has been fixed.

Khouloud.

View solution in original post

1 REPLY 1

Hello @YKiku.2​ ,

First let me welcome you to the STM32 Community and apologize for the late reply :smiling_face_with_smiling_eyes:

Thank you for having reported.

Actually, the Serial audio interfaces (SAI) documentation is a bit confusing and not clear enough, this was already reported internally to review SAI chapter in STM32H7 reference manual so that it will be aligned with real implementation of the peripheral.

Meanwhile, backing to STM32H742, STM32H743/753 and STM32H750 Reference Manual > 51.3 SAI implementation, Table 417. STM32H743/753/745/755/747/757 SAI interfaces, there is a note indicating that SAI1 & SAI4 instances have only up to 3 D input signals. So, these SAI instances can connect up to 6 microphones:

0693W00000Ba2VvQAJ.png 

In order to use 8-PDM microphones, you can configure two SAI in PDM mode (One with 6 mic, one with 2).

Note that some clock/data pins for the SAI1/SAI4 are shared (taking the STM32H742xI/G STM32H743xI/G devices for example):

  • SAI1_CK1 and SAI4_CK1 are on PE2
  • SAI1_D1 and SAI4_D1 is on PB2, PC1, PD6, PE6
  • SAI1_D2 and SAI4_D2 is on PE4
  • SAI1_D3 and SAI4_D3 is on PC5 and PF10

which unfortunately limits the usability of the SAI-PDM feature.

0693W00000Ba30tQAB.jpgFurther details about pin mapping are in Data Sheet > Table 9. Pin/ball definition.

Also, you can refer to the Interfacing PDM digital microphones using STM32 MCUs and MPUs Application note. It provides guidelines and examples based on STM32CubeMX and shows how to properly configure the STM32 device to acquire and handle raw data from the microphones in order to transform this raw data into standard data for audio. 

Moreover, a faulty number of microphone pairs will be displayed by STM32CubeMX in SAI4 Configuration Panel > Parameter Settings window tab > SAI A > Mic Pairs Nbr (3 instead of 1), when configuring SAI1-A to "PDM using Microphones pairs(1-2) and CK1 as clock" with a maximum number of Microphones pairs (5-6):

0693W00000Ba3AZQAZ.png 

This error in the CubeMX tool will be reported internally to be fixed. I'll keep you posted with the updates.

I hope this clarifies the situation and bring some help for you to create your project. Otherwise, feel free to raise any feedback/issue.

Even though this reply doesn’t directly solve the issue, I’m marking it as Best, since it will help clarify the current situation for other customers with the same question. I will post an update here once the issue has been fixed.

Khouloud.