Hi everyone
I have downloaded MCUXpresso 11.3.1 [Builkd 5262] couple of days. I run debug with example project on FRDM-KL03Z board. I start getting weird warning "Not all breakpoint could be written" . I have never saw this msg on before. What is going on? Is the breakpoint still fine?
Is there anyone facing the same?
已解决! 转到解答。
I think there is nothing new from 11.3.0 to 11.3.1 (or in any of the previous versions).
NXP (well: Freescale) decided to implement only 2 Hardware breakpoints in the L series (ARM Cortex-M0 would allow 1, 2, 3 or 4). So the Kinetis L allows you only to set 2. If you set 3, you get that warning.
Now what many do not realize: if you want to do stepping with the debugger, you will need one HW breakpoint for this too (debugger sets a breakpoint at the next statement or return location if you do a step out). So your screenshot shows that you have set two: if you want to do stepping you need one more which the hardware does not have: makes sense.
If you want to know more about breakpoint implementation: have a read at https://mcuoneclipse.com/2012/07/29/software-and-hardware-breakpoints/ which I wrote a while back.
Now there is a solution (except switching to a K series which has more hardware breakpoint implemented): you could use 'software breakpoints in flash' which requires you to use a Segger J-Link probe: it re-programs the flash memory on the fly and allows you a virtual 'unlimited' number of breakpoints.
To me: you are not facing something new, just a limitation of the hardware (probably to save a cent or two on the hardware, not sure).
So with using the P&E Debug probe on a Kinetis L:
- there are a maximum of 2 hardware breakpoints
- you can set 2 breakpoints without stepping
- you can set 1 breakpoint with stepping (this uses one breakpoint)
I hope this helps,
Erich
The hardware only allows you to set a limited number of hardware breakpoints. Could you check the number of breakpoints (the Kinetis L series is more limited in the number than the K series)?
Check the 'Breakpoints' view and delete all breakpoints, this should help.
Hi ErichS
Not much, there are just 2 breakpoints.
Yes, no warning if one breakpoint.
I dont think I can only set 1 breakpoint in my code, because I have played round with KL03 for times with more than 1 breakpoint in previous IDE version.
I think there is nothing new from 11.3.0 to 11.3.1 (or in any of the previous versions).
NXP (well: Freescale) decided to implement only 2 Hardware breakpoints in the L series (ARM Cortex-M0 would allow 1, 2, 3 or 4). So the Kinetis L allows you only to set 2. If you set 3, you get that warning.
Now what many do not realize: if you want to do stepping with the debugger, you will need one HW breakpoint for this too (debugger sets a breakpoint at the next statement or return location if you do a step out). So your screenshot shows that you have set two: if you want to do stepping you need one more which the hardware does not have: makes sense.
If you want to know more about breakpoint implementation: have a read at https://mcuoneclipse.com/2012/07/29/software-and-hardware-breakpoints/ which I wrote a while back.
Now there is a solution (except switching to a K series which has more hardware breakpoint implemented): you could use 'software breakpoints in flash' which requires you to use a Segger J-Link probe: it re-programs the flash memory on the fly and allows you a virtual 'unlimited' number of breakpoints.
To me: you are not facing something new, just a limitation of the hardware (probably to save a cent or two on the hardware, not sure).
So with using the P&E Debug probe on a Kinetis L:
- there are a maximum of 2 hardware breakpoints
- you can set 2 breakpoints without stepping
- you can set 1 breakpoint with stepping (this uses one breakpoint)
I hope this helps,
Erich
Update: I just checked with the 11.3.1 and a KL25Z with the P&E Multilink: same thing here: 2 breakpoints or 1 with stepping.
I checked because 11.3.1 comes with updated P&E debug firmware, but for me it is the same behaviour as in previous versions.
I hope this helps,
Erich
There is also another breakpoint used if you have the “stop at main()” checked in the debug dialog. This is cleared after it is hit, but it is another breakpoint that may be used. If you only have 2 breakpoints in h/W then it is significant!
'info breakpoint' should show all the breakpoints known by gdb including the temporary one.
Indeed if the temporary one is not hit (set to the wrong name) then it will consume one of the precious HW breakpoints too.