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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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
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

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Remote Pair Programming with IntelliJ, Eclipse and VS Code
  • How to Debug the Spring Boot Application in Eclipse? [Video]
  • Introducing Graph Concepts in Java With Eclipse JNoSQL
  • Building a Real-Time AI-Powered Workplace Safety System

Trending

  • Chat With Your Knowledge Base: A Hands-On Java and LangChain4j Guide
  • GitHub Copilot's New AI Coding Agent Saves Developers Time – And Requires Their Oversight
  • MCP Servers: The Technical Debt That Is Coming
  • The Future of Java and AI: Coding in 2025
  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.

By 
Erich Styger user avatar
Erich Styger
·
Mar. 05, 19 · Tutorial
Likes (6)
Comment
Save
Tweet
Share
8.8K 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.

Related

  • Remote Pair Programming with IntelliJ, Eclipse and VS Code
  • How to Debug the Spring Boot Application in Eclipse? [Video]
  • Introducing Graph Concepts in Java With Eclipse JNoSQL
  • Building a Real-Time AI-Powered Workplace Safety System

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!