trying to operate an external interrupt on stm32f031k6
Im trying to operate an external interrupt on my STM32F031K6, using STM32cube IDE. Ive been following a tutorial here https://simonmartin.ch/resources/stm32/dl/STM32%20Tutorial%2007%20-%20GPIO%20Interrupts%20(EXTI)%20using%20HAL%20(and%20FreeRTOS).pdf but im not sure it really applies to my chip...
The first difference is although I have pins PA11 and PA12 setup for GPIO_EXTI11 and GPIO_EXTI12 in the cubemx, I in the setup preamble
/*Configure GPIO pins : PA11 PA12 */
GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);but i don't see anything like
/* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI4_15_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(EXTI4_15_IRQn); as is mentioned in the tutorial, in fact there doesn't seem to be any mention of interrupts in the setup outside GPIO pa11 & pa12 setup - is this right?
Secondly, the file stm32f0xx_it.c doesn't contain the interrupt handler, it says in the file
/******************************************************************************/
/* STM32F0xx 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_stm32f0xx.s). */
/******************************************************************************/ok, no problem so i add the code
void EXTI0_1_IRQHandler(void)
{
GPIOB->ODR ^= 1<<1;
}but this doesn't do anything. There is no include for the stm32f0xx_it.c file including in main.c, but if i add it I get lots of errors. is this the correct interrupt handler?
any help much appreciated
