cancel
Showing results for 
Search instead for 
Did you mean: 

Don't enable interrupts

Adam Hamilton
Associate III

I would like to know if there is a way to NOT enable interrupts during the initialization of the EXTI. See below for snippet

  /* EXTI interrupt init*/
  HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(EXTI0_IRQn);
 
  HAL_NVIC_SetPriority(EXTI3_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(EXTI3_IRQn);

I want to be able to control when I enable the IRQ but there doesn't seem to be any option to do this.

if I uncheck the Enabled option within the NVIC Configuration tab, it completely removes the setup and IRQ callback, which is not what I want.

Basically, I want something like

  /* EXTI interrupt init*/
  HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
  HAL_NVIC_DisableIRQ(EXTI0_IRQn);
 
  HAL_NVIC_SetPriority(EXTI3_IRQn, 0, 0);
  HAL_NVIC_DisableIRQ(EXTI3_IRQn);

I just don't see any way to accomplish this. I suppose in my current circumstance I could initialise before the MX_GPIO_Init() function, that way I can be certain that if the external interrupt fires, my code will be ready for it.

However, there might be other situations where this won't be possible. In any case, if there is no way to accomplish something like the snippet above, can I request that for a future version of CubeMX for both standalone and IDE integration, the IRQ enablement is selectable via a checkbox

Sorry if this seems overly worded. Also, I would normally add this as a feature request but ST community seems to only do Q&A

Thanks

Adam

10 REPLIES 10
Herve PIERROT
ST Employee

Hi Adam,

Thanks for sharing your ideas. This forum is a good place for it, and we will have a look to it, but maybe you can also duplicate your post

in the IdeaZone, in the menu Share->Ideas

0693W00000GXqx5QAD.png 

Thanks,

Herve.

TDK
Guru

@Herve PIERROT​ 

Ah yes, the idea zone. Where in 2 years, there have been 5 things marked as "Delivered," but none since 2021 began. Out of those, 3 are TouchGFX specific, 1 is a forum request, and 1 is a request to rename PDFs.

The idea zone concept is nice, but it doesn't really work without ST engagement and support.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for looking into it Herve

I will certainly duplicate my post in the Ideas section.

Regards

Adam

Thanks @TDK​ 

I will do my due diligence and report it in the IdeaZone, although given what you said I do not hold much hope.

Thanks

Adam

Pavel A.
Evangelist III

If you do not want to enable certain interrupts during initialization, then just uncheck the Enabled option.

Configure and enable these interrupts later when you're ready to handle them.

There is another way to hold enabled interrupts during initialization, using BASEPRI.

Khouloud ZEMMELI
ST Employee

Hello @Adam Hamilton​ ,

Thanks for your post,

Your request will be internally checked.

Khouloud.

I have already considered this, and was mentioned in my OP: "if I uncheck the Enabled option within the NVIC Configuration tab, it completely removes the setup and IRQ callback, which is not what I want."

I'll look into BASEPRI but somehow I think this a hammer approach to something that could be quite easilly solved by allowing the programmer to control when the IRQ is to be handled.

@Herve PIERROT​ Thanks for pointing me to this. I have created a post in the IdeaZone

https://community.st.com/s/ideazone#0873W000000fxYJQAY

Thanks for looking into this. I have also submitted to the IdeaZone where hopefully it can be better tracked

https://community.st.com/s/ideazone#0873W000000fxYJQAY

Kind regards

Adam