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

  • Step-By-Step Tutorial: Installing Eclipse IDE
  • Remote Pair Programming with IntelliJ, Eclipse and VS Code
  • How to Debug the Spring Boot Application in Eclipse? [Video]
  • Testing Jedis API Using Junit Test Case in Eclipse IDE

Trending

  • Advancing Your Software Engineering Career in 2025
  • Navigating Change Management: A Guide for Engineers
  • Dropwizard vs. Micronaut: Unpacking the Best Framework for Microservices
  • Building an AI/ML Data Lake With Apache Iceberg
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Using Eclipse to Program Binary Files to an Embedded Target

Using Eclipse to Program Binary Files to an Embedded Target

In this post, we take a look at how you can use your Eclipse IDE to send/flash the binary to a board in a better manner than you might be used to.

By 
Erich Styger user avatar
Erich Styger
·
May. 09, 17 · Tutorial
Likes (0)
Comment
Save
Tweet
Share
11.5K Views

Join the DZone community and get the full member experience.

Join For Free

I’m using Eclipse-based IDEs to develop and debug my embedded applications. This works great, as Eclipse has all the necessary tools to edit, build and debug it. But when it comes just to downloading/flashing a binary to the board, then things are pretty much specific to the tools used. With the advent of the new MCUXpresso IDE, here is how that Eclipse IDE can be used for this.

LinkServer GUI Flash Programmer

LinkServer GUI Flash Programmer

The normal way in Eclipse to download a binary to the target is to use the debugger with a so-called launch (or debug) configuration. That launch configuration needs a ‘project’, so programming a board without a project is not the usual thing. But there are ways to download and program an application without a project. I show this here using the NXP MCUXpresso IDE (V10.0.0), but some ways are applicable to, say, using the Kinetis Design Studio (V3.2.0) or if using the GNU ARM Eclipse plugins.

Binaries

There are different file formats that can be used to program a microcontroller:

  • ELF/Dwarf: This is the normal output format of the linker. Typical extensions are .elf, .abs, or .afx. This file format has the code and data, plus the debug information (which is *not* downloaded to the target and is only used for debugging).

That ELF/Dwarf file usually gets converted into different binary formats more suitable for programmers or boot loaders, and they do not include the debug information:

  • S19/S-Record: textual file format (type, address, size, code, checksum). Typical extensions are .s19, .srec or .sx.
  • Intel Hex: textual file format (similar representation as S19). Typical extension is .hex.
  • Binary: In this format, the data is written in binary form, without address information. It is basically a ‘memory dump’.

Each format has its own pros and cons, see S-Record, Intel Hex, and Binary Files for a more detailed overview.

To generate the different formats:

  • MCUXpresso IDE: see MCUXpresso IDE: S-Record, Intel Hex, and Binary Files
  • Kinetis Design Studio or using GNU ARM Eclipse: see Binary (and S19) Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins
  • Converting, merging, and manipulating binary files: I use the SRecord tool (for all kind of other formats, too!), see CRC Checksum Generation with ‘SRecord’ Tools for GNU and Eclipse and Merging S19 Files

With using the MCUXpresso IDE, there is a LinkServer GUI Flash Programmer (see Using the LPCXpresso V2/V3 Boards to Debug an external Board):

LinkServer GUI Flash Programmer

LinkServer GUI Flash Programmer

In that dialog, I can simply specify the binary I want to download. But there are the following restrictions:

  • Only ELF/Dwarf and binary files supported (e.g. no S19 or Intel Hex files).
  • Only works with the NXP LinkServer debug connection (LPC-Link, LPC-Link2, CMSIS-DAP) (e.g. no support for Segger J-Link or P&E Multilink).

Using Launch Configuration

The other approach is to use a launch configuration. This actually would be the same as using a normal debug session.

In Kinetis Design Studio V3.2.0, there is a ‘Flash from file’ toolbar button. It is basically the same as using a special launch configuration. As it might interfere with the normal Eclipse launch configuration, I’m not using that way anymore.

To create a new launch/debug configuration, I can duplicate an existing one (matching my device):

Duplicate Launch Configuration

Duplicate Launch Configuration

For a P&E debug connection (MCUXpresso IDE or e.g. Kinetis Design Studio), specify a dummy project and the binary to download (use the ‘Browse’ button):

PnE Binary to Download

PnE Binary to download

All types of files (ELF/Dwarf, S19, Binary, and Intel Hex) are supported by the P&E launch configuration.

In the startup options, I have to disable the debug (symbols) usage. Alternatively, I could specify the binary file here, too:

PnE Startup Options

PnE Startup Options

Then I can use the normal ‘debug’, which will use that binary file specified to be programmed. If I want only to download and skip the ‘debug’ step, then I can use the approach described in Emulating Eclipse ‘Run’ with ‘Debug’ Configuration.

The same approach is used for the Segger J-Link debug connection (Kinetis Design Studio, or with the GNU ARM Eclipse plugins installed in MCUXpresso IDE, see MCUXpresso IDE: Importing Kinetis Design Studio Projects).

Specify the binary file in the Main tab:

Binary File in Segger Launch Configuration

Binary file in Segger Launch Configuration

The following files are supported: ELF/Dwarf, S19, and Intel Hex. Binary files (at least at the time of this article) are not supported.

In the ‘Startup’ settings, disable loading the symbols:

Segger Startup Tab

Segger Startup tab

Summary

Currently, users of the GNU ARM Eclipse plugins (e.g. Kinetis Design Studio, or if you install them into MCUXpresso IDE) have the most flexible options to download binaries to the target. For the GNU ARM Eclipse plugins and the P&E plugin, all I need is to specify the binary file, and P&E is able to handle ELF/Dwarf, S19, Binary, and Intel Hex, while Segger is behind with supporting Binary.

If using the standard MCUXpresso IDE V10.0.0, then there is the LinkServer dialog, which supports the LPC-Link2/Link connections. For P&E, the support is the same as with the GNU ARM Eclipse Plugins. For Segger, I can install the GNU ARM Eclipse plugins or use the Segger external tools to download binaries.

Because ‘programming binary files’ is not a standard feature of Eclipse, every vendor comes up with its own ways. If such an option or extension is not present, you still can try using a normal launch configuration, but the debug plugin has to accept a binary without debug information. Or use an external tool outside Eclipse.

Happy Binaring!

Eclipse Debug (command) Binary file Integrated development environment GNU Arm (geography) Download

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

Opinions expressed by DZone contributors are their own.

Related

  • Step-By-Step Tutorial: Installing Eclipse IDE
  • Remote Pair Programming with IntelliJ, Eclipse and VS Code
  • How to Debug the Spring Boot Application in Eclipse? [Video]
  • Testing Jedis API Using Junit Test Case in Eclipse IDE

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!