cancel
Showing results for 
Search instead for 
Did you mean: 

Issue when a pin is an EXTI and alternate function at the same time

andywild2
Associate III
Posted on December 28, 2015 at 11:07

Hello to all,

just to inform you about an inconsistency of HAL_GPIO_INIT:

I have a pin which triggers an EXT-Int and is also an input to the timer capture register.

With Standard Peripheral Library configuring EXT-Int and Alternate Function was separate. There was no conflict at all.

Now with in HAL_GPIO_INIT Alternate Function and EXT-Int config is combined.

And here comes the problem:

If you configure the alternate function first and thereafter the external interrupt feature,

the last call to HAL_GPIO_INIT sets the MODER register to input mode!!

So your previous alternate function setting in MODER is gone....

However if you configure the EXT-Int first and thereafter the alternate function everything is ok.

I hope this saves at least a little bit of time to the programmers who have to switch from peripheral lib to CUBE

best regards

Andy

0 REPLIES 0