When debugging code running from flash memory, the debugger is limited on how many breakpoints it can set at any time by the number of hardware breakpoint units provided by the ARM CPU within the MCU.
Note: Code located in RAM can use a different mechanism offering the capability of essentially unlimited breakpoints.
Typically, the number of hardware breakpoints/watchpoints that can be set are as follows:
ARM provides a level of implementation flexibility, so always consult your MCU documentation. Generally NXP MCUs implement the maximum possible number. Note the Cortex-M0's within the LPC43xx multicore MCUs implement only 2 breakpoints and 1 watchpoint.
ARM's CPU documentation can be found here.
If you try to set too many breakpoints/watchpoints when debugging, then you will see an error of the form ...
15: Target error from Set break/watch
Unable to set an execution break - no resource available.
Also remember that a breakpoint will be (temporarily) required for the initial breakpoint set by LPCXpresso IDE by default on the function main() when you debug your application. For more details of this, please see the FAQ Changing the initial breakpoint on debug startup.
A breakpoint may also be required (temporarily) when single stepping your code.
On ARM7 based MCUs, also be aware that if semihosting functionality is being used, then this will consume one breakpoint, leaving only one for general use!
When viewing source (or disassembly) during a debug session, you can toggle breakpoints by simply clicking/double clicking in the left most side of the source view, typically shown as a light blue column. This is also where the breakpoint symbol is shown when one is set.
Breakpoints and watchpoints are also displayed, and can be deleted or disabled in the Breakpoints View. If you are using the "Develop" perspective, then by default it will be in the bottom left of the LPCXpresso window tabbed with the Quickstart and other views.
If you have closed the Breakpoint view at some point, then you can reopen it using the "Window -> Show view" menu or 'Window -> Reset Perspective".
You can use the "Skip all breakpoints" icon in the Breakpoints view (or on the main toolbar) to temporarily disable all breakpoints. This can be particularly useful on parts with only a few breakpoints available, particularly when you want to reload your image, which will typically cause the default breakpoint on main() to be temporarily set again automatically by the tools.
One other thing to watch is that breakpoints are stored in the workspace, and by default are effectively project independent. Thus if you set a breakpoint in one file, and have a file of the same name in another project within the workspace, then if you debug the second project you may hit breakpoints unexpectedly (or have all your breakpoint units consumed unexpectedly).
You can configure your debug launch configuration such that breakpoints are set with absolute filenames to avoid this issue. To do these, right click on the project and select...
Note: this assumes you have already debugged the project in question. If not simply select the "Create Launch Configurations" option first.