Author Topic: Intel Hex File viewer/editor  (Read 14101 times)

0 Members and 1 Guest are viewing this topic.

Offline forrestc

  • Supporter
  • ****
  • Posts: 545
  • Country: us
Intel Hex File viewer/editor
« on: October 27, 2016, 11:08:42 am »
I occasionally (like right now) need to dig into an Intel Hex file.   Although I can open it up in a text editor and read it manually, I would rather use a tool intended for this purpose.

Does anyone know of a tool which is designed for this?

One note:  I have had luck over the years loading these into various programming tools and viewing the resulting hex image.  The problem with this hex file in particular is that it apparently has generated data outside the address range that the tool I'd normally use, which is why I need to dig into this with something else.  Unfortunately, this is a very large .hex file so I'm having problems finding the problem.  I might end up just writing some code to find the error, but would rather not go to those lengths.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1409
  • Country: dk
Re: Intel Hex File viewer/editor
« Reply #1 on: October 27, 2016, 02:27:11 pm »
I occasionally (like right now) need to dig into an Intel Hex file.   Although I can open it up in a text editor and read it manually, I would rather use a tool intended for this purpose.

Does anyone know of a tool which is designed for this?

One note:  I have had luck over the years loading these into various programming tools and viewing the resulting hex image.  The problem with this hex file in particular is that it apparently has generated data outside the address range that the tool I'd normally use, which is why I need to dig into this with something else.  Unfortunately, this is a very large .hex file so I'm having problems finding the problem.  I might end up just writing some code to find the error, but would rather not go to those lengths.

Convert it to binary (srectools)
http://srecord.sourceforge.net/

Use a standard hex file editor , and convert it back (srectools)

/Bingo
 

Offline leeatljs

  • Contributor
  • Posts: 24
  • Country: gb
Re: Intel Hex File viewer/editor
« Reply #2 on: October 27, 2016, 02:57:25 pm »
Tiny Hexer from http://www.mirkes.de/ imports / exports intel hex, allows editing, comparing, all sorts of stuff.
Is also a general hex editor.
Does Motorola S records too.
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 767
  • Country: gb
Re: Intel Hex File viewer/editor
« Reply #3 on: October 27, 2016, 03:31:47 pm »
You could just use the application software for a device programmer.

e.g. Galep software in demo mode does what you want http://www.conitec.net/hardware/down/G5setup_20638.exe
 
The following users thanked this post: wraper

Offline stj

  • Super Contributor
  • ***
  • Posts: 2156
  • Country: gb
Re: Intel Hex File viewer/editor
« Reply #4 on: October 28, 2016, 05:41:19 pm »
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2528
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Intel Hex File viewer/editor
« Reply #5 on: October 28, 2016, 06:12:37 pm »
 I made a custom grammar file for Synalyze It! Pro, which is a very slick macOS hex editor. (It's in the Mac App Store, fairly expensive but you can also get the non-pro version for $10, which will work for the majority of users.)

There's also a sister application for Windows/Linux that uses the same grammar files. It's called Hexinator.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7261
  • Country: us
    • SiliconValleyGarage
Re: Intel Hex File viewer/editor
« Reply #6 on: October 28, 2016, 06:13:12 pm »
You could just use the application software for a device programmer.

e.g. Galep software in demo mode does what you want http://www.conitec.net/hardware/down/G5setup_20638.exe

jup. best option. get the control software for a dataman programmer. those can run in demo mode. load hex file, edit , save back as hex file.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline ehughes

  • Frequent Contributor
  • **
  • Posts: 369
  • Country: us
Re: Intel Hex File viewer/editor
« Reply #7 on: October 29, 2016, 01:31:58 am »
 

Offline HwAoRrDk

  • Frequent Contributor
  • **
  • Posts: 643
  • Country: gb
Re: Intel Hex File viewer/editor
« Reply #8 on: October 29, 2016, 01:04:09 pm »
Tiny Hexer from http://www.mirkes.de/ imports / exports intel hex, allows editing, comparing, all sorts of stuff.
Is also a general hex editor.
Does Motorola S records too.

While Tiny Hexer is a great program, and does do that, don't download it from that link. The original author shut down his website years ago and what exists now is just a scummy domain holding page full of ads.

Best place to find and download it is from a shareware/freeware archive site. And even then be very careful.
 

Offline newbrain

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: se
Re: Intel Hex File viewer/editor
« Reply #9 on: October 29, 2016, 01:52:45 pm »
If you happen to like Emacs, there's this.
It shows the address (while in data) or the field type you are on on the mode line, and can recalculate the checksum after editing.


Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline jesuscf

  • Regular Contributor
  • *
  • Posts: 207
  • Country: ca
Re: Intel Hex File viewer/editor
« Reply #10 on: October 30, 2016, 01:45:57 pm »
Quartus II Prime also comes with a nice Intel-Hex editor.  Of course, only if you have it installed already as it is quite a big program.
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 

Offline jesuscf

  • Regular Contributor
  • *
  • Posts: 207
  • Country: ca
Re: Intel Hex File viewer/editor
« Reply #11 on: October 30, 2016, 02:32:33 pm »
Just came across this one:

http://www.catch22.net/software/hexedit

Looks nice and includes source code:

http://github.com/strobejb/HexEdit
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 
The following users thanked this post: BravoV

Offline andy1

  • Contributor
  • Posts: 25
  • Country: fi
Re: Intel Hex File viewer/editor
« Reply #12 on: October 30, 2016, 05:29:03 pm »
There is also Kaitai Struct http://kaitai.io/ with which can quite quickly code a parser for this kind of reading, also has visualizer which can open the file and show the structures like in hex editor or you can just make a nice python etc. parser with it.
 

Online wraper

  • Supporter
  • ****
  • Posts: 10575
  • Country: lv
Re: Intel Hex File viewer/editor
« Reply #13 on: October 30, 2016, 05:44:52 pm »
Most of the "HEX" editors suggested certainly are pretty useless for editing intel HEX. Even if they can import/export intel HEX, they do it in crippled way. They will shift data address space to make start address being 0, although it wasn't in the original file and will fill any empty address space too. The result of it will be a useless file which cannot be programmed to target device.
 

Offline 0xdeadbeef

  • Super Contributor
  • ***
  • Posts: 1342
  • Country: de
Re: Intel Hex File viewer/editor
« Reply #14 on: October 30, 2016, 05:48:46 pm »
Also note that a hex file of an 32bit controller can result in a BIN file of 4Gigabyte. A typical hex editor will fill all the gaps with zeroes, even the initial gap, if e.g. the first data is located at address 0x40000000.
This quickly results in unusable crap. Then again, for typical microcontroller stuff where the 1st flash block starts at 0, this might be not an issue.
Trying is the first step towards failure - Homer J. Simpson
 

Offline forrestc

  • Supporter
  • ****
  • Posts: 545
  • Country: us
Re: Intel Hex File viewer/editor
« Reply #15 on: October 31, 2016, 10:38:54 am »
Also note that a hex file of an 32bit controller can result in a BIN file of 4Gigabyte. A typical hex editor will fill all the gaps with zeroes, even the initial gap, if e.g. the first data is located at address 0x40000000.
This quickly results in unusable crap. Then again, for typical microcontroller stuff where the 1st flash block starts at 0, this might be not an issue.

When I originally asked the question, I really was hoping to find effectively a 'sparse file editor'.   I.E. one which works like a hex editor, but only shows lines/addresses which actually exist in the file.   I'm still hopeful.   But I agree - a 'traditional' hex file editor, even one which will read Intel HEX files correctly are not that useful.

I did come across the srecord tools which solved my immediate need - getting a list of all of the ranges which were covered in the .hex file.  I was able to compare these ranges to the memory map of my device and find the mangled linker file which was filling some nonexistent addresses with 0xff's.  Depending on the editor, this may have been invisible - since some editors choose to use 0xff as the fill value instead of 0x00.  Not to mention that this area was up around 0x1FC00000, with other data scattered all around the 4GB memory map - so I would have had a lot of fun finding this needle in the haystack.



 

 

Offline legacy

  • Super Contributor
  • ***
  • Banned!
  • Posts: 4426
  • Country: ch
Re: Intel Hex File viewer/editor
« Reply #16 on: October 31, 2016, 11:51:51 am »
Depending on the editor, this may have been invisible

why don't you write by yourself ?
custom need, custom tool
 

Offline forrestc

  • Supporter
  • ****
  • Posts: 545
  • Country: us
Re: Intel Hex File viewer/editor
« Reply #17 on: November 23, 2016, 01:39:48 am »
Depending on the editor, this may have been invisible

why don't you write by yourself ?
custom need, custom tool

Sorry, just catching up on my posts, been traveling....

Actually this isn't a custom need.   The definition of what I'm looking for is a editor which will open a .hex file, interpret it, and then allow you to view/edit it, without making up data in the process.  This should be something at least a good portion of those who work with .hex files should want/need.

The problem is that the existing tools I've found seem to not work that well for this purpose, specifically because instead of showing only what is in the hex file, they choose to create a very large virtual memory space, fill it with either 0xff or 0x00, and then load the data from the hex file into it.   This effectively creates data which doesn't exist.  Many hex files simply don't include data for the entire memory space of a part, or for many parts, the valid memory space itself isn't contiguous.   Most programming tools which allow you to load .hex files and view/edit it will show you the resulting data they would program - not the exact data included in the .hex file.

So, the tool that is needed is a gui editor for a .hex file which understands the meaning of the .hex file and preserves it.   If the hex file contains 3-4 non-contiguous segments, the editor should display only the data contained in the .hex file, not make up data which isn't contained in the .hex file.
 

Offline jpittner

  • Contributor
  • Posts: 14
  • Country: cz
Re: Intel Hex File viewer/editor
« Reply #18 on: November 23, 2016, 12:38:45 pm »
It should be possible to use objcopy (cross-version like arm-elf/objcopy etc.) to convert the ihex back to elf object file format for given architecture and than use cross-version of objdump to display memory sections, disassemble etc. According to man page, objcopy should be able to convert between any two formats. I gave it a quick test on AVR:
avr-objcopy -O elf32-avr -I ihex project.hex test.out
file test.out
test.out: ELF 32-bit LSB relocatable, Atmel AVR 8-bit, version 1 (SYSV), stripped
avr-objdump -D test.out
...gives assembly section by section
 

Offline micha2070

  • Newbie
  • Posts: 1
  • Country: de
Re: Intel Hex File viewer/editor
« Reply #19 on: June 05, 2018, 10:15:04 am »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf