Skip to main content
victagayun
Senior III
April 3, 2022
Solved

Why is PDM2PCM not enabled for STM32G4 in CUbeMX?

  • April 3, 2022
  • 3 replies
  • 1808 views

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.
Best answer by victagayun

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();
 }

3 replies

TDK
Super User
April 3, 2022

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
April 3, 2022

Thank you for the answer.

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

victagayun
victagayunAuthorBest answer
Senior III
April 4, 2022

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
December 27, 2022

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