cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: HAL_DeInit() causes the STM32H7 microprocessor to reset.

DOsbo
Senior

Hi All,

Calling HAL_DeInit() causes the STM32H7 micro to reset when it executes __HAL_RCC_AHB3_FORCE_RESET();

#define __HAL_RCC_AHB3_FORCE_RESET()  (RCC->AHB3RSTR=0xFFFFFFFFU)
 
HAL_StatusTypeDef HAL_DeInit(void)
{
  /* Reset of all peripherals */
  __HAL_RCC_AHB3_FORCE_RESET();   // <-- Causes CPU reset
  __HAL_RCC_AHB3_RELEASE_RESET();
.
.
.
}

I assume it is because it is writing 1's to reserved bits. Replacing the macro with the following fixes the issue:

#define __HAL_RCC_AHB3_FORCE_RESET()  RCC->AHB3RSTR |=    (RCC_AHB3RSTR_MDMARST \
| RCC_AHB3RSTR_DMA2DRST \
| RCC_AHB3RSTR_JPGDECRST \
| RCC_AHB3RSTR_FMCRST \
| RCC_AHB3RSTR_QSPIRST \
| RCC_AHB3RSTR_SDMMC1RST)

I hope this gets fixed in the next HAL release. It caused me a lot of headaches 🙂

Cheers,

David

1 ACCEPTED SOLUTION

Accepted Solutions
lutztonineubert
Associate III

Sorry. As i see, it is fixed.

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

Hello @DOsbo​ ,

We raised this issue internally for check and we will come back to you soon with update.

Thanks for your contribution.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hello @DOsbo​ ,

Thanks for your proposal.

This issue will be fixed in the coming release.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
lutztonineubert
Associate III

Sorry. As i see, it is fixed.