Problem in more than 2 breakpoint use for MKE04Z128 series micro-controller.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem in more than 2 breakpoint use for MKE04Z128 series micro-controller.

1,257 Views
gagan
Contributor I

Hi, We are using MKE04z128 micro-controller with IAR compiler and jlink plus programmer. During debugging, if we set more than 2 breakpoint in our code, our application stops working and displays error message "Timeout during programming sector, core does stop and my application hangs and i need to reload the code into the board.

I know that there is only two hardware breakpoint but microcontroller should allow software breakpoint during debugging.

Labels (1)
0 Kudos
8 Replies

946 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Gagan,

Debug the KE04 with the Jlink only allow to put 2 breakpoints.

And I've also confirmed it, when I put 3 breakpoints in the demo, an error message would jump out (Fig 1)2015-08-07_10-03-58.jpg

Hope it helps.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

946 Views
gagan
Contributor I

Hi Ping,

thanks. But I observed that if i write simple c code like

void main()

{

int a, b, c, d, e;

while(1)

{

  a=3;

  b= 3;

  c=a+b;

  d=a+c;

  e= a+c+d;

}

}

I can put breakpoint in all lines and there is no limit of only 2 breakpoint in the code. How it works?

If there is only 2 breakpoint limitation, it should also not work.

you can try it at your end as well.

What about software breakpoint?

0 Kudos

946 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Gagan,

Thanks for your reply.

And I've run the code you shared, however the breakpoint still is not able to be set if I had already set two and some messages listed below as the Fig 1 illustrates.

2015-08-11_10-46-53.jpg

                                                                          Fig 1


Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

946 Views
gagan
Contributor I

Hi, I am using Jlink Plus which is allowing me to put more than 2 breakpoint and see my below workspace.

Jlink Base allows you to use only two breakpoint.

breakpoint.png

In the above workspace, I can set as many breakpoint as required.

However if i tried the same with my code, debugger stops and gives me error message which I mentioned in my original post.

I am wondering what could be the difference between my code and the above test code.

Regards

Gagan Gupta

0 Kudos

946 Views
jay_heng
NXP Employee
NXP Employee

Try to debug your code in RAM if you want unlimited breakpoint.

If the resource of MCU breakpoint unit has been occupied by hardware breakpoints, then you won't be able to set any software breakpoint. maybe this is the reason why the test code can work with more breakpoints but your code can't.

0 Kudos

946 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Gagan,

There are two types of breakpoint, one is hardware breakpoint which has limitation in number , the other is software breakpoint.

J-Link PLUS support unlimited breakpoint in the flash memory which belongs to the software breakpoint.

So you can set more than 2 breakpoint in the code above, however failed to set in this sort of code which operates some hardware units inside MCU.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

946 Views
gagan
Contributor I

Hi,

regarding the below point,

"So you can set more than 2 breakpoint in the code above, however failed to set in this sort of code which operates some hardware units inside MCU."

I do not agree with it otherwise it defeats the purpse of software breakpoints.

0 Kudos

946 Views
ndavies
Contributor V

Software breakpoints will not work on code in flash memory. Software breakpoints work by replacing code in memory with a breakpoint command. To insert the breakpoint in flash memory,  you would have to erase an entire sector and rewrite it with the breakpoint command in place. To erase the breakpoint you would need to once again erase the entire sector and replace the code that was originally there.

This is the reason hardware breakpoints exist. If you could easily replace the opcodes in memory, hardware breakpoints wouldn't be needed.

0 Kudos