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.

TMS320F280049C: Breakpoint usage in RAM and Flash

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Hi Champ,

There are some questions about setting breakpoint in RAM/Flash, I would want to clarify.

Please correct me if the following description is something wrong.

1). In RAM, the breakpoint with no limited times setting is software beakpoint ; In Flash, the breakpoint is hardware breakpoint and it is limited up to 10 breakpoints, correct ? 

2). In debug mode, set a breakpoint by double clicking in the line number field to the left of the code line. Is the action of doing this always set as a hardware breakpoint no matter the code is executed in RAM or Flash ?

3). Following the second question, by right click in the line number field, the first breakpoint means software beakpoint which is shown in red block, is it correct ?

4). Since I have moved the whole ISR code into RAM by using #progma CODE_SECTION successfully, including every functions in ISR. If the first question statement is correct, actually I should set a software breakpoint at somewhere in ISR because the part of code is executed in RAM. However, from my test, when run code, it wouldn't stop there by setting software breakpoint. It would only stop by setting hardware breakpoint. Isn't this behavior contradicting with the first question ? Why 

Would you please clarify the understanding of breakpoint for me ?

Thanks for any comment and correction.

Best Regard.

  • Hi Jonny,

    1). In RAM, the breakpoint with no limited times setting is software beakpoint ; In Flash, the breakpoint is hardware breakpoint and it is limited up to 10 breakpoints, correct ? 

    Yes, there is no limit in software breakpoint.

    In Flash, you are using hardware breakpoint and there is only two hardware breakpoint

    2). In debug mode, set a breakpoint by double clicking in the line number field to the left of the code line. Is the action of doing this always set as a hardware breakpoint no matter the code is executed in RAM or Flash ?

    Please go through the link here. It explains how double-clicking behaves if the code is in RAM or Flash.

    https://software-dl.ti.com/ccs/esd/documents/ccs_breakpoint_watchpoint_c2000.html

     

    This articles should explain the behavior you are seeing.

  • Hi Santosh,

    Thanks for your information. 

    You are correct. C28x devices have a limit of 2 hardware breakpoints which is implemented internally by the hardware.

    I would say up to 10 which is counting on ERAD module implemented external to the CPU, including 8 EBC units. 

    I think I have the answer of the first three questions. However, I still can't get it on the fourth question.

    Since the whole part of ISR code is moved in RAM (code written in driverlib), I should halt the execution by software breakpoint. However, it halts with the hardware breakpoint only. It is tested in many times and get the same result of it.

    May I have your comment on it ?

    Thanks.

  • Johnny,

    If the ISR code is in RAM, you should be able to set the breakpoint and it should halt there. Sometimes, the loaded debug symbols are old, rebuilding whole project may help. Did you try one of the example from C2000Ware and check if you can set the breakpoint in ISR code.

  • Since the whole part of ISR code is moved in RAM (code written in driverlib), I should halt the execution by software breakpoint. However, it halts with the hardware breakpoint only. It is tested in many times and get the same result of it.

    Does [FAQ] Code Composer Studio - Breakpoints disappear after copy from flash to RAM explain your issue?

    Also, which version of CCS are you using?

  • Hi Chester,

    I roughly browse the content, and it looks like what I am looking for the piece of information.

    Thank you for advance. I would go deeper for details in these few days. 

    It happens both on my side(CCS11.0) and on my customer's side(CCS9.3). I am not sure whether we make a mistake during operation.

    Following one more question, what is the exact meaning of below screenshot error about ? Since it shows up when I set a hardware breakpoint at the function which is moved in RAM and it seems the hardware breakpoint is invalid athough I force execution.

    I appeciate all of your fully support, Santosh and Chester. Thanks.

    Best Regard.

  • Johnny,

    This error comes, when it is using hardware breakpoint, and it is out of resource. Please take a look at this page again:

    https://software-dl.ti.com/ccs/esd/documents/ccs_breakpoint_watchpoint_c2000.html

    I am pasting the explanation here:

    Note: C28x devices have two analysis resources available at a time. One resource can be used as a hardware breakpoint, watchpoint, or counter. The other one can be used as a hardware breakpoint or watchpoint. So when working with hardware breakpoints, there is a limit of 2 hardware breakpoints. If you try to set more than the allowed limit, the following message will appear:

  • Hi Chester,

    About the forum from Lori, the content of introduction is exactly the same as our condition. 

    However, I still can't figure out the explanation for it.

    I am ok with When a software breakpoint is set, the emulation driver reads the instruction at that location and replaces it with a software breakpoint op-code that will then halt the target when in debug mode. 

    I am not clear about If the application writes a new instruction to the address where a software breakpoint has been set, the special halting opcode will be replaced with this new instruction. this sentense.

    There are further questions, I want to consult you. May I have your comment about it ?

    1). I didn't write a new instruction. Why the original halting opcode will be replaced or  disappeared ? Should the halting opcode is still there ?

    2). The explanation still doesn't seem to explain why the program will not halt when the code is run the first time after a load/reload ? Is there any sentence that illustrates this point, did I ignore it? Could you help me out ?

    3). Has anyone considered this as a breakpoint bug ? Are we going to fix it in the future ?  

    Thanks for your fully support and patience.

    Best regard

  • Johnny,

    Lori is out of office until end of year. Please expect response by end of first week.

  • Johnny,

    1). I didn't write a new instruction. Why the original halting opcode will be replaced or  disappeared ? Should the halting opcode is still there ?

    A software breakpoint is an opcode (ESTOP0 instruction) that resides in memory.  Code Composer Studio (CCS) will save a copy of the memory and then write the ESTOP0 opcode to the memory.  When the C28x decodes the ESTOP0 it will halt.  CCS then replaces ESTOP0 with the original instruction.  CCS does this all behind the scenes so it looks seamless to the user.

    If the application itself copies code from flash to RAM during initialization it will overwrite anything in that RAM memory.  This would include overwriting the ESTOP0 instruction. In this case the ESTOP0 is lost.  The C28x never fetches and decodes an ESTOP0 so it doesn't halt.  CCS is not aware that the C28x modified the memory.

    2). The explanation still doesn't seem to explain why the program will not halt when the code is run the first time after a load/reload ? Is there any sentence that illustrates this point, did I ignore it? Could you help me out ?

    It does not halt because the software breakpoint (i.e. the ESTOP0 instruction) was overwritten with a different instruction by the C28x.  The C28x never fetches the ESTOP0 instruction and so it never halts.

    3). Has anyone considered this as a breakpoint bug ? Are we going to fix it in the future ?  

    No, it isn't a bug - The fix is to right click and use a hardware breakpoint instead. 

  • Hi Lori,

    Thanks for great help. I fully understand what you are saying.

    Best regard