2021-05-03 01:54 AM
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.
2021-05-17 08:08 AM
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
2021-05-18 08:44 AM
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
2021-05-18 09:05 AM
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.