cancel
Showing results for 
Search instead for 
Did you mean: 

EXTI, while(1) use stoping

Minseo Kim
Associate II
Posted on July 23, 2017 at 13:02

I use STM32F103C3

void EXTI9_5_IRQHandler(void)

{

  /* USER CODE BEGIN EXTI9_5_IRQn 0 */

 while(1){

  HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_10);

  HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_11);

  HAL_Delay(1000);

 }

  /* USER CODE END EXTI9_5_IRQn 0 */

  HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_6);

  /* USER CODE BEGIN EXTI9_5_IRQn 1 */

  /* USER CODE END EXTI9_5_IRQn 1 */

}

that is not recycle,

I use interrupt, so toggle mode just one, not anymore working....

4 REPLIES 4
Posted on July 23, 2017 at 22:20

Hello !

1. The 'while(1)' is fatal for your handler

2. Use this before your loop.

__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);

Be aware also with HAL_Delay(1000);  inside your handler.

What do you want to do?

Posted on July 24, 2017 at 03:38

Thank you answer my question

This problem is delay priority high then EXTI , so stuck function

you know, how to setting priority timer and EXTI ?

Posted on July 24, 2017 at 10:01

hi!

Take a look ffirst  inside HAL_Init() function to see the Interrupt Group Priority

You can call to set your priority.

HAL_NVIC_SetPriority(SysTick_IRQn, X, Y);

 HAL_NVIC_SetPriority(EXTI9_5_IRQn, X, Y);

If 'Delay priority '  is lower than Exti priority then  delay will stuck.

Posted on July 25, 2017 at 03:25

Oh Thank you, my problem solve