cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX 6.6.1 "Generate Enable in Init" does not work as expected for external interrupts

FLomb.2
Associate

When attempting to initialize a single GPIO EXTI as disabled, the generated code still enables the interrupt. I did notice that if I uncheck all of the EXTI lines, then none of them are enabled in the generated code. So it seems it's all or nothing. Is this the expected behavior?

Thanks,

Frank

This:

0693W00000QLTFGQA5.pngGenerates:

  /* EXTI interrupt init*/
  HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0);
  HAL_NVIC_EnableIRQ(EXTI0_IRQn);
 
  HAL_NVIC_SetPriority(EXTI2_IRQn, 6, 0);
  HAL_NVIC_EnableIRQ(EXTI2_IRQn);
 
  HAL_NVIC_SetPriority(EXTI3_IRQn, 6, 0);
  HAL_NVIC_EnableIRQ(EXTI3_IRQn);
 
  HAL_NVIC_SetPriority(EXTI4_IRQn, 6, 0);
  HAL_NVIC_EnableIRQ(EXTI4_IRQn);

However, this:

0693W00000QLTFfQAP.pngGenerates:

  /* EXTI interrupt init*/
  HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0);
  HAL_NVIC_SetPriority(EXTI2_IRQn, 6, 0);
  HAL_NVIC_SetPriority(EXTI3_IRQn, 6, 0);
  HAL_NVIC_SetPriority(EXTI4_IRQn, 6, 0);

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

Hello @FLomb.2 (Community Member)​ & @KnarfB (Community Member)​ ,

Thanks for your feedback,

This is a known issue and it is already raised to the dev team. When "Generate enable in init" is unchecked, its respective HAL_NVIC_EnableIRQ(XXXX_IRQn) should not be generated.

I will keep you posted with updates

Internal ticket number: 129363 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly 🙂

Sara.

View solution in original post

4 REPLIES 4
KnarfB
Principal III

Confirmed on NUCLEO_STM32G431KB PA4 and PB0. Flagged as bug-report.

hth

KnarfB

Amel NASRI
ST Employee

Hi @FLomb.2​  & @KnarfB​ ,

Thanks for reporting the issue and adding relevant topics.

I add @Sara BEN HADJ YAHYA​ & @Khouloud OTHMAN​ to investigate it and take relevant actions.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Sara BEN HADJ YAHYA
ST Employee

Hello @FLomb.2 (Community Member)​ & @KnarfB (Community Member)​ ,

Thanks for your feedback,

This is a known issue and it is already raised to the dev team. When "Generate enable in init" is unchecked, its respective HAL_NVIC_EnableIRQ(XXXX_IRQn) should not be generated.

I will keep you posted with updates

Internal ticket number: 129363 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly 🙂

Sara.

Sune Jensen
Associate II

The call to HAL_NVIC_EnableIRQ(XXXX_IRQn) seems to be correctly omitted when the initialization code is generated in main.c. It is erroneously called when the initialization code is generated in gpio.c.

See my related bug report: https://community.st.com/t5/stm32cubemx-mcus/bug-report-exti-irq-erroneously-enabled-when-initializing-in/m-p/619087