cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in HAL_GPIO_DeInit(...) FW_H7 V1.4.0 for EXTI - Wrong Interrupt Pin De-Initialized

Martin Franke
Associate III

I noted that when I call HAL_GPIO_DeInit is called (stm32h7xx_hal_gpio.c v1.4.0) the wrong External Interrupt get's de-initialized. After investigating further and comparing to the previous version I noted the following in the external interrupt de-init block: Everywhere the pin mask:

0x0FUL << (8U * (position & 0x03U))

appears, it should be changed to:

0x0FUL << (4U * (position & 0x03U))

like it was originally.

   /*------------------------- EXTI Mode Configuration --------------------*/

   /* Clear the External Interrupt or Event for the current IO */

   tmp = SYSCFG->EXTICR[position >> 2U];

   tmp &= (0x0FUL << (8U * (position & 0x03U))); // <-- Incorrect Here

   if (tmp == (GPIO_GET_INDEX(GPIOx) << (8U * (position & 0x03U)))) // <-- Incorrect Here

   {

    tmp = 0x0FUL << (8U * (position & 0x03U)); // <-- Incorrect Here

    SYSCFG->EXTICR[position >> 2U] &= ~tmp;

    /* Clear EXTI line configuration for Current CPU */

    EXTI_CurrentCPU->IMR1 &= ~(iocurrent);

    EXTI_CurrentCPU->EMR1 &= ~(iocurrent);

    /* Clear Rising Falling edge configuration */

    EXTI->RTSR1 &= ~(iocurrent);

    EXTI->FTSR1 &= ~(iocurrent);

   }

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @Martin Franke​ ,

This reported issue is confirmed and will be fixed in the coming release of CubeH7.

Thank you for highlighting this.

Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

Hello @Martin Franke​ ,

We will check this internally and come back to you soon with update.

Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hello @Martin Franke​ ,

This reported issue is confirmed and will be fixed in the coming release of CubeH7.

Thank you for highlighting this.

Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Martin Franke
Associate III

Hello @Imen DAHMEN​ 

Thank you for verifying this so quickly!

Regards,

Martin