cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 not executing if command

Prasad Dait
Associate II
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
3 REPLIES 3
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

 
Rosiney Silva
Associate II
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'.

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..