cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-U545 user button falling EXTI response time very slow

zoro
Associate

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.
1 ACCEPTED SOLUTION

Accepted Solutions
Techn
Senior III

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.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
Techn
Senior III

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.

If you feel a post has answered your question, please click "Accept as Solution".
SofLit
ST Employee

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.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.