LPC expresso Compiler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC expresso Compiler

327 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by terrype on Wed Dec 17 17:55:26 MST 2014
I have funny issue in LPCexpresso IDE, compiler etc. I am using ltest version of LPCExpresso IDE together with LPCexpresso LPC1769 Rev B board and Free RTOS.

if(result == 0)
{

turn_on_LED ;

}

I have break point at turn_on_LED ;  result is a local variable. 

Inside the locl varioable windows shows
result  is 0x01 but by debugger stops at turn_on_LED

Is anyone face this before? any explanation o hint to solve this probelm, please
0 Kudos
2 Replies

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu Dec 18 11:17:22 MST 2014
terrype, what you are saying is that the value of variable 'result' is 0x01 yet it still passes the comparison in the if statement 'if (result == 0)' and then hits the breakpoint at 'turn_on_LED'.  That should definitely not happen.  I believe that you have something wrong in the code and/or the variable declaration.  I'm not convinced that the optimization settings would cause this, but you should try -O0 optimization to see if the problem goes away as TheFallGuy suggested.

Are you sure that the variable 'result' is a local variable?  Does its value get changed in an interrupt handler?
0 Kudos

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Thu Dec 18 01:20:54 MST 2014
I expect that you are using the -Og (optimize for debug):

This option, together with some issues, is described in this FAQ:
http://www.lpcware.com/content/faq/lpcxpresso/optimize-for-debug

As stated in the FAQ

Quote:
-Og enables optimizations that should not interfere with debugging experience. However this is still an area of active development, and some issues may sometimes be seen.



The workaround is to use -O0 optimization.
0 Kudos