Skip to main content
Visitor II
June 24, 2024
Solved

Nucleo-U545 user button falling EXTI response time very slow

  • June 24, 2024
  • 2 replies
  • 970 views

I'm using Nucleo-U545 for my project and set the external interrupt for user button as follow.

void HAL_GPIO_EXTI_Rising_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == USER_BUTTON_Pin) {
  HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin);
  printf("*button pressed\n");
}
}
 
void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin)
{
  if(GPIO_Pin == USER_BUTTON_Pin) {
  HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin);
  printf("*button released\n");
  }
}
 
When I press the button, the rising interrupt reacts relatively fast. But when I release the button, the falling interrupt responds very slowly. It takes almost a second.
No matter how hard I look at it, I can't tell why this phenomenon occurs. When I look at the falling wave using an oscilloscope, it falls quickly without being as slow as the falling interrupt reaction rate.
    This topic has been closed for replies.
    Best answer by Techn

    Can you please draw the pullups or pull down used? If there is capacitance it will affect. Ideally you shoud give pulse from another pin of micro and test the response time.

    2 replies

    TechnAnswer
    Graduate II
    June 24, 2024

    Can you please draw the pullups or pull down used? If there is capacitance it will affect. Ideally you shoud give pulse from another pin of micro and test the response time.

    Technical Moderator
    June 24, 2024

    Hello @zoro ,

    You are not following our recommendations on thread posting on this community especially on sharing the code source.

    Please refer to this link for more details.

    Thank you for your understanding.