PEmicro Blog

NXP: Multilink/Cyclone Debug with NXP's S32 Design Studio for ARM IDE

Aug 27, 2020

NXP 's S32 Design Studio for ARM provides a comprehensive enablement platform for ARM development with full integration of PEmicro’s GDB Server for ARM devices. This provides advanced debug capabilities via PEmicro’s Multilink, Cyclone, and embedded OpenSDA debug interfaces.

These features include:

  • Multicore debugging
  • SWO power measurement and ITM support for M-core based ARM device
  • Hardware breakpoints
  • Watchpoints
  • Semihosting
  • Ability to attach to running target
  • Ability to provide target power
  • Remote debug

...and more.

Launching A Debug Session

It's incredibly simple to launch a debug session via PEmicro’s debug probes with S32 Design Studio. After compiling a project, a debug configuration should be opened 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”.

Figure 1. To Select Debug Configurations.

 

Figure 2. Hardware Settings Under Debug Configurations. 

Modifying Debug Settings

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

  • Automatically provide/switch power to the target MCU
  • SWO/Power measurement feature enablement
  • Memory region preservation during programming
  • The application object files to be programmed and debugged
  • Any additional object files to be programmed into the device (bootloaders, etc.)
  • Whether to reset/program a target MCU or to attach (hotsync) to a running device
  • Semihosting options allowing running code to emit debug messages
  • Temporary breakpoints
  • MCU device selection
  • Debug probe selection via USB or Ethernet
  • Initialization scripts

Instead of modifying an existing launch configuration, a new debug configuration can be created in the Debug Configuration window by double-clicking the “GDB PEmicro Interface Debugging” title. This will create a new configuration which can subsequently be renamed and modified.

Figure 3. Double-click the “GDB PEmicro Interface Debugging” Title to Create a New Configuration. 

Minimum Configuration Steps

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:

  1. Debug hardware interface
  2. MCU device part number
  3. Project and application binary to launch
  4. Link to the GDB client executable

Debug Hardware Interface

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 and OSBDM debug hardware embedded on many NXP development boards. 

Figure 4. Debug Hardware Interface Selection.

PEmicro’s USB and local Ethernet devices are automatically detected. Remotely networked Ethernet debug interfaces may be specified via their IP address. 

MCU Device Part Number

Next, the user should select the specific ARM device to be debugged/programmed. PEmicro currently supports the following automotive device families from NXP microprocessors: S9KEAZxxx, MAC57D5xx, MWCTx, S32K1xx, S32K2xx, S32K3xx, S32V23x, SJA1110x.

Figure 5. Device Selection 

Project & Application Binary to Launch

When creating a new debug configuration, the user should ensure that a path to a GDB Client is specified under GDB Client Setting within debug configuration. This path is usually pre-populated within examples and SDK projects created by S32DS IDE’s project wizard.

Figure 6. GDB Client Path Specification 

Link to GDB Client Executable

Finally, prior to launching a debug session, the user should make sure that the appropriate project and C/C++ application object to debug are properly specified in the Main Tab. Please note that during a single core debug session, only a single C/C++ Application object file is specified. At the same time, for multi-core projects a user should specify additional object files for secondary cores on the Main tab of the primary core setup. In a multi-core project, object files for primary and secondary device cores are programmed into device via a primary core debug session.

Figure 7. Object File Specification 

In a multi-core device configuration, the primary core is used to program and configure all device cores for further debugging. This requires the secondary cores to be launched in a special “Attach” mode to ensure that no additional programming takes place, and the state of pre-initialized device cores is not disturbed. The “Attach to Running Target” runtime option can be found in the Startup tab of Debug Configuration. For the primary core debug configuration the “Attach to Running Target” check box should be left blank.

Figure 8. Attach to Running Target Runtime Option 

After specifying all these options, a new debug session can be launched. For more information about PEmicro GDB launch configuration options, please refer to the GDB Server User Manual for ARM (direct download link).

PEmicro is continually adding support and features to the PEmicro GDB Eclipse plugin-ins for Power and ARM devices.

Configuring and Using SWO Power, Printf and ITM features

PEmicro is pleased to announce that the Multillink and Multilink FX debug probes have added real-time SWO data capture as well as power consumption monitoring in Eclipse-based IDEs such as S32DS for ARM and MCUXpresso. SWO data capture includes high speed printf() output from running code, R/W accesses to memory and variables, interrupt execution, and more. The power consumption monitoring of the Multilink FX runs up to 250Ksamples/sec with a current detection range of 1mA to over 200mA. 

A detailed blog post with in-depth description of all SWO based features and settings can be accessed at the following link:

http://www.pemicro.com/blog/index.cfm?post_id=165

In order to enable SWO device configuration in an S32 Design Studio for ARM M-core based project, please select Real-time printf with ITM option from the I/O Support selection within the project wizard:

Figure 9. SWO I/O Support Project Configuration

Once the project is created, SWO PEmicro dialogs can be found and opened by going to:

Windows -> Show View -> Others -> PEmicro 

and selecting from a list of available PEmicro dialogs.

Figure 10. SWO PEmicro Dialog Selection

SWO PEmicro features are only supported by more recent debug interfaces:

  • Multilink ACP Rev. B and later
  • Multilink Universal Rev. D and later
  • Multilink Universal FX Rev C and later

Installing The Latest GDB Server Plug-In

In order to install the latest PEmicro plugin into S32 Design Studio for ARM, 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 Power plugin.

Figure 11. PEmicro Plugin Update Selection 

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

Tags related to this Blog Post

Cyclone     Cyclone FX     Multilink     Multilink FX     GDB Server     ARM     NXP     Debug