I have a large amount of text that I need to put on an EEPROM and I wa wondering if there is a program that will convert ASCII text to I8HEX Inte HEX format.
Not just ASCII to HEX, but the full properly formatted and checksumme I8HEX format, like shown here here:
formatting link
If anyone knows of a program that can do that it would help a lot.
Thanks for any suggestions.
Didn't find your answer? Ask the community — no account required.
V
Vladimir Vassilevsky
formatting link
Converts anything to anything.
Vladimir Vassilevsky DSP and Mixed Signal Design Consultant
formatting link
G
Grant Edwards
objcopy -I binary -O ihex input.txt output.hex
formatting link
Grant Edwards grante Yow! Gee, I feel kind of
at LIGHT in the head now,
visi.com knowing I can't make my
satellite dish PAYMENTS!
D
dohzer
I saw that program, but I wasn't sure how to get it to run under Windows. Thanks, I'll see if I can figure it out.
J
John Speth
Or roll your own. All respondents suggestions were good but the time it takes you to find such a tool is probably more than the effort it would take to write it yourself.
JJS
L
lowcost
dohzer ha scritto:
uhm, what about eeprom starting address ?
G
Grant Edwards
I give up. What about it?
Grant Edwards grante Yow!
at
BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-
visi.com
L
lowcost
Grant Edwards ha scritto:
ehm, ASCII text file don't contain any address, HEX file records needs addresses; may be that the tool objcopy will make the good job starting with default address 0x00 ; else you should --set-start Set the start address to to match eeprom starting address.
under windows i feed filein.cod to obsend.exe (st7 tools). obsend filein.cod,f,fileout.hex,i
The --set-start option doesn't do what you think it does. It sets the "entry point". It sets the address to which one is supposed to jump in order to start execution of the resulting image. The start address is sent using record type 0x03 and is typically located at the end of the hex file:
If you want to relocate the output data to an address other than that of the input data [files of type "binary" have an implicit address of 0], you use the --change-addresses option:
Grant Edwards grante Yow! My face is new, my
at license is expired, and I'm
visi.com under a doctor's care!!!!
L
lowcost
Grant Edwards ha scritto:
thank you Grant , this seems to be a quite right answer to the original question from Dohzer. please explain me how to obtain these two .hex records ( "qwerty" at address 0x22 ) from ascii .txt , under windows, avoiding record type
0x03 in I8HEX : it will be useful for me too.
:060022007177657274792C :00000001FF
regards
G
Grant Edwards
I don't see why you are about the start record, but it's trivial to delete it:
You can put the objcopy and sed commands in a shell script so they can be used as a "single command" if you want. If you're crippled by Windows, you can install Cygwin to get a usable shell and set of command-line utilities.
You can do the same thing with srecord, but since objcopy "comes with" the Gnu toolchain and can also manipulate ELF files, I tend to use it more often.
Grant Edwards grante Yow! Sometime in 1993
at NANCY SINATRA will lead a
visi.com BLOODLESS COUP on GUAM!!
P
Petter Gustad
Stick in a assembly source file (qwerty.s):
.section ".rodata" .ascii "qwerty" .end
Run it through an assembler, presumably a cross assembler for your target architecture or the same byte ordering as your target (to create a .o file), a linker with a linker script to set the rodata section origin to 0x22 (to create an .elf file) and run objdump using the -Oihex option (to create the .hex file).
Petter
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.