Skip to main content
MNeed.1
Associate
May 20, 2021
Question

The STM32Cube IDE appears to generate misleading code (EXTI12) for what should be EXTI2 (pin is named PMOD-IRQ_EXTI2 according to the Users Manual) on the B-L4S5I-IOT01A board (probably a typo?)

  • May 20, 2021
  • 2 replies
  • 807 views

EXTI12 implies that the ARM external interrupt that is triggered is EXTI15_10_IRQn, when actually this pin triggers the EXTI2 interrupt. I think the issue is with the STM32Cube IDE code generator for this particular family of boards. (I tried to use EXTI2 as a software interrupt but when I touched the board in certain places it would cause my code to hang --- well, I thought this vector was available since I didn't see it being used in the configuration tool :) ). I've since solved this minor issue for myself but thought I should share it with ST.

 /*Configure GPIO pin : PMOD_IRQ_EXTI12_Pin */
 GPIO_InitStruct.Pin = PMOD_IRQ_EXTI12_Pin;
 GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
 GPIO_InitStruct.Pull = GPIO_PULLDOWN;
 HAL_GPIO_Init(PMOD_IRQ_EXTI12_GPIO_Port, &GPIO_InitStruct);
 
I think should be:
 
 /*Configure GPIO pin : PMOD_IRQ_EXTI2_Pin */
 GPIO_InitStruct.Pin = PMOD_IRQ_EXTI2_Pin;
 GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
 GPIO_InitStruct.Pull = GPIO_PULLDOWN;
 HAL_GPIO_Init(PMOD_IRQ_EXTI12_GPIO_Port, &GPIO_InitStruct);

This topic has been closed for replies.

2 replies

Khouloud ZEMMELI
ST Employee
June 4, 2021

Hello @MNeed.1​ 

Thank you for your post,

I'll check it then I'll get back to you :)

Khouloud

Khouloud ZEMMELI
ST Employee
June 4, 2021

Hi again @MNeed.1​ 

You're right, I confirm the issue and it will be fixed.

Many thanks for bringing this problem to our attention and for your contribution :)

Khouloud