[SOLVED] Breakpointe step performance

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

  • [SOLVED] Breakpointe step performance

    Hi Together,
    i'm writing a small application for a university project where i jump with breakpoints through my code.

    I noticed that when I set a breakpoint and then put the cpu back into run mode it takes a long time.

    Relative to that I am much faster with single instruction step.

    The blocks I run through are basic blocks with ~10 instruction.

    breakpoint step ~ 4ms
    single instruction step ~100µs

    My expectation was that I could iterate through the code much faster with breakpoints.

    I use a JLINK EDU and use the JLINK API to communicate directly with the JLINK.
    As hardware I use a STM31F103 controller.

    Are breakpoints for small code segments really more inefficient than single instructions or is it my setting?

    Best regards
  • Hello,

    Actually, when single stepping, J-Link may simulate simple instructions like
    MOV Rd, #Imm
    MOV Rd, Rs
    ADDS Rd, #Imm
    ADDS Rd, Rs

    Therefore, single stepping can be quite fast because some HW operations are skipped and simulated and at some point their result is written to the HW once on-block.
    Also, your performance with BPs depend on the debug interface speed you have selected.