2022-12-27 07:23 PM
I just make a simple test. My cpu is stm32F303VET6,. Use Stm32cubeMx to generate a simple project with few lines of code, like:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
But everytime when it runned to MX_GPIO_Init(), then it was dead. And i found it hanged in HardFault_Handler(void). why?
2022-12-27 07:36 PM
Look at the instructions and registers at the point it faulted.
2022-12-27 08:56 PM
Upload your ioc file
2022-12-27 09:08 PM
2022-12-27 09:31 PM