Skip to main content
Associate III
Nov 4, 2025 4:07 PM UTC
Solved

Simultaneous EXTI and timer interrupt configuration

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.

TDK
TDKBest answer
Nov 4, 2025 4:43 PM UTC

> 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

 

"If you feel a post has answered your question, please click ""Accept as Solution""."

7 replies

mƎALLEm
ST Technical Moderator
Nov 4, 2025 4:28 PM UTC

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 "Best answer" on the reply which solved your issue or answered your question.
avidronegAuthor
Associate III
Nov 4, 2025 4:30 PM UTC

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

waclawek.jan
Super User
Nov 4, 2025 5:17 PM UTC

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