I'm using CW10.4 on WinXP. I have a project that uses a K10 72 MHz variant. When I initiate a debug session, I can set a breakpoint, and it will work *once*. After that, it seems to be ignored - even though the symbol and checkmark in the margin of the editor window remain. I'm debugging the code in flash, so, I'm using a hardware breakpoint. I only have one set (I know the limit is 4). The connection to the system is a P&E multilink universal USB. Does anyone have any ideas?
This may or may not be related to the above problem, but, I notice that when I add global variables to the variable window, they are disabled by default. When I right click on one them, the "enable" checkbox is checked, and when I *un-check* it, the variable appears! Just the opposite of the behavior I'd expect...
All of these things seemed to work fine on my previous project using a K40 processor and CW10.1. Maybe these are issues with the K10...?
Thanks,
Keith
Well - looks like a rookie mistake on my part. The code where my breakpoint was set was truly never getting executed. Forgot to declare a certain variable "volatile" and so the compiler optimized that section of code out. Didn't see what was going on 'til I looked at the disassembler window and tried to follow it there...
Hi Keith,
Under some condition in your application, the compiler and linker could optimize some part of your application.
For the variables, moving a variable as global could be enough to avoid optimization.
However in some case the volatile keyword is required too.
Regards
Pascal
Thanks, Pascal - I hadn't thought of that angle...
Keith