PEmicro Blog

NXP: NXP's MCUXpresso IDE Debug With Fully Integrated PEmicro GDB Server

Apr 06, 2017

NXP's MCUXpresso Integrated Development Environment for LPC and Kinetis microcontrollers features full integration with PEmicro’s GDB Server. This provides advanced debug capabilities via PEmicro’s Multilink, Cyclone, and embedded OpenSDA debug interfaces including: hardware breakpoints, watchpoints, real-time variables, semihosting, FreeRTOS awareness, the ability to attach to a running target, the ability to provide target power, remote debug, and more.

It is incredibly simple to launch a debug session via PEmicro’s debug probes with the MCUXpresso IDE. After compiling a project, click the “Debug ‘Project name’ [Debug]” selection within the MCUXpresso IDE quick start window.

Select Compiled Project in MCUXpresso IDE Quick Start Window

Figure 1. Select Compiled Project in MCUXpresso IDE Quick Start Window

The first time this option is invoked, an auto-detection for existing PEmicro interfaces will be performed by the MCUXpresso IDE. The user should select the appropriate debug interface and click OK. That's all it takes! A debug configuration with default settings is created and the debug session is launched.

Figure 2: Create Default Debug Configuration

Figure 2. Create Default Debug Configuration

While the default debug configuration will work for most hardware configurations, there are many launch settings the user may wish to modify, including :

  • Debug protocol options including SWD, JTAG, Daisy Chaining, and Shift Speed
  • Automatically provide/switch power to the target MCU
  • Memory region preservation during programming
  • The application binary to be programmed and debugged
  • Any additional binaries to be programmed into the device (bootloaders, etc.)
  • Whether to reset/program a target MCU or to attach (hotsync) to a running device
  • Calibration of (trimming) internal clocks for accuracy during programming
  • Partitioning FlexMemory Regions (Flash/EEProm)
  • Semihosting options allowing running code to emit debug messages
  • Temporary breakpoints
  • MCU Device Selection
  • Debug Probe Selection via USB or Ethernet
  • Initialization Scripts

When a debug session is not active, the debug configuration settings can accessed by using the down arrow of the Debug button on the Eclipse button bar and then selecting the “Debug Configurations” option. All PEmicro launch configurations can be found in the “GDB PEmicro Interface Debugging” category of the Debug Configuration window which appears.

 Choose “GDB PEmicro Interface Debugging” in Debug Configurations

Figure 3. Choose “GDB PEmicro Interface Debugging” in Debug Configurations

In addition to being able to modify an existing launch configuration, a new debug configuration can be created in the Debug Configurations window by double-clicking the “GDB PEmicro Interface Debugging” title. This will create a “New_Configuration” which can subsequently be renamed and modified:

Double-click the “GDB PEmicro Interface Debugging” Title

Figure 4: Double-click the “GDB PEmicro Interface Debugging” Title to Create a “New_Configuration

Different launch configurations can be created for different launch scenarios (e.g., one configuration to reprogram the target MCU, and another to attach/hotsync to a running device). The following items, at a minimum, need to be configured in a new configuration in order to launch a debug session:

  • The Debug Hardware Interface
  • The MCU Device Part Number
  • The Project and Application Binary to Launch
  • The Launcher to use (PEmicro GDB Launcher)

The user should begin by selecting the Debug Hardware Interface to be used. The PEmicro GDB server supports debug connections through PEmicro’s USB Multilink debug probes, Cyclone programmers via USB and Ethernet, and OpenSDA debug hardware embedded on many NXP development boards.

Select the Debug Hardware Interface

Figure 5: Select the Debug Hardware Interface

PEmicro’s USB and local Ethernet devices are automatically detected. Remotely networked Ethernet debug interfaces may be specified via their IP address. Next, the user should select the specific MCU device to be debugged/programmed:

Select Specific MCU Device

Figure 6: Select Specific MCU Device

Next, a DSF GDB launcher needs to be selected (either launcher presented is fine; they are just unselected in a new configuration):

Select a DSF GDB Launcher

Figure 7: Select a DSF GDB Launcher

Finally, prior to launching a debug session, the user should make sure that the appropriate project and C/C++ application binary to debug are properly specified in the Main tab:

Check Specifications for Project and C/C++ Application Binary

Figure 8: Check Specifications for Project and C/C++ Application Binary

After specifying all of these options, a new debug configuration can be launched. For more information about PEmicro GDB launch configuration options, please refer to the GDB Server User Manual.

PEmicro is continually adding support for new ARM devices and adding features to the PEmicro GDB Eclipse plug-in.

In order to install the latest PEmicro plug-in into MCUXpresso IDE, or another Eclipse IDE, the user should go to Help -> Install New Software and point the “Work with” dialog box to PEmicro’s update site. Make sure to expand the “PEmicro Software” category and select the appropriate GDB plugin.

Select the Appropriate GDB Plugin

Figure 9: Select the Appropriate GDB Plugin

PEmicro’s Eclipse-based GDB Server plug-in allows developers to use PEmicro’s Multilink and Cyclone interfaces to program and debug ARM processors in many different Eclipse based IDEs. NXP’s MCUXpresso IDE comes fully integrated with PEmicro’s GDB plugin and together they provide the ability to rapidly develop and debug code for NXP's ARM-based devices.

Tags related to this Blog Post

GDB Server     NXP     Debug