2020-11-07 11:41 PM
Hi there
I am using a STM32F103C8T6. I defined this pins as External Interrupt:
PB4 - GPIO_MODE_IT_RISING
PC13-GPIO_MODE_IT_RISING_FALLING
PC14-GPIO_MODE_IT_RISING_FALLING
PC15-GPIO_MODE_IT_RISING_FALLING
the problem is that every time I SET/RESET PB4, it goes into PC13-15 interrupt callbacks.
here is the code
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
//L_MCU Interrupt
if((GPIO_Pin==GPIO_PIN_13 || GPIO_Pin==GPIO_PIN_14 || GPIO_Pin==GPIO_PIN_15) && stL_MCU==true)
{
HAL_TIM_Base_Start_IT(&htim2);
stL_MCU=false;
}
else
{
__NOP();
}
}
for extra care I set another condition in the above code (&& stL_MCU==true), but I don't know why it enters this interrupt, any clue?
2020-11-08 12:40 AM
Have you this in it file and too for IRQ4 ?
/**
* @brief This function handles EXTI line[15:10] interrupts.
*/
void EXTI15_10_IRQHandler(void)
{
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
/* USER CODE END EXTI15_10_IRQn 0 */
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_14);
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_15);
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
/* USER CODE END EXTI15_10_IRQn 1 */
}
2020-11-08 12:42 AM
Dear MM..1
yes I do have these for All of pins
2020-11-08 12:45 AM
Realy this HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
you dont change to callback?
2020-11-08 12:48 AM
@MM..1
I dont get what you mean?
"Realy this HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);"
above code shows how I changed the EXTI Call back
2020-11-08 12:56 AM
I write about HAL levels when IRQ occured as first it jump
EXTI15_10_IRQHandler
here call
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13)
here check and clear flags and if this gpio have flag call
HAL_GPIO_EXTI_Callback
and i ask hav eyou realy in IRQHandler bold function name?
2020-11-08 06:46 AM
> PB4 - GPIO_MODE_IT_RISING
> the problem is that every time I SET/RESET PB4, it goes into PC13-15 interrupt callbacks.
> here is the code
> void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
The HAL_GPIO_EXTI_Callback function isn't specific to PC13-15. It'll get called for PB4 if it's enabled as an interrupt.
It could also be that you're getting noise on these lines due to crosstalk. How are they connected in hardware?