Skip to main content
Senior III
June 17, 2026
Question

Systick Interrupt handler not executed and gets reset if any interrupt is enabled

  • June 17, 2026
  • 4 replies
  • 34 views

I have used the HAL_Delay function as below, the micro is stm32g474ret6.

while (1)
{
/* USER CODE END WHILE */

/* USER CODE BEGIN 3 */
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, SET);
HAL_GPIO_WritePin(Buzzer_GPIO_Port, Buzzer_Pin, RESET);
HAL_Delay(1000);
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, RESET);


}
/* USER CODE END 3 */
}

The problem is the code always struck in the HAL_Delay function 

 

with uwTick always returning 0. The systick interrupt handler is not called. 

Another observation if i enable the timer1 interrupt (i assume enable any interrupt) the code is reset. I generated the PWM using timer1 without interrupts. 

What is the problem when i enable interrupts how do i check it? Is it something to do with the Interrupt vector table.

4 replies

STuser2Author
Senior III
June 17, 2026

This is my CubeMX project for reference, request to please suggest resolving the issue.

Ozone
Principal
June 18, 2026

> The systick interrupt handler is not called. 

Are you sure, i.e. had you set a breakpoint in the handler ?

I ask because the main loop of you code does not do what you probably think it does.
After the 1000ms delay you reset the LED, and then immediately set it.
A human eye is not capable of detecting events of a few microsend duration, the LED appears to be always on.

 

 

STuser2Author
Senior III
June 18, 2026

Yes i have set the break point

The program does not halt. Is it related to hardware or software to find the root cause.

STuser2Author
Senior III
June 18, 2026

These are the settings when i read from the stlink utility

Below are the option byte settings

 

Anything wrong with them please advise.

Ozone
Principal
June 18, 2026

I don’t use CubeIDE, but the settings look ok to me.

When you start debugging, does the IDE download and verify your application successfully ?

Does it stop on “main()”, as supposed ?

STuser2Author
Senior III
June 18, 2026

Yes it does stops at main(). 

 

when i step over the Timer

HAL_TIM_Base_Start_IT(&htim1); it resets and also systick handler does not happen. I verified the systick handler without the timer interrupt as well.