libGIS - Free Atmel Generic, Intel HEX, and Motorola S-Record Parser Routines
Download the latest version of libGIS: libGIS-1.0.0.tar.gz.
New sample program added 12/25/2006: sizeGIS.c
sizeGIS: Counts the total number of data bytes stored in an Atmel Generic, Intel HEX8, or Motorola S-Record formatted file–useful for finding out exactly how much memory the formatted file will use when it is flashed/transferred/downloaded/etc.
ChangeLog
Version 1.0.0 - 24-Dec-2006
- Initial Release
libGIS README
24-Dec-2006
libGIS isn’t really a library, it’s more of a collection of utility functions to create, read and write Atmel Generic, Intel HEX8, and Motorola S-Record formatted files. In fact, libGIS isn’t compiled as a library at all, since the file formats it supports are so specific and the source code for each file format is contained in two files. But, I needed to give it some sort of name…
The reason I wrote libGIS was because I wanted a clean, flexible, and easy-to-use set of functions to deal with the nasty parsing of the formatted binary files. I’m currently writing an AVR disassembler for my own education, which explains why I have code to parse Atmel Generic formatted files. More importantly, libGIS supports Intel HEX8 and Motorola S-Record formatted files, which are undoubtedly the most popular in use with embedded systems.
libGIS is very convenient for disassembler, assembler, binary file converter, and other related projects. It is written in C (tested with gcc), but can also be compiled with a C++ compiler (such as g++), which means it can be implemented in all C/C++ projects requiring parsing of such formatted files. libGIS uses standard C libraries.
libGIS is clean and tiny. Each file format is supported with two files, one the C source code and the other the C header file, which makes compiling whichever format you need to support very easy. The interface to the utility functions is extremely straight forward as demonstrated by the included testGIS.c program.
The code of each file format parser has a structure to store record information and 4-5 basic functions to create, read, write, print, and checksum (for Intel HEX8 and Motorola S-Record) records. The error handling in libGIS is solid, and will never leave you out of the dark as the possible error codes and what they mean are clearly defined in the header file of the format parser you’re using.
Remember that libGIS is a low-level interface to the formatted files, and it will not automatically generate, for example, extended addresses in the Intel HEX8 format, or the header record in the S-Record format. libGIS helps in the actual writing and reading of the raw records, not dealing with the kind of content going into them (but still adhering to the record and field size specifications). Perhaps in a future release I’ll provide built-in support for making the extended address records and similar special records easier, but for now libGIS will be very simple, clean, flexible, and adaptable to any project.
libGIS is public domain. You can use it wherever and do anything you want with it. I take no responsibility for any pigeons it downs or anything.
Here is a link to the doxygen-generated documentation that should make using libGIS very clear: http://www.frozeneskimo.com/libGIS/libGIS-1.0.0-docs/files.html
Download version 1.0.0 of libGIS here: libGIS-1.0.0.tar.gz
This package includes the parsing for the following formats:
Atmel Generic format: atmel_generic.c and atmel_generic.h
Intel HEX8 format: ihex.c and ihex.h
Motorola S-Record format: srecord.c and srecord.h
Also included is a test program (testGIS.c, with a Makefile to compile it) that prints all of the records contained in a Atmel Generic, Intel HEX8 or Motorola S-Record formatted file, documentation in PDF and html formats, and the README containing all of this.
Please email me (vsergeev at gmail.com) any bugs, problems, or suggestions you encounter while using libGIS, they are highly appreciated.
I don’t plan on supporting any of the other minor and lesser used formats, as I think that would be a waste of time. If you have any ideas to help improve libGIS, please let me know.
Print This Page