AnsweredAssumed Answered

bug in HAL library stm32l1xx_hal_gpio_ex.h

Question asked by sulik.daniel on Feb 23, 2015
Latest reply on Sep 7, 2015 by Nesrine M
The following macro generated by STM32CubeMX 4.5.0 and 4.6.0 is wrong for SYSCFG_EXTICR1-4 when trying to use registers GPIOF, GPIOG, GPIOH for EXTI.
 
#define GET_GPIO_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
                                   ((__GPIOx__) == (GPIOB))? 1U :\
                                   ((__GPIOx__) == (GPIOC))? 2U :\
                                   ((__GPIOx__) == (GPIOD))? 3U :\
                                   ((__GPIOx__) == (GPIOE))? 4U :\
                                   ((__GPIOx__) == (GPIOF))? 5U :\
                                   ((__GPIOx__) == (GPIOG))? 6U :\
                                   ((__GPIOx__) == (GPIOH))? 7U : 8U)

Please refer to RM0038 ref manual (DocID15965 Rev 10) pages 216-219.
For SYSCFG_EXTICR1 PF,PG,PH indexes are out of order.
For SYSCFG_EXTICR2-4 Index 5U does not exist.
This issue is related to category 3,4 and 5 devices.

Spent whole day working out what is wrong with my trivial EXTI code using pin13 on GPIOG (STM32L152ZD) :-(

Dan

Outcomes