2023-11-15 11:43 AM
HI, firstly im new into subject of STM32MCUs. I made my own board based on STM32F2 MCU. I have configured 2 interrupts one based on TIM 11 and one on Button placed at pin 40 (PC9). It is simple code including blinking LED every one second and switching different LED state after pushing button. I will pass my NVIC configuration in screenshots. I discovered that pushing button executes EXTI9_5_IRQHandler() when button is pressed but does not call for HAL_GPIO_EXTI_IRQHandler() innside function mentioned above. I discovered it by placing funcion to toggle LED in EXTI9_5_IRQHandler(). Timer interrupt of courese does not work either. I have no idea what is wrong.
/******************************************************************************/
/* STM32F2xx Peripheral Interrupt Handlers */
/* Add here the Interrupt Handlers for the used peripherals. */
/* For the available peripheral interrupt handler names, */
/* please refer to the startup file (startup_stm32f2xx.s). */
/******************************************************************************/
/**
* @brief This function handles EXTI line2 interrupt.
*/
void EXTI2_IRQHandler(void)
{
/* USER CODE BEGIN EXTI2_IRQn 0 */
/* USER CODE END EXTI2_IRQn 0 */
HAL_GPIO_EXTI_IRQHandler(CROSS_A_Pin);
/* USER CODE BEGIN EXTI2_IRQn 1 */
/* USER CODE END EXTI2_IRQn 1 */
}
/**
* @brief This function handles ADC1, ADC2 and ADC3 global interrupts.
*/
void ADC_IRQHandler(void)
{
/* USER CODE BEGIN ADC_IRQn 0 */
/* USER CODE END ADC_IRQn 0 */
HAL_ADC_IRQHandler(&hadc1);
/* USER CODE BEGIN ADC_IRQn 1 */
/* USER CODE END ADC_IRQn 1 */
}
/**
* @brief This function handles EXTI line[9:5] interrupts.
*/
void EXTI9_5_IRQHandler(void)
{
/* USER CODE BEGIN EXTI9_5_IRQn 0 */
HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin);
/* USER CODE END EXTI9_5_IRQn 0 */
HAL_GPIO_EXTI_IRQHandler(BUTTON_Pin);
/* USER CODE BEGIN EXTI9_5_IRQn 1 */
/* USER CODE END EXTI9_5_IRQn 1 */
}
/**
* @brief This function handles TIM1 trigger and commutation interrupts and TIM11 global interrupt.
*/
void TIM1_TRG_COM_TIM11_IRQHandler(void)
{
/* USER CODE BEGIN TIM1_TRG_COM_TIM11_IRQn 0 */
HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin);
/* USER CODE END TIM1_TRG_COM_TIM11_IRQn 0 */
HAL_TIM_IRQHandler(&htim11);
/* USER CODE BEGIN TIM1_TRG_COM_TIM11_IRQn 1 */
/* USER CODE END TIM1_TRG_COM_TIM11_IRQn 1 */
}