I am working with the software provided by Freescale for KIT9Z1J638EVM, which has a battery sensor that measures current, voltage, temperature. Every so many clock cycles there is erroneous values displayed. When I observe the memory location where the measurements are being stored, I can see cycles where there are 5 to 10 memory locations being overwritten with a "EE" or "FF", and in some instances it is writing over memory location used to store the battery sensor data. This is why I am seeing erroneous measurements. When I add a watchpoint to one of the memory locations, the problem stops which is puzzling and as soon as I remove all breakpoints the EE's and FF's re-appear. I am trying to get the code to break when the battery voltage memory location is written over, but when I add the watchpoint the problem seems to go away. Can anyone shed light on why this is happening? I am setting up the watchpoint with the condition "0x14b4==FF || 0x14b4==EE;", but I have not observed the code breaking when I use this condition. I have had a hard time finding clear examples on how to use conditions with watchpoints, so I would really like feedback on if the condition is written correctly?
Thanks,
Chris
Hi
Specify the condition for the watchpoint in the Condition field. The condition must be specified using the ANSI-C syntax (Example: counter == 7).
if you need to use address directly. use this syntax:
*(unsigned int*) 0x14b4== 0xFF || *(unsigned int*) 0x14b4== 0xEE
can this help?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Yes, that is exactly the syntax I use in the memory location for 0x14b4, but it causes the issue to go away. I visually see the EE's and FF's stop appearing in the memory viewer and as soon as I remove all breakpoints they come back. This makes it very difficult to determine what line of code is writting over these memory locations. This is odd behavior that I cannot explain.
Regards,
Chris