2013-10-02 11:47 PM
STM32L151RCT6A under IAR Compiler,
board hangs when I do these steps/* Enable SYSCFG clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Connect EXTI1 Line to PA9 pin */
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource9);
This is related to EXTI Configuration on PA9, to rising+falling edge in interrupt mode, I have written the code for configuration part, but it hangs when I do the above steps, when I remove them my code flows ahead,
Has anyone encounter this problem ? #stm32 #timer #exti #interrupt #rtfm #stm32-stm32l1512013-10-03 04:04 AM
I am trying getting EXTI interrupt but getting nowhere, here is my code which is basically direct from sample codes but not working,
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_Init(GPIOA, &GPIO_InitStructure);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource10);
EXTI_InitStructure.EXTI_Line = EXTI_Line1;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = EXTI1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;//0x0F;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;//0x0F;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
EXTI_GenerateSWInterrupt(EXTI_Line1);
When I HIGH the PA10 pin, I get no software interrupt, The code does not goes to EXTI1_IRQHandler(), What seems to be missing?2013-10-03 04:50 AM
What seems to be missing?
That PA9 is connected to Line9, and PA10 Line 10 The interrupt service via EXTI9_5_IRQHandler (EXTI9_5_IRQn), and EXTI15_10_IRQHandler (EXTI15_10_IRQn)2013-10-03 05:12 AM
Solved, Thank you clive1, you are a life saver