A problem and solution for hardfault caused by uint64_t pointer access during Flash operation in STM32 1. Description of the problem In a project using STM32G4, I encountered a problem because of the operation function of Flash: HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data); You need to use the uint64_t pointer to access the data […]
Tag: dfa
[Solved] STM32 hardware error HardFault_Handler
After writing the code, run to this sentence MyInit.Peripheral_Set(); and enter HardFault_Handler. Reason: open the interrupt first, then initialize the clock MyInit.Peripheral_Set(); /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_TIM6_Init();