Unable to retrieve disassembly data from backend.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Unable to retrieve disassembly data from backend.

4,966 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Italia on Wed Sep 03 03:00:15 MST 2014
Hi,

i'm programming my CPU LPC2468 and my program run really good in debug mode.
Now, when i compile in release mode, my program stop tu function correctly and fall
in an infinite loop in an "if" instruction. I look the disassembly code and in the if instruction
i have the following:

boolean I2CEngine(time_t timeout)
{
while (!done)
{
if (I2CMasterState == DATA_NACK)
{
//result = I2CStop();
done = true;
}
                                  }
}

In this case the I2CMasterState is modified in the interrupt routine and the degug show
that the the if condition is sutisfacted.

DISASSEMBLY:

00002a00:   bge     0x2a0c <I2CEngine+28>
442       I2CStop();
00002a04:   bl      0x29a4 <I2CStop>
446       done = true;
00002a08:   mov     r3, #255        ; 0xff
451       if (I2CMasterState == DATA_NACK)
00002a0c:   ldr     r2, [pc, #32]   ; 0x2a34 <I2CEngine+68>
449       while (!done)
00002a10:   cmp     r3, #0
451       if (I2CMasterState == DATA_NACK)
00002a14:   Unable to retrieve disassembly data from backend.
00002a15:   movs    r0, #0
00002a17:   b.n     0x25be <coreFlashROMWrite+158>


Looking the disassembly there is also a missing coerence of the logic flow of the portion of program that i don't understand.

Thank u for u attention.
标签 (1)
0 项奖励
回复
4 回复数

3,694 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Italia on Thu Sep 04 03:57:29 MST 2014
Why volatle? And i have to do that for all the variable?
0 项奖励
回复

3,694 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Thu Sep 04 03:53:39 MST 2014

Quote:
I just found the problem that is an optimization of the compiler that i removed.



Don't do that. Instead fix your code: declare the variable volatile.
0 项奖励
回复

3,694 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Italia on Wed Sep 03 04:30:21 MST 2014
I just found the problem that is an optimization of the compiler that i removed.
0 项奖励
回复

3,694 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Sep 03 03:09:55 MST 2014

Quote: Italia
In this case the I2CMasterState is modified in the interrupt routine...



... and it is a volatile?

See: http://www.lpcware.com/content/faq/lpcxpresso/compiler-optimization
0 项奖励
回复