HC08 - problem with debugging the code

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

HC08 - problem with debugging the code

Jump to solution
2,536 Views
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
 
 
 
 
Labels (1)
Tags (1)
0 Kudos
1 Solution
446 Views
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

View solution in original post

0 Kudos
4 Replies
447 Views
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 Kudos
446 Views
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 Kudos
446 Views
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 Kudos
446 Views
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 Kudos