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
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
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. GDB All-Stop and Non-Stop Mode with LinkServer

GDB All-Stop and Non-Stop Mode with LinkServer

Learn more about the GDB support for All-Stop and Non-Stop modes with LinkServer

Erich Styger user avatar by
Erich Styger
·
Feb. 19, 19 · Tutorial
Like (3)
Save
Tweet
Share
6.44K Views

Join the DZone community and get the full member experience.

Join For Free

GDB supports a mode that allows the GDB debug client to read memory while the target is running. This allows features like ‘live variables.' That way, I can see the variables refreshed and changing over time without halting the target. Another functionality that comes with this feature is to check stopped threads or to see all threads in the system.

multiple freertos threads in debug view

multiple FreeRTOS threads in debug view

Debugging i.MX RT1064 with NXP LPC-Link2

Debugging i.MX RT1064 with NXP LPC-Link2 using LinkSever

When creating the MCUXpresso IDE, a new launch configuration for LinkServer, I have the opportunity to select the mode I want to use:

connect to target

connect to target

Depending on Non-Stop or All-Stop, different features are available with the LinkServer to debug the connection.

Non-Stop Mode

This is the default mode. The default can be changed in the workspace preferences:

enable non-stop mode in workspace preferences

enable non-stop mode in workspace preferences

If in the Non-Stop mode, this can be verified in the Console with the messages produced by the LinkServer:

gdb non-stop mode

gdb non-stop mode

All-Stop Mode

In the All-Stop mode, this can be verified in the Console with the messages produced by the LinkServer:

all-stop mode

all-stop mode

Comparison All-Stop and Non-Stop Mode

The following gives an overview of what is supported in each mode:

Non-Stop (Default):

Non-Stop mode is the ability to access variables while the target is running (Live Variables View) and plot them over time (see this article).Plot Variables over Time

Plot Variables over Time

Only the currently active FreeRTOS thread is shown in the Debug view:debug threads in non-stop mode

debug threads in non-stop mode

All-Stop:

The All-Stop mode cannot access variables while the target is running— No Live Variables View.

All FreeRTOS threads are shown in the debug view:multiple freertos threads in debug view

multiple FreeRTOS threads in debug view in all-stop mode

Obviously, for debugging FreeRTOS applications, I prefer the All-Stop mode. But then, I don’t have the Live Variables view available with LinkServer.

Eclipse Launch Configurations: Switching Between All-Stop and Non-Stop Mode

One simple way is to delete any existing LinkServer launch configuration. Next time, it will do a probe scan and give me the opportunity to select which mode I want to use.

linkserver launch configuration

linkserver launch configuration

Another way is to change the launch configuration setting. For this, I double-click on the launch configuration to open it. I have to change two settings.

One setting is in the Debugger > Main tab:

non-stop mode setting in launch configuration

non-stop mode setting in launch configuration

For the ‘non-stop’ mode, you need to have that checkbox checked.

The other setting is under Target configuration > Edit Scripts. Press that button:

target configuration edit scripts

target configuration edit scripts

This gives a dialog to edit the scripts:

edit scripts dialog

edit scripts dialog

Below are the Init commands for all-stop mode:

set remotetimeout 60000
##target_extended_remote##
set mem inaccessible-by-default ${mem.access}
mon ondisconnect ${ondisconnect}
set arm force-mode thumb
${load}


And here are the ones for non-stop:

set non-stop on
set pagination off
set mi-async

set remotetimeout 60000
##target_extended_remote##
set mem inaccessible-by-default ${mem.access}
mon ondisconnect ${ondisconnect}
set arm force-mode thumb
${load}


So, the difference is that the three commands are marked in red. So what I do is comment/uncomment these commands in that dialog:

commented for full stop

commented for a full stop

Summary

GDB offers Non-Stop and All-Stop mode. Non-Stop allows us to read variables while the target is running, and the All-Stop mode is required for the LinkServer connection to show all FreeRTOS threads. I can select the mode at Eclipse launch configuration creation or later with two settings in the launch configuration itself.

Happy Stopping!

Additional Links

  • GDB All-Stop Mode
  • GDB Non-Stop Mode
  • MCUXpresso IDE 10.3.0 release: New NXP MCUXpresso IDE V10.3.0 Release
Debug (command) FreeRTOS Command (computing) Dialog (software) Integrated development environment Console (video game CLI) Eclipse Release (agency) Connection (dance)

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

  • Load Balancing Pattern
  • How to Create a Real-Time Scalable Streaming App Using Apache NiFi, Apache Pulsar, and Apache Flink SQL
  • 7 Awesome Libraries for Java Unit and Integration Testing
  • Distributed SQL: An Alternative to Database Sharding

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: