Tuesday, November 21st 2017, 7:14am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

DTurnbow

Beginner

Date of registration: Nov 10th 2017

Posts: 3

1

Friday, November 10th 2017, 5:42pm

Data breakpoints

I'm troubleshooting a hard fault issue.
I can tell that a function pointer in a structure is getting corrupted and that's what's sending execution off "into the weeds".
So I tried to set a data breakpoint on the function pointer in the structure, but it doesn't seem to be working.
At least it doesn't trip in the initialization code when the function pointer is initialized.

Should data breakpoints work in my setup?

I have a Segger J-Link ULTRA+ debugger.
I'm using Segger Embedded Studio
I'm using a Nordic nRF52840 processor
I'm using the SWD interface (SWDIO/SWCLK)

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 325

2

Monday, November 13th 2017, 2:07pm

Hello Douglas,

Thank you for your inquiry.

How exactly are you setting the data breakpoint?
Are you using the breakpoint window?
What exactly are your settings for the breakpoint?
What is its trigger type?

Generally it should work.
Keep in mind that for some target devices do not support all trigger types for all memory. Check the target device reference manual for more information.

Best regards,
Nino

DTurnbow

Beginner

Date of registration: Nov 10th 2017

Posts: 3

3

Monday, November 13th 2017, 4:08pm

I set a data breakpoint by using Debug - Breakpoints - New Data Breakpoint.
Expression: m_log_data.timestamp_func (or 0x20006034 which is the address of m_log_data.timestamp_func)
Breakpoint trigger type: Write
When breakpoint is hit: Stop
Check the "Use hardware Breakpoint" box


I actually setup both expressions (m_log_data.timestamp_func and 0x20006034) then restart my application.
Execution does not break at the point in the init code where m_log_data.timestamp_func is set.

DTurnbow

Beginner

Date of registration: Nov 10th 2017

Posts: 3

4

Monday, November 13th 2017, 4:52pm

Hold on.
After I set the Data Breakpoint if I go into the Breakpoints window, right click on one of the data breakpoints I set and select "Edit Breakpoint" it shows the Breakpoint Trigger Type as "Default".
If I manually change it to "Write" again then it seems to start working.

So maybe the real issue is that the Data Breakpoint is not being setup as configured on the first (initial) try.
I have to manually go in and correct it afterwards...?

Is this a bug in SES? In the J-link? On the processor?

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 325

5

Tuesday, November 14th 2017, 4:17pm

Hi Douglas,

Quoted

I set a data breakpoint by using Debug - Breakpoints - New Data Breakpoint.

Ok, that way i was able to reproduce the issue.
This is definitely not how it should be and we will be fixing it as soon as possible.

Quoted

So maybe the real issue is that the Data Breakpoint is not being setup as configured on the first (initial) try.
I have to manually go in and correct it afterwards...?


Yes, that would be the current workaround.

Sorry for any inconveniences caused.

Best regards,
Nino