2014-10-16 06:25 AM
Hi All,
I'm trying to work with the STM32L0 Nucleo board and I found a strange behavior:If I configure an EXTI interrupt on line 0-1 (no matter which pin but I tryed pins PA-B-C/0-1) the interrupt is triggered immediatelly after invoking the HAL_NVIC_EnableIRQ(EXTI0_1_IRQn) function and, after the first handling, it stops to work...If otherwise I use any other pin (2-15) there are no problems and the EXTI works correctly.The configuration I've used are: /*Configure GPIO pin : PB3 */ GPIO_InitStruct.Pin = GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); /* Enable and set EXTI2_3 Interrupt to the lowest priority */ HAL_NVIC_SetPriority(EXTI2_3_IRQn, 3, 0); HAL_NVIC_EnableIRQ(EXTI2_3_IRQn);and /*Configure GPIO pin : PB0 */ GPIO_InitStruct.Pin = GPIO_PIN_0; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); /* Enable and set EXTI0_1 Interrupt to the lowest priority */ HAL_NVIC_SetPriority(EXTI0_1_IRQn, 3, 0); HAL_NVIC_EnableIRQ(EXTI0_1_IRQn);generated using the CubeMXThe handler code is:void EXTI0_1_IRQHandler(void){ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);}void EXTI2_3_IRQHandler(void){ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3);}void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin){ /* EXTI line interrupt detected */ if(__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != RESET) { __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin); HAL_GPIO_EXTI_Callback(GPIO_Pin); }}__weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){ // My code}Do somebody know if is there any known issue on EXTI0_1? I can't understand why the same code does not work with pin 0 and works correctly with pin 3Thanks for your answers!Mat #stm32l0-exti #stm32l0-nucleo2014-10-16 08:21 AM
Hi Mat,
I can't really reproduce your issue with the EXTI interrupt on line 0-1;I've made the same manipulation, with no found issues.Can you provide the whole generated project files to run the same code using my STM32L0 Nucleo board ?Regards,Heisenberg.2014-10-17 01:07 AM
Hi Heisenberg,
thanks for your reply and your attention You can faind attached the example project I've made (I'm using MDK ARM 5.1). EXTI are configured on pins PB0 and PB2. To find the issue just put breakpoints in the interrupt handlers in the main file. I have mounted 2 pushbuttons with external pull-up resistors to detect the falling edge and PB2 works correctly, PB0 shows the same strange behavior I've described in my first post. Thank you! Mat ________________ Attachments : EXTI0_1_issue.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0dL&d=%2Fa%2F0X0000000bcZ%2F2Mt439_CY14ITklO2R1IpCcVvk3oFiz4wF80vMWzETY&asPdf=false2014-10-20 06:32 AM
Hi All,
just an update:I've noticed that the problem seems to be raised when using 2 EXTI contemporary:I tryed to made an exported project (always using the last CubeMX version) using only one EXTI on pin PC0 that toggles the Nucleo LED and everithing worked fine.I tryed than to export another project only adding the EXTI on pi PB3 (then having 2 exti) that both toggle the led, and the issue has been immediatelly replicated on the EXTI0.Turning back to the single exti, the problem disappears.Is there anybody else who get a similar problem?Tanks and regardsMat