This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

enable/disable breakpoint in code

Hello,

An alternate title for this issue is:

conditional data access breakpoints not working (SES or Keil)

I have been working with Segger to resolve condition breakpoint operation in Segger Embedded Studio (SES). They believe what I am trying to do it valid and suggested I contact the MCU manufacturer to determine the level of debug support provided in the processor. I can get simple data access breakpoints to work so another possible solution would be to handle the "conditional" part in code.

Here are some of the emails with Segger support.

Hello Axel,

As you can probably tell, I have an urgent need for help, thus the forum posting issue. If you could help me that would be great.

Basically, I am trying to debug a possible memory corruption issue. I know what area of memory is getting corrupted. I know what code should be accessing that data. Basically I want to set a data write breakpoint which is only enabled if PC is not the expected address range. SES allows me to define a data access expression like this: 

“(char[480])0x2000486c && @pc > 0x47953”

But the PC check is ignored. Is this possible? It seems like a common requirement.

Thank again for any help you could provide.

Allen

Hello Axel,

 

As far as I can tell, this feature isn’t working as expected. Below are screenshoots of the breakpoint definition, local variables, registers and disassembly. The issues I see are:

  1. The cast to treat the address as an array of 480 bytes is not working. The breakpoint only triggers when the local variable p_node matches the expression. This is a 2 dimensional byte array [15][32]. The other array locations do not trigger the break.
  2. The @pc portion of the expression is ignored. Both PC and LR are less than 0x4c600

 

 

Hello Allen,

V4.22 is from last September.

You may want to install the latest version, which is V4.52a.

However, what you’re seeing is probably not related to the ES version.

We are currently suspecting that the type of data breakpoints in the device you’re using is limited (Data Ranges and PC> not possible).

Related