2015-02-23 09:20 AM
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.
&sharpdefine 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 #hal-library #gpio #gpiog2015-09-07 07:55 AM
Hi,
Please refer to this [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/HAL%20gpio%20libary%20code%20bug¤tviews=53]thread-Syrine –