DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Culture and Methodologies
  3. Career Development
  4. Remote Debugging With USB-Based JTAG/SWD Debug Probes

Remote Debugging With USB-Based JTAG/SWD Debug Probes

Learn more about remote debugging with the USB-based JTAG/SWD probes.

Erich Styger user avatar by
Erich Styger
·
Mar. 05, 19 · Tutorial
Like (6)
Save
Tweet
Share
7.93K Views

Join the DZone community and get the full member experience.

Join For Free

For some projects, it is not possible to have the device under debug available on my desk — the board might be in another room, on another site, or in a place where physical access is not possible or even dangerous. In that case, an IP-based debug probe (see Debugging ARM Cores with IP based Debug Probes and Eclipse) is very useful, as long as I can access its IP address, which works fine. It is an excellent solution even if the board is moving or rotating. You can hook it up to a WLAN access point and still use it as it would be on my desk.

But what if I have a debug probe only connected to USB? This article shows how to turn a USB debug probe into an IP-based debug solution. That way, I can easily debug a board remotely while connected to the network:

IP Based Debugging with USB Debug Probe

IP Based Debugging with USB Debug Probe

But IP-based debug probes are more expensive than USB based ones.

LAN Port

LAN Port

Such a probe is a very good investment, but what if you don't have one available?

Overview

The block diagram below shows how to set up a remote debug connection to a board:

Remote Debugging

Remote Debugging

A server PC is configured to run a GDB server talking to the local (USB) Debug probe. With this, any host PC with Eclipse and GDB Client can connect to it over TCP/IP and debug the board.

Preconditions

All I need is:

  • A SEGGER J-Link or P&E Multilink debug probe. This can handle any external probe or use an evaluation board to debug probe a circuit (e.g. J-Link OpenSDA or P&E OpenSDA)
  • A host machine attached to this debug probe. That host machine needs to be accessible on the network
  • Eclipse CDT with a J-Link or P&E support, e.g. the GNU MCU Eclipse plugins (they are used e.g. in NXP Kinetis Design Studio) or the NXP MCUXpresso IDE (I'm using 10.3.1 in this article)

Server PC

On the server PC, I need to start the GDB server (see Command Line Debugging with GDB).

For Segger, I can use the JLinkGDBServerCL (Command Line) or JLinkGDBServer (GUI). On Windows, it uses a GUI, which shows the configuration:

J-Link GDB Server Configuration

J-Link GDB Server Configuration

Then, it will wait for a remote debugger connection:

GDB Server Waiting for Connection

GDB Server Waiting for Connection

For P&E, I have to start the 'pegdbserver_console':

pegdbserver_console.exe in NXP MCUXpresso IDE 10.3.1

pegdbserver_console.exe in NXP MCUXpresso IDE 10.3.1

You need to know the hostname (or IP address) of that host machine in the next step. In my case, the host machine has the following IP address: 192.168.0.112.

Host PC

On the Host PC, using Eclipse CDT with the GNU MCU Eclipse plugins, uncheck 'start the J-Link GDB Server locally' and enter the remote IP address (default port is 2331):

Remote Debugging in GNU MCU Eclipse

Remote Debugging in GNU MCU Eclipse

In MCUXpresso IDE 10.3.1, enter the IP address and use manual server startup with 'start server' option disabled:

Remote Debugging in MCUXpresso IDE 10.3.1

Remote Debugging in MCUXpresso IDE 10.3.1

For P&E, there is a similar setting here:PEMicro Remote GDB Settings

PEMicro Remote GDB Settings

Remote Debugging

With this, I can debug the remote target as it would be connected locally. The SEGGER Server will show the connection status like this:

Connected to GDB Server

Connected to GDB Server

And with this, I can do some remote debugging:

Remote Debugging with NXP MCUXpresso IDE

Remote Debugging with NXP MCUXpresso IDE

Summary

It is very easy to do IP-based remote debugging. I need to run the P&E or SEGGER GDB server on a machine, and then, I can connect from everywhere to that server and debug that board without having physical access to it. This is especially useful with sharing a board on a machine or if that board is not accessible otherwise. The price (instead of using a real IP-based debug probe) is that I need a remote host machine. If there is no IP-based debug probe at hand, this should be a very doable solution. Of course, with high-latency networks, this will impact debug performance, but this is expected.

The approach described here needs a network connection which usually is available inside a company network, but not to the outside world behind the firewalls. For debugging boards beyond the firewall I can use a SEGGER server, see Remote Board Debugging: J-Link Remote Server with Eclipse

Happy IPing!

Links

  • Debugging ARM Cores with IP based Debug Probes and Eclipse
  • Command Line Debugging with GDB
  • Remote Board Debugging: J-Link Remote Server with Eclipse
  • GNU MCU Eclipse
  • MCUXpresso IDE
  • MCUXpresso IDE V10.3.1 available
  • SEGGER
  • PEMicro
Debug (command) workplace Host (Unix) Eclipse

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Choose the Right Streaming Database
  • Microservices Testing
  • Using Swagger for Creating a PingFederate Admin API Java Wrapper
  • 19 Most Common OpenSSL Commands for 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: