STMicroelectronics / STM32CubeL4

STM32Cube MCU Full Package for the STM32L4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
269 stars 154 forks source link

Lack of __HAL_GPIO_EXT_DISABLE_IT or equivalent #78

Closed ecrin4102 closed 1 year ago

ecrin4102 commented 1 year ago

In order to prevent a wake up from STOP mode from an exti line (connected to a GPIO for example), this is mandatory to mask the IRQ process on the EXTI stage. There is no other choice than using register directly with: EXTI->IMR1 &= ~(EXTI_LINE_0)

Using only NVIC to disable IRQ will only prevent the execution of IrqHandler but will allow the wake up. As all other peripherals have an __HAL_XXXXX_DISABLE_IT macro, maybe __HAL_GPIO_EXT_DISABLE_IT can be created?

ecrin4102 commented 1 year ago

Refer to this thread for the lack : https://community.st.com/s/question/0D50X0000BdgWWISQ2/how-to-disablemask-an-exti-line-on-the-fly https://community.st.com/s/question/0D50X00009XkfHdSAJ/disableenable-exti-interrupts-using-hal

HBOSTM commented 1 year ago

Hello @ecrin4102,

Firstly, thank you for this contribution. The EXTI enabling and disabling are handled at HAL_GPIO_Init() and HAL_GPIO_DeInit(). I hope you find in the explanations here a satisfying answer to your question.

Best Regards,

HBOSTM commented 1 year ago

Hi @ecrin4102,

Please allow me to close this issue. Thank you again for your comprehension.

With regards,