cancel
Showing results for 
Search instead for 
Did you mean: 

I need help about UART Transmit Interrupt.

dangky
Associate II
Posted on September 29, 2016 at 04:29

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
4 REPLIES 4
Walid FTITI_O
Senior II
Posted on September 29, 2016 at 11:10

Hi karthy.vain,

It is a matter of IDE's optimization, it will optimize on that variable value update to be not aligned with the code sequence. To prohibit the IDE from variable optimization , the variable should be declared as volatile.

-Hannibal-

dangky
Associate II
Posted on September 30, 2016 at 06:42

dangky
Associate II
Posted on September 30, 2016 at 06:44

Thanks Hannibal for your reply. I was declared count as volatile variable. but It is still wrong.  nothing is changed. do you have any other comments?

Walid FTITI_O
Senior II
Posted on September 30, 2016 at 15:46

Hikarthy.vain,

You would declare it as an unsigned fixed width integer instead of using ''int'' on different bit machines which can results in subtle bugs cause by compilation optimization technics. you write it as follow:

__IO uint32_t count = 0;

And tell me if that resolve your issue.

-Hannibal-