-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to insert 'Extended Segment Address' record type instead of 'Extended Linear Address' #40
Comments
IIRC this record should be selected based on starting address type. But I see what you mean, and this is valid request. |
BTW, do you have starting address record in your file? |
No, I don't use it in my project. |
Well, that is. But you can probably expect to get only one type of addressing to be using in one document. I don't think mix of two is a good idea. It's counterintuituive for me. |
That's why I've added merge feature. I hope it works for you. |
For me it is always good idea to have one type of addressing for simple consistency reasons. But believe me, there are tools that do the really crazy stuff on output. Then it is expected that Your software will support that. And on the end You have to struggle with this ;)
I have a solution in mind to cope all the scenarios. I will present this as soon the change will be ready.
I know I can use it, but I just use 'fromFile'. I don't have manipulate the data (besides deleting Starting Address info data, but this I do right after loading the data). Just open and load, so for me this is simpler than calling the constructor (which opens and loads data inside) and then merge. Unless 'merge' has some extra features that would change my mind ;) |
Hello,
my issue might be considered more as improvement. So I don't know if this is the right place.
I've observed that when You want to use write_hex_file, then You cannot decide which type of Extend Address record type will be used in hex file:
or
Always second one will be used (0x04) and it cannot be changed as far I can see.
The code responsible
while cur_addr <= maxaddr:
if need_offset_record:
bin = array('B', asbytes('\0'*7))
bin[0] = 2 # reclen
bin[1] = 0 # offset msb
bin[2] = 0 # offset lsb
bin[3] = 4 # rectyp
I know that having that record type (0x04) shouldn't be a problem for most cases, but I have to deal with some legacy software. I run into problems when this record is not 0x02.
Is there any chance to add an option for 'write_to_hex' to have possibility to have functionality tp force using Extended Segment Address record types in output file.
In particular scenario when You initialize IntelHex with file that contains this kind of records, writing this with 'write_hex_file' (without changing any byte of payload) will result with differences comparing to original.
I can try to create a pull request with changes by myself, but I'm not very experienced Python programmer. I do Embedded (mostly C), but I starting to use Python more and more, especially for tooling.
The text was updated successfully, but these errors were encountered: