HC08 - problem with debugging the code

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

HC08 - problem with debugging the code

跳至解决方案
2,694 次查看
Konrad
Contributor I
Hello,
 
I have problem with using True-Time Simulator & Real-Time Debugger  in CodeWarrior for HC08 3.1.
 
Debugger seems to ignore some parts of code. For instance:
- in the part of code, which should be executed sequentially, it skips the group of 5 lines of code,
- it doesn't execute the code after if-statetment even though the condition is true.
 
The common problem in all these cases is that I can't set the breakpoint in the part of code which is skipped (and which shouldn't be skipped).
 
Any help appreciated.
Regards,
Konrad
 
 
 
 
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
604 次查看
CompilerGuru
NXP Employee
NXP Employee
my guess: did the compiler optimize the code you are trying to debug? Optimized code can behave strange, at least when you only look at the behaviour on the C, and not on the assembly level.
Try to switch off some optimizations, try the following options:
"-onf -one -Onf -OnB=abdrt -onbt -Oi=OFF "

Daniel

在原帖中查看解决方案

0 项奖励
回复
4 回复数
605 次查看
CompilerGuru
NXP Employee
NXP Employee
my guess: did the compiler optimize the code you are trying to debug? Optimized code can behave strange, at least when you only look at the behaviour on the C, and not on the assembly level.
Try to switch off some optimizations, try the following options:
"-onf -one -Onf -OnB=abdrt -onbt -Oi=OFF "

Daniel
0 项奖励
回复
604 次查看
Konrad
Contributor I

Hello Daniel,

It looks as if the problem that I have is caused by compiler optimization. However, the compiler options that you suggested didn't solve it.

Is there any document describing these options?

Regards,                                                                                                             Konrad

0 项奖励
回复
604 次查看
CompilerGuru
NXP Employee
NXP Employee
All the compiler options are described in the compiler manual. The HC08 compiler pdf at
Help\pdf\Compiler_HC08.pdf
in the installation.

If you have a small, complete compilable sample we might be able to specify the option to disable the optimization (if it can be disabled).
But I dont have time to dig into a huge code base :-|.

Daniel
0 项奖励
回复
604 次查看
Alban
Senior Contributor II
Hi Conrad,
 
This happened to me a couple of times when I updated the code but forgot to program the Flash.
In this case, the code displayed in the debugger will not match the code inside the MCU and will will see strange behaviour.
 
Also HC08 only support one breakpoint. If you don't delete one before creating a new one itt will tell you it cannot set the breakpoint.
 
Hope this unblock you...
Alban.
0 项奖励
回复