Skip to main content
dangky
Associate
September 29, 2016
Question

I need help about UART Transmit Interrupt.

  • September 29, 2016
  • 4 replies
  • 1313 views
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.
    This topic has been closed for replies.

    4 replies

    Walid FTITI_O
    Visitor II
    September 29, 2016
    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
    dangkyAuthor
    Associate
    September 30, 2016
    Posted on September 30, 2016 at 06:42

    dangky
    dangkyAuthor
    Associate
    September 30, 2016
    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
    Visitor II
    September 30, 2016
    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-