cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L412 how can I individually turn off EXTI flags without HAL?

deep_rune
Associate III

Im using external interrupts on an STM32L412. I want the interrupt to run as fast as possible so I'm not using the HAL to turn off the request, rather I am writing directly to EXTI -> PR1, which needs to be written high to turn off the interrupt, but if I write for example

EXTI -> PR1 |= 1<<10;

it turns off the other interrupts.

EXTI->PR1 &=1<<10;

doesn't turn anything off.

How can I write this without using HAL?

2 REPLIES 2
TDK
Guru

That should clear the bit. If it doesn't, perhaps it's getting triggered again. You don't need to modify, you can just write the individual bit to clear it.

EXTI->PR1 = 1<<10;

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

You MUST write only the bit you want to clear.

If you use a read-modify-write of the PR1 register you will clear all the interrupt already present.

Have a look the the ref man. The PR bits are of rc_w1 type: Software can read as well as clear this bit by writing 1. Writing ‘0’ has

no effect on the bit value.