A Simple Debugging Example

Debugging Tutorial


Complete the Simple Programming Example

Before experimenting with debugging, ensure your system is properly configured by following the steps in the Simple Programming Example tutorial. Once you have confirmed that your system is working, then proceed through the following steps. The same source project is used for all tutorials.


Confirm Debugging License

All versions of the J-Link Debug Probe support full programming of the PIC32, but some versions of the probe require additional licensing for debugging. Those devices that do not already include the license (such as the J-Link BASE probe) will temporarily grant you a license. Each time you terminate a session and start a new one, you will have to request the license again.


Confirm Software Breakpoints are Enabled

Because the J-Link Debug Probe is able to place software breakpoints into RAM, breakpoints are extremely fast and there is no danger of wearing out the flash memory as would be the case with conventional flash based software breakpoints. For these reasons, Software Breakpoints are automatically enabled when the J-Link is chosen as the programmer/debugger tool. To confirm this, check that the project dashboard shows Unlimited BP (S/W): Enabled as shown in the figure below:




Set Breakpoints, Build Debug Project

Build the debug version of the project by clicking on the Build Debug Session icon, then set several breakpoints by clicking on the left margin as shown below:



Run and Confirm

Run and confirm that execution stops at each breakpoint by observing the location of the cursor, and the behavior of the LEDs.


Using the SEGGER J-Link as a debugger is that simple. You will notice that if you are using the 4-wire interface that the entire system is noticeably faster than any other programmer/debugger. 2-wire is slower due to the JTAG emulation, so it is recommended that you use 4-wire whenever possible. The only other consideration is that you may need to upgrade your J-Link Debug Probe by acquiring a permanent debugging license through SEGGER's link to *** Additional Software ***.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.