cancel
Showing results for 
Search instead for 
Did you mean: 

Getting stuck in init functions, but no error handler loop.

Aaronium
Associate III

Hello!

I am writing a program and am still on the code generation phase. I am having a weird issue where the code runs, but gets stuck in the initialization phase for the SDIO (MX_SDIO_SD_Init). If the SDIO is commented out, the program gets stuck in the ADC1 init (MX_ADC1_Init), and so on. Oddly, when stepping through the functions, the actual function isn't called, it just stays stuck at the call function (as in it will stay on line 30 for the MX_SDIO_SD_Init, and not jump to another function to begin the init process). What am I doing wrong?

Thank y'all in advance.

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();
	MX_DMA_Init();
	MX_CAN1_Init();
	MX_SPI1_Init();
	MX_TIM10_Init();
	MX_USART1_UART_Init();
	MX_SDIO_SD_Init();
	MX_ADC1_Init();
	MX_ADC2_Init();
	MX_I2C1_Init();
	MX_TIM6_Init();
	MX_TIM7_Init();
	MX_USART2_UART_Init();
	MX_TIM11_Init();
	/* USER CODE BEGIN 2 */
	HAL_TIM_Base_Start(&htim11);
	HAL_TIM_Base_Start_IT(&htim11);
	HAL_TIM_Base_Start(&htim10);
	HAL_TIM_Base_Start_IT(&htim10);
	HAL_TIM_Base_Start(&htim7);
	HAL_TIM_Base_Start_IT(&htim7);
	HAL_TIM_Base_Start(&htim6);
	HAL_TIM_Base_Start_IT(&htim6);
 
	/* USER CODE END 2 */
 
	/* Infinite loop */
	/* USER CODE BEGIN WHILE */
	while (1)
	{
		/* USER CODE END WHILE */
 
		/* USER CODE BEGIN 3 */
	}
	/* USER CODE END 3 */
}

1 ACCEPTED SOLUTION

Accepted Solutions
Aaronium
Associate III

It was resolved by restarting the IDE and microcontroller, and then reconfiguring the clock in the .ioc file, don't know why but now it works.

View solution in original post

1 REPLY 1
Aaronium
Associate III

It was resolved by restarting the IDE and microcontroller, and then reconfiguring the clock in the .ioc file, don't know why but now it works.