Skip to main content
Lgarb.1
Associate III
December 2, 2021
Solved

How to generate code with HAL_NVIC_DisableIRQ by default

  • December 2, 2021
  • 2 replies
  • 1747 views

Hi, I would like to use cubeide (MX tool) to generate a project that use EXTI_13 but with IRQ disabled by default. I can choose Enable/Disable (generate all code or none), Create code on MSPInit function or in MX_NVIC_Init, call HAL_GPIO_EXTI_IRQHandler(EOC_MAG_Pin); on EXTI15_10_IRQHandler or doesn't but I can't choose that some IRQ have to start disabled on the generated code.

Thank

This topic has been closed for replies.
Best answer by TDK

You can disable in the CubeMX, but then it doesn't generate the interrupt handler. It still does initialize the pin as EXTI though.

0693W00000GZjawQAD.png 

If you don't like that, you can call HAL_NVIC_DisableIRQ in the user code section after it's enabled.

Those are your options if you want to use CubeMX to generate the code.

2 replies

TDK
TDKBest answer
December 2, 2021

You can disable in the CubeMX, but then it doesn't generate the interrupt handler. It still does initialize the pin as EXTI though.

0693W00000GZjawQAD.png 

If you don't like that, you can call HAL_NVIC_DisableIRQ in the user code section after it's enabled.

Those are your options if you want to use CubeMX to generate the code.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Lgarb.1
Lgarb.1Author
Associate III
December 2, 2021

Ok, I thought so. Thank for the confirmation.