cancel
Showing results for 
Search instead for 
Did you mean: 

Timer6 UIF flag bit is not getting cleared on reading and writing 0 to it in STM32F7 series

Vivek3
Associate

I am using Timer6 on STM32F7 series MCU​. As soon as I enable the Timer, UIF bit is set in Status Register which is rc_w0, means it gets cleared by reading or writing 0. Then Execution goes to ISR. In ISR when I read the Status register and Try to clear UIF bit by writing 0 to it, the UIF bit is not getting cleared, even after multiple write-read. Due to which, execution keeps going to ISR.

My code to clear Interrupt Flag is this:

uint8 x= *(volatile uint32*)0x40001010; //Read operation on Timer Status Register

*(volatile uint32*)0x40001010=0x00000000; // Write 0 to UIF bit to clear it

Can anyone please tell me why it is not getting cleared?

1 REPLY 1

Maybe because the timer is running and overflowing (thus setting UIF) faster than you succeed to observe and clear it?

JW