2021-05-27 09:59 AM
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)
Solved! Go to Solution.
2021-06-03 12:58 PM
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:
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):
which unfortunately limits the usability of the SAI-PDM feature.
Further 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):
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.
2021-06-03 12:58 PM
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:
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):
which unfortunately limits the usability of the SAI-PDM feature.
Further 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):
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.