Skip to main content
Poul-Erik
Associate
May 3, 2021
Question

How to inform about a found error in "HAL_DFSDM_ChannelDeInit".

  • May 3, 2021
  • 3 replies
  • 1136 views

Processor stm32H750. stm32CubeMx ver. 6.2.1.

When calling "HAL_DFSDM_ChannelDeInit" and "HAL_DFSDM_FilterDeInit".

and then call "HAL_DFSDM_FilterInit" and "HAL_DFSDM_ChannelInit" the "__HAL_RCC_DFSDM1_CLK_ENABLE" is not called. (Result not clock for the filter). The problem is in "stm32h7xx_hal_msp.c" related to variable "HAL_RCC_DFSDM1_CLK_ENABLED" not counted down when disable is called.

br. Poul-Erik.

This topic has been closed for replies.

3 replies

ST Technical Moderator
May 17, 2021

Hello @Poul-Erik​,

Thanks for your post and reported issue in the Community.

I added the topic "STM32CubeMX" to your question in order to increase its chance to be reviewed by our CubeMx experts.

Hello @Houda GHABRI​ , @Khouloud OTHMAN​ , @Khouloud ZEMMELI​ ,

Can you please check and confirm this issue related to CubeMX version 6.2.1?

Imen

Thanks

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Khouloud ZEMMELI
ST Employee
May 18, 2021

Hello @Poul-Erik​ 

Could you please give me more details about the problem?

Is there a missed call ( HAL_RCC_DFSDM1_CLK_ENABLE as I understood ) in the code generated from CubeMX? If yes, could you please specify exactly where the code has been forgotten (Did you expect to have this call in the DeINIT function)?

Thanks, Khouloud

Poul-Erik
Poul-ErikAuthor
Associate
May 18, 2021

When I call "HAL_DFSDM_ChannelInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)" for the first every thing works fine.

When I wnat to chane setting:

Step 1: shut down DFSDM

    if ((HAL_DFSDM_ChannelDeInit(&hdfsdm1_channel0) != HAL_OK) || (HAL_DFSDM_ChannelDeInit(&hdfsdm1_channel1) != HAL_OK))

      Error_Handler();

    if ((HAL_DFSDM_FilterDeInit(&hdfsdm1_filter0) != HAL_OK) || (HAL_DFSDM_FilterDeInit(&hdfsdm1_filter1) != HAL_OK))

      Error_Handler();

Step 2: Change settings

    hdfsdm1_filter0.Init.FilterParam.Oversampling = Oversampling;

    hdfsdm1_filter1.Init.FilterParam.Oversampling = Oversampling;

Step 3: Restart DFSDM (This don't work, because "HAL_DFSDM_FilterInit" dont't call HAL_RCC_DFSDM1_CLK_ENABLE, because a wrong value of "*channelCounterPtr")

    if ((HAL_DFSDM_FilterInit(&hdfsdm1_filter0) != HAL_OK) || (HAL_DFSDM_FilterInit(&hdfsdm1_filter1) != HAL_OK))

    {

      Error_Handler();

    }

    if ((HAL_DFSDM_ChannelInit(&hdfsdm1_channel0) != HAL_OK) || (HAL_DFSDM_ChannelInit(&hdfsdm1_channel1) != HAL_OK))

    {

     Error_Handler();

    }

    if ((HAL_DFSDM_FilterConfigRegChannel(&hdfsdm1_filter0, DFSDM_CHANNEL_0, DFSDM_CONTINUOUS_CONV_ON) != HAL_OK) ||

      (HAL_DFSDM_FilterConfigRegChannel(&hdfsdm1_filter1, DFSDM_CHANNEL_1, DFSDM_CONTINUOUS_CONV_ON) != HAL_OK))

    {

     Error_Handler();

    }

It is easy ro reproduce: Init for the first time, deinit, and the init. The clock is missing so the writing to the registers won't work.

Best regards Poul-Erik Hansen.