2014-10-05 10:48 AM
I set PC4 as EXTI4 on STM32F405 using STM32Cube so MX_GPIO_Init() contains:
__GPIOC_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
HAL_NVIC_SetPriority(EXTI4_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(EXTI4_IRQn);
I set breakpoint in stm32f4xx_it.c:
void EXTI4_IRQHandler(void)
{
NVIC_ClearPendingIRQ(EXTI4_IRQn);
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_4);
// My code
}
I have checked a presence of the rising edge on PC4 (INT signal of an accelerometer) by scope but the interrupt is not fired.
Does anybody have an opinion or any advice?
Thank you.
2014-10-10 12:37 AM
My mistake - I have not noticed that the Event not Interrupt selection remained set in the STM32CubeMX for the corresponding pin.