Skip to main content
Associate III
November 4, 2025
Solved

Simultaneous EXTI and timer interrupt configuration

  • November 4, 2025
  • 2 replies
  • 389 views

On the STM32F303K8, is it possible to configure e.g. PA8 to both receive an EXTI interrupt on falling edge and act as the TIM1CH1 input to trigger source TI1FP1, in turn serving as a timer gate for gated mode?

I cannot find a way to express this through MX, which usually means it isn't possible at all, but perhaps it could be done through explicit HAL calls.

Best answer by TDK

> for EXTI you need to set it as input mode

@mƎALLEm Do you have a source for that?

The EXTI part of the manual doesn't mention this, or I'm missing it.

 

This is certainly possible on the STM32F4 series without input mode (any mode except analog works). I suspect it's possible here as well, but not clickable in CubeMX. Don't have an F3 board to try it on.

TDK_0-1762274551705.png

 

2 replies

mƎALLEm
Technical Moderator
November 4, 2025

Hello,

That's not possible as it depends on the IO config especially GPIOx_MODER:

mALLEm_0-1762273582905.png

For the timer you need to set the alternate function mode (10b), while for EXTI you need to set it as input mode (00b). So you can't do that simultaneously.

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
avidronegAuthor
Associate III
November 4, 2025

That's exactly what I was looking for - thank you very much.

waclawek.jan
Super User
November 4, 2025

Of course that's possible.

This is one of the things which is notoriously impossible to do in Cube/CubeMX only because Cube is designed so. AFAIK there is a particular order of Cube function calls which results in this working, reported at this forum by users several times in the past, but I don't use Cube (and the usual caveat, Cube does change, so anything not designed in may stop working if you recompile it after a Cube update).

The best way is not to use Cube if Cube does not support everything you need.

JW