Skip to main content
Michal Dudka
Lead
July 10, 2023
Solved

CubeMX How to add external interrupt to pin used by another peripheral ?

  • July 10, 2023
  • 3 replies
  • 1994 views

I have a simple question. How to "attach" external interrupt to pin "selected" as Alternate Function of some peripheral in CubeMX. For example:
I set PA8 as TIM4_ETR signal. Then i want to add external interrupt on the same pin. How to do that in CubeMX ? 
Thanks.

This topic has been closed for replies.
Best answer by waclawek.jan

AFAIK you cant, this is a design choice of Cube/CubeMX.

People circumvented this in past by a certain sequence of calls (in code - I don't use Cube so I don't know the details, you can try to search here), but it's probably simpler to write your own code using directly registers.

JW

3 replies

waclawek.jan
waclawek.janBest answer
Super User
July 10, 2023

AFAIK you cant, this is a design choice of Cube/CubeMX.

People circumvented this in past by a certain sequence of calls (in code - I don't use Cube so I don't know the details, you can try to search here), but it's probably simpler to write your own code using directly registers.

JW

ST Employee
July 10, 2023

Hello @Michal Dudka

As @waclawek.jan already said, you can't do that by CubeMX, you'll need to fix the EXTI and GPIO registers after init and create the ISR.  

Please check this post, it can be helpful!

Piranha
Principal III
July 10, 2023

You chose this and now you are asking for electric windows...