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

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

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

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • The Full-Stack Developer's Blind Spot: Why Data Cleansing Shouldn't Be an Afterthought
  • Data Quality: A Novel Perspective for 2025
  • Why Database Migrations Take Months and How to Speed Them Up
  • Unmasking Entity-Based Data Masking: Best Practices 2025

Trending

  • Performing and Managing Incremental Backups Using pg_basebackup in PostgreSQL 17
  • MySQL to PostgreSQL Database Migration: A Practical Case Study
  • Integration Isn’t a Task — It’s an Architectural Discipline
  • Beyond ChatGPT, AI Reasoning 2.0: Engineering AI Models With Human-Like Reasoning
  1. DZone
  2. Data Engineering
  3. Data
  4. Generating Intel Hex Files Based on a Given Length Using Srec_Cat

Generating Intel Hex Files Based on a Given Length Using Srec_Cat

Learn more about standard binary files and how you can control data based on length with Intel Hex.

By 
Erich Styger user avatar
Erich Styger
·
Updated Jul. 03, 19 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
16.2K Views

Join the DZone community and get the full member experience.

Join For Free

The 'standard' binary files for many tools are S19, binary, or Intel Hex files. Especially for S19 and Intel Hex, it can be useful to control the amount of data per line. By default, the GNU objcopy creates files with a line length of 44 characters:

Image title

Default objcopy binary file line length

But it is possible to have Intel Hex files with a custom line length using the SRecord utility, and this is what this article is about.

First, use the GNU ' objcopy' to generate a Intel Hex file (or use the MCUXpresso IDE for this). The following line generates the Intel Hex file from an ELF/Dwarf (.axf) file:

arm-none-eabi-objcopy -v -O ihex app.axf app.hex


This generates a 'default' Intel Hex file with a line length of 44 characters:

Image title

Default objcopy binary file line length

Then, use the srec_cat tool from the SRecord package with the  -line-length option:

srec_cat app.hex -intel -output new.hex -Intel -line-length=64


With this, I have an Intel Hex file with a different line length — in this case, 64 characters:

Image title

Intel Hex File with longer lines

That's it!

The SRecord tools are very versatile to convert and manipulate binary files. To learn more, have a look at the links below.

Happy Inteling!

Links

  • SRecord Tool on SourceForge
  • GNU objcopy
  • MCUXpresso IDE: S-Record, Intel Hex, and Binary Files
  • Converting Binary Files to Intel Hex Format with the SRecord Tool
  • S-Record, Intel Hex, and Binary Files
  • Merging S19 Files wir srec_cat
Binary file Data (computing) Hex editor

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

Opinions expressed by DZone contributors are their own.

Related

  • The Full-Stack Developer's Blind Spot: Why Data Cleansing Shouldn't Be an Afterthought
  • Data Quality: A Novel Perspective for 2025
  • Why Database Migrations Take Months and How to Speed Them Up
  • Unmasking Entity-Based Data Masking: Best Practices 2025

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!