cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32L0 Nucleo - EXTI 0_1 issue

matteo239955
Associate III
Posted on October 16, 2014 at 15:25

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 CubeMX

The 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 3

Thanks for your answers!

Mat

#stm32l0-exti #stm32l0-nucleo
3 REPLIES 3
Posted on October 16, 2014 at 17:21

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.

matteo239955
Associate III
Posted on October 17, 2014 at 10:07

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=false
matteo239955
Associate III
Posted on October 20, 2014 at 15:32

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 regards

Mat