Solved
Bug: HAL_DeInit() causes the STM32H7 microprocessor to reset.
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
