cancel
Showing results for 
Search instead for 
Did you mean: 

FLAG status

arunl4g
Associate II
Posted on February 26, 2016 at 16:18

Hi 

i am a newbie. i have seen some examples, sometimes they clear the flag and sometimes they dont clear the flag. Could anyone please tell me when it is needed to clear r no need to clear_..

example : i am waiting for the DMA to finish ...but i am  not clearing the flag when i contunue to send again.  Do i need to clear the flag after checking ?

4 REPLIES 4
Amel NASRI
ST Employee
Posted on February 26, 2016 at 17:42

Hi kaka,

Some flags are cleared by hardware, others need to be cleared by software.

A flag is cleared by hardware when an expected condition is reached or when some actions are done (Ex: read a given register).

So, in all cases, you have to refer to the flag description in the reference manual to know how it is cleared.

-Mayla-

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.

Posted on February 26, 2016 at 17:54

If you are reinitializing the DMA No, if you are running it in circular mode Yes.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
arunl4g
Associate II
Posted on February 27, 2016 at 11:42

thank you .

i also cant understand what will happen when i give ''RCC_APB2PeriphResetCmd''. 

example: void RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, ENABLE);

Does the USART! register values goes to zero when i give RCC_APB2PeriphResetCmd?

pkumar1883
Associate II
Posted on February 29, 2016 at 08:15

Yes all USART1 register will have the RESET values. For example all pending Flags will be cleared.

/*Please

 mark helpfull

 if this post helps you or solves your problem.*/

/* If you need any personal support for your work please contact at 

embeddeddesign.help@gmail.com*/