Skip to main content
victagayun
Senior III
Apr 3, 2022 5:02 PM UTC
Solved

Why is PDM2PCM not enabled for STM32G4 in CUbeMX?

I am trying to add PDM2PCM for STM32G4 in CubeMX/IDE, but I cannot add it.

Why is that so?

This topic has been closed for replies.
victagayun
victagayunBest answer
Senior III
Apr 4, 2022 2:51 AM UTC

I have added manually the library in G474 so far it is working.

It is almost the same as what I have done here https://github.com/VictorTagayun/STM32_PDM-to-PCM-Processing

You also need to enable CRC like what is needed in F4/F7/H7 series.

 hcrc.Instance = CRC;
 hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
 hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
 hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
 hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
 hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
 if (HAL_CRC_Init(&hcrc) != HAL_OK)
 {
 Error_Handler();
 }

4 replies

TDK
Apr 3, 2022 5:33 PM UTC

PDM2PCM appears to be written for the F4/F7/H7 series, per the manual.

STM32Cube PDM2PCM software library for the STM32F4/F7/H7 Series

https://www.st.com/resource/en/user_manual/um2372-stm32cube-pdm2pcm-software-library-for-the-stm32f4f7h7-series-stmicroelectronics.pdf

"If you feel a post has answered your question, please click ""Accept as Solution""."
victagayun
Senior III
Apr 3, 2022 11:36 PM UTC

Thank you for the answer.

I was wondering why it is only available for F4/F7/H7 series.

victagayun
victagayunAuthorBest answer
Senior III
Apr 4, 2022 2:51 AM UTC

I have added manually the library in G474 so far it is working.

It is almost the same as what I have done here https://github.com/VictorTagayun/STM32_PDM-to-PCM-Processing

You also need to enable CRC like what is needed in F4/F7/H7 series.

 hcrc.Instance = CRC;
 hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
 hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
 hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
 hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
 hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
 if (HAL_CRC_Init(&hcrc) != HAL_OK)
 {
 Error_Handler();
 }

DMoim.1
Associate
Dec 27, 2022 9:24 AM UTC

I've done the same on L432KC and seems working. Why not enabling PDM2PCM library on other MCUs with same core (M4F) and required capabilities (CRC)? Is there a place where to ask to do this (e.g. Github repo of L4 and G4 fw?).

Thanks