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. Coding
  3. Frameworks
  4. Using GDB Server Monitor Commands From the Eclipse GDB Console

Using GDB Server Monitor Commands From the Eclipse GDB Console

With Eclipse as your IDE, it is very easy to debug an application on a board.

Erich Styger user avatar by
Erich Styger
·
Dec. 12, 18 · Tutorial
Like (2)
Save
Tweet
Share
12.72K Views

Join the DZone community and get the full member experience.

Join For Free

With Eclipse as your IDE, it is very easy to debug an application on a board. Still sometimes, it is useful to get one level down and control the GDB server directly.

Monitor Flash Download

Monitor Flash Download

In Command Line Programming and Debugging with GDB, I used a GDB client and server for command line debugging. There is an easy way to combine this approach with Eclipse: have Eclipse do the GDB server launching and use the Eclipse debug console to control the target as needed. This can be very useful during bootloader development, for example, to load a binary or PIC (Position Independent Code) fragment into RAM.

The steps below are using the NXP MCUXpresso IDE 10.2 with the SEGGER J-Link V6.40, but it can work the same or very similar for any Eclipse-GDB combination.

First, make sure you have a connection to the target (e.g. with an attach or during a normal debug session).

If needed, make a connection to the remote target:

target remote localhost:2331

connecting to target

Connecting to target

Next, I make sure the debug monitor knows my target device:

monitor device MK64FN1M0XXX12


Because the GDB Debugger console does not report everything back, it makes sense to have a check in the console for the debug server to see what is going on:

Device Selected

Device Selected

To halt and reset the device:

monitor reset

Monitor Reset

Monitor Reset

Select the device for the flash programming:

monitor flash device = MK64FN1M0XXX12

Monitor Flash Device

Monitor Flash Device

To turn on flash downloading:

monitor flash download = 1

Monitor Flash Download

Monitor Flash Download

And finally, we need to flash the binary to the microcontroller:

load Debug/MK64FN1M0xxx12_Project.axf 0x8000

Loaded Binary

Loaded Binary

The offset at the end (0x8000) is an offset used where to load the binary. In my above case, the binary is linked to address 0x0000’0000 compiled as PIC (Position Independent Code), and that way, I can load it to a different address. I find that useful especially dealing with boot loaders.

Happy monitoring!

Helpful Links

  • Command Line Programming and Debugging with GDB
Monitor (synchronization) Eclipse Console (video game CLI) Command (computing)

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

  • The 31 Flavors of Data Lineage and Why Vanilla Doesn’t Cut It
  • PostgreSQL: Bulk Loading Data With Node.js and Sequelize
  • Hidden Classes in Java 15
  • Implementing Adaptive Concurrency Limits

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: