2021-11-16 11:06 PM
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
2021-11-17 01:55 AM
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
Thanks,
Herve.
2021-11-17 06:45 AM
@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.
2021-11-17 03:44 PM
Thanks for looking into it Herve
I will certainly duplicate my post in the Ideas section.
Regards
Adam
2021-11-17 03:47 PM
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
2021-11-17 03:59 PM
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.
2021-11-18 01:13 AM
Hello @Adam Hamilton ,
Thanks for your post,
Your request will be internally checked.
Khouloud.
2021-11-18 03:02 PM
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.
2021-11-18 03:17 PM
@Herve PIERROT Thanks for pointing me to this. I have created a post in the IdeaZone
2021-11-18 03:18 PM
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