cancel
Showing results for 
Search instead for 
Did you mean: 

Why is PDM2PCM not enabled for STM32G4 in CUbeMX?

victagayun
Senior III

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

Why is that so?

1 ACCEPTED SOLUTION

Accepted Solutions
victagayun
Senior III

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

View solution in original post

4 REPLIES 4
TDK
Guru

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".

Thank you for the answer.

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

victagayun
Senior III

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

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