Skip to main content
Visitor II
March 8, 2018
Question

STM32 not executing if command

  • March 8, 2018
  • 2 replies
  • 1095 views
Posted on March 08, 2018 at 15:26

I am working on IR Remote decoding using STM32F103C8t6 board. The board is not executing a if condition in while loop whose parameters are true. I am using attolic truestudio for debuging and it is showing that my board is not executing the if command present in the while loop.

 The Code zip file is attached below.

https://community.st.com/tags♯/?tags=st-linkv2

https://community.st.com/tags♯/?tags=stm32f1%20debug%20problem

 

#st-linkv2 #stm32f103c8 #stm32f1-debug-problem
    This topic has been closed for replies.

    2 replies

    Super User
    March 8, 2018
    Posted on March 08, 2018 at 16:21

    Usual suspects are that the 'if' is not correctly formed, or that something is being optimised-out.

    Are you sure that you have everything qualified as 'volatile' that needs to be ... ?

    https://www.avrfreaks.net/comment/2415831#comment-2415831

     

    https://www.avrfreaks.net/forum/tutcoptimization-and-importance-volatile-gcc

      

    https://www.avrfreaks.net/forum/shortcuts-taken-optimized-code-may-occasionally-sic-be-surprising

     
    Graduate II
    March 8, 2018
    Posted on March 08, 2018 at 17:16

    >>Are you sure that you have everything qualified as 'volatile' that needs to be ... ?

    I'm sure nothing that needs to be volatile actually is.

    Visitor II
    March 8, 2018
    Posted on March 08, 2018 at 18:01

    Your variable

    'Status'

    is changed within an interrupt (HAL_TIM_IC_CaptureCallback), so 'Status' should be declared as 'volatile'.