[ABANDONED] Cannot step/resume on sw bkpt , Cortex-R4/5, TMS570

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] Cannot step/resume on sw bkpt , Cortex-R4/5, TMS570

    Using J-Trace Cortex, TMS570LS12x chip, CCS IDE v10.3.

    If debugger injects a Sw bkpkt, then it is no longer possible to resume/step the code, either C statement or ASM. This is in CCS.
    Once this happens, the CCS

    Looking at asm, for e.g:

    Source Code

    1. E1200070 bkpt #0
    2. 00010f04: E3A00000 mov r0, #0
    3. 00010f08: E58D0000 str r0, [r13]


    So the CPU is stuck at line 1, and ASM step doens't work. Further, debugger/ide fails to read bunch of registers from that point, SP, CP, SPSR.

    Source Code

    1. ortexR4: Trouble Reading Register PC: Failed to measure CPU clock frequency
    2. CortexR4: Trouble Reading Register CPSR: Failed to measure CPU clock frequency: second loop count is less than first one! (0<=0)
    3. CortexR4: Trouble Reading Register CPSR: Failed to measure CPU clock frequency
    4. CortexR4: Trouble Reading Register SP: Failed to measure CPU clock frequency: second loop count is less than first one! (0<=0)
    5. CortexR4: Trouble Reading Register SP: Failed to measure CPU clock frequency
    Moving PC manually, i.e. setnextline , or move to line, by setting to line 2 in asm above, resumes the code.

    So, is J-Link/J-Trace 's settings somehow clash with software break points here? I don't get seems this stuck behaviour on same code with an XDS debug probe.
  • I sort of, found it: if you start JLinkExe, then connect to JLink through the webserver, you can find option "Flash breakpoints" : Auto, On, Off. Setting this to off, may appear to work on 'fresh' load - load program & symbols - but, it doesn't seem to work if you do just symbols only : always get the sw/flash break points then ...
  • Hi,
    sorry for the delay in response.

    Yes, you can disable flash breakpoints via a J-Link script file, using the corresponding J-Link Command string:
    wiki.segger.com/J-Link_Command_Strings#DisableFlashBPs

    Does this answer your question?

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • @SEGGER - Fabian

    No still struggle somewhat. Each time I power cycle my JLink (or Jtrace), I have to again, start command line interface, and through web page, go and change settings to Never use Flash break points.
    Also, I'm not sure this works when it runs out of hw ones - does it throw error when you try set more than hw breakpoints availble? Because, i never get it, and it seems it proceeds to insert software ones.

    This whole feature / strenth of 'flash breakpoints' appears to insert sw breakpoints runtime, and this just does not play well at all on my TMS target, with MPU enabled.

    Also, 'attaching' to running target entirely does not work, as , again, when I attach (i.e, No firmware upload) it only seems to use want to use sw breakpoints again, and this again crashes the system.

    From the link you have provided : .. "The behavior of the J-Link can be customized via J-Link Command Strings passed to the JLinkARM.dll " . Can those command strings be passed from JLink init script when establishing connection to target?
  • Hi,
    We will look into this and check if there is something wrong with the current handling of breakpoints.

    Regarding command strings in J-Link Script files:
    Yes. This is also mentioned in the same article:
    Using J-Link Command Strings

    Script file API function:
    JLINK_ExecCommand()

    I would recommend to read both articles thoroughly.
    They should contain all required information.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Doesn't appear to make much difference if I do / not add this exec command to my init script. JLINK_ExecCommand("DisableFlashBPs");

    I can still click & insert more breakpoints, where it should fail, but that doesn't appear to happen, and then my target crashes as presumably, it's now pushing sw breakpoints..