cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate code with HAL_NVIC_DisableIRQ by default

Lgarb.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

2 REPLIES 2
TDK
Guru

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
Associate II

Ok, I thought so. Thank for the confirmation.