Skip to main content
Prasad Dait
Associate II
March 8, 2018
Question

STM32 not executing if command

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.

3 replies

Andrew Neil
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

 
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
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.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Rosiney Silva
Associate
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'.