GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added support for segment addresing in output hex files by mmajchrzycki · Pull Request #5 · python-intelhex/intelhex

Conversation

@mmajchrzycki

@mmajchrzycki mmajchrzycki commented Apr 20, 2016

Copy link
Copy Markdown

I recently met a problem with application which requires Intel HEX files but with segment addressing instead of linear. So I added another (shex - segment hex) output format for hex files.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mateusz Majchrzycki added 2 commits April 20, 2016 14:23
Mateusz Majchrzycki
Linear address records replaced with segment addres in output fromatting
32d39c0
Mateusz Majchrzycki
Added support for linear and segment addresing modes in output hex files
3284fbc
@bialix

bialix commented Apr 20, 2016

Copy link
Copy Markdown
Member

I'd like to have some simple test for your changes. If you don't intend to write one, I will do it later, before merging.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Mateusz Majchrzycki
Added unit test for writing segmented hex file (shex format)
998a1bd
@mmajchrzycki

mmajchrzycki commented Apr 21, 2016

Copy link
Copy Markdown
Author

I've added a unit test for writing segmented hex file. It takes a data64k dictionary and write it in the 'shex' format. Then the result is compared with a predefined 'shex64k' hex file.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bialix

bialix commented Apr 21, 2016

Copy link
Copy Markdown
Member

Mateusz, do you have access to original files intended to be used by your application? I'm interested to know whether such files have start address record. I have suspicious it has CS/IP pair, so segmented addresses make perfect sense in such context. I think IntelHex library can make automatic decision about using one or another address scheme based on presence of start addr field. What do you think?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mmajchrzycki

mmajchrzycki commented Apr 21, 2016

Copy link
Copy Markdown
Author

Unfortunately, I couldn't share that file with you. It is a proprietary firmware. However, it doesn't have any records other than 00, 01 and 02. It looks like it was made by the converter which didn't support linear addressing. I also looked at the Intel Hex standard and it seems that the Start Segment record is not required.
Maybe the segment addressing should be used when CS:IP is defined, but if they are zero, the Start Segment record shouldn't be written to file?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bialix

bialix commented Apr 21, 2016

Copy link
Copy Markdown
Member

I don't really need your file, I just need to know about start address. Thank you for information.

Start record is not written if it's not here, you can see it in code.

I personally don't really like your "shex" name, because technically they're both HEX files, and two different address schemes are both defined by the same format. I'm going to think about the proper way to support your use case, but most likely I will change "shex" to something different.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mmajchrzycki

mmajchrzycki commented Apr 22, 2016

Copy link
Copy Markdown
Author

I understand you as I didn't have any better solution for this fix. The name 'shex' is very ugly :) Maybe it is worth to consider the solution with automatic using of segment address when CS:IP is present? The other solution I've found on Wikipedia. Maybe all output formats should get their names from this convention. What do you think?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bialix

bialix commented Apr 22, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Quote from Wikipedia

Named formats

Special names are sometimes used to denote the formats of HEX files that employ specific subsets of record types. For example:

  • I8HEX - files use only record types 00 and 01 (16 bit addresses)
  • I16HEX - files use only record types 00 through 03 (20 bit addresses)
  • I32HEX - files use only record types 00, 01, 04, and 05 (32 bit addresses)

I guess we can employ this naming scheme in IntelHex library. I've never heard about this naming sceme before, but it makes sense for me. Thank you for pointing at this page.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bialix

bialix commented Apr 22, 2016

Copy link
Copy Markdown
Member

So, my plan would be like this:

  1. Old name "hex" still be used for automatic decision about using record types if start address present.
  2. Your patch introduces good feature for generating desired format, let's keep it.
  3. Add support for i8hex, i16hex, i32hex into library, as well as to bin2hex convertor.
  4. More tests :-)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bialix bialix modified the milestone: 2.2 Jan 11, 2018
@bialix

bialix commented Sep 27, 2019

Copy link
Copy Markdown
Member

Sorry for not working on your pull request. I'm looking for a new maintainer for Python IntelHex project. I hope someone will help.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fernandez85 fernandez85 mentioned this pull request Jun 7, 2020
New Extended Address record type mode saving in 'write_hex_file' function #41
Open
@bialix

bialix commented Jul 9, 2020

Copy link
Copy Markdown
Member

Your patch is partially superseded by #41

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mmajchrzycki @bialix
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.