cancel
Showing results for 
Search instead for 
Did you mean: 

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?)

MNeed.1
Associate

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);

2 REPLIES 2
Khouloud ZEMMELI
ST Employee

Hello @MNeed.1​ 

Thank you for your post,

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

Khouloud

Khouloud ZEMMELI
ST Employee

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