This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Why break point change .text code memory?

I have a code to check crc for .text code. it runs OK without break point. But it gave me wrong crc when I set break point. I realize that particular location which I set break point changed to 0x7625. I don't understand why this happens and how I can deal with it? Anybody can help me out with this. Thank you!

  • You're probably using a software breakpoint, which changes the code in memory to implement the break. Try using a hardware breakpoint instead.

  • Thank you so much Adam for answering my question. I understand now.

    Another question come to my mind is how may I know the origin and length of the .text code?

    Linker file specify which RAM location .text will be. But not exactly the origin and length. 

    .map file has the info. I wonder any better way my code checking s/w know the origin and length in order not enter those manually in the code after each build.

    Thank you and have a good night!

  • You can tell your code about the origin and length of your memory sections by assigning variables in the linker command file. I don't have an example on me, but it's discussed in section 8.5.10 of the C28x Build Tools Guide (SPRU513) in the section called "Assigning Symbols at Link Time". Subsection 8.5.10.7 ("Address and Dimension Operators") describes built-in linker commands for getting the origin and length of a section.

  • Thank you again Adam. I'm able to change the linker file to track start and end address.