Minor fixes and cleanup
Initial commit
The newer versions of gcc no longer allows tentative definitions by default (although it's in the 'C' standard). This basically means that when a variable is defined in common.h and a 'C' source it'll put two distinct ones in BSS, which will barf the link editor. If that's not basic enough, you'll get double definition errors when it links. The solution is to add the -lcommon flag to the gcc COMPILER options, which makes it merge tentative definitions like it should in 'C' (but not in 'C++).
Le 2023-09-29 à 03 h 36, jonarque a écrit : [bugs:#27] https://sourceforge.net/p/hex2bin/bugs/27/ Infinite loop with "Input file MyFile cannot be opened. Enter new filename: " Status: open Group: v1.0.12 Created: Fri Sep 29, 2023 07:36 AM UTC by jonarque Last Updated: Fri Sep 29, 2023 07:36 AM UTC Owner: nobody On Windows, starting : .\hex2bin.exe MyFile If "MyFile" doesn't exist, it outputs : "Input file MyFile cannot be opened. Enter new filename: " in an infinite loop. Sent from sourceforge.net...
Infinite loop with "Input file MyFile cannot be opened. Enter new filename: "
It's the interactive mode. There is a batch option for use in scripts: .\hex2bin.exe -h MyFile If the file doesn't exist, it exits with an error code of 1.
It's the interactive mode. There is a batch option for use in script: .\hex2bin.exe -h MyFile If the file doesn't exist, it exits with an error code of 1.
Infinite loop with "Input file MyFile cannot be opened. Enter new filename: "
To get a warning, after this line in hex2bin.c, /* Set the lowest address as base pointer. */ if (Phys_Addr < Lowest_Address) Lowest_Address = Phys_Addr; put this: if (Phys_Addr + Nb_Bytes -1 > 65535) if (Verbose_Flag) fprintf(stderr,"Warning: data record wrap around 64k\n");
Thanks for your post. It's indeed not doing it correctly and srecord does it right according to the Intel Hex spec. I suppose most generators would produce correct Intel Hex without resorting to the wrap around trick. After a quick check, a fix for this may be a bit long to do. If this is a show stopper for programming a specific binary, let me know.
no 64k wrap around for segmented addresses
Thanks! The errors can be corrected by declaring extern all the variables in header files. Didn't check with GCC 10, but it should do the trick. https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common This will be corrected in the next release.
2.5 link failure with gcc10
It would not be possible without splitting the hex file. Padding can't be turned off. Another solution would be that your chip programmer can take hex files directly. Many EEPROM programmers can skip programming a byte if its value is FF. This value is the default value in an erased EEPROM.
Release 2.5 available!
if you downloaded Hex2bin-2.5.tar.bz2, the .exe files are in bin/Debug and bin/Release There is no installer for Windows, you can simply copy them manually in a convenient location. There should be no change for Windows 10. I didn't tested it, I don't have Windows 10. I introduced a batch parameter: -b a while ago. Your command may work with the -b added: cmd/c:\foldername\hex2bin -b c:\foldername\temp.hex
I have dowloaded the latest hex2bin file converter. However it did not nclude a .exe file or some other way to install it on my windows PC. So how do i get it installed ? second question, how do i programatically incorporate the hex2bin in my labview program to convert a .hex file into a .bn file in the same folder ? Under windows XP, the complete command looked as follows --> cmd/c:|foldername\hex2bin c:\foldername\temp.hex where "cmd c" was added (per labview) in front of the above "batch command"...
It would not be possible without splitting the hex file. Padding can't be turned off. Another solution would be that your chip programmer can take hex files directly.
HEX2BIN - I have an application where my assembler source jumps from $4000 to $8000. I do not want padding in between these addresses. Is there a way to turn off padding?
The options allows you to place the checksum at a specified address, so you can put it where you want. Do a test file, test it with the options to get it right. You can specify the range of the CRC calculation, so that the result won't overwrite the data. A trick would be to reserve some bytes for your checksum which will be in the hex file. Then, hex2bin can calculate the checksum and place it at the specified place.
-s option
Please ignore ticket 23
This can be done in the current version by allowing extra empty bytes in your hex file for the CRC/Checksum. You specify the range from begin to last byte, and force following byte(s) to the checksum. hex2bin -r (begin) (last byte) -f (CRC/cheksum location)
The options allows you to place the checksum at a specified address, so you can put it where you want. Do a test file, test it with the options to get it right. You can specify the range of the CRC calculation, so that the result won't overwrite the data.
Thanks for this great tool! Does the tool as-is support a way to prepend or append the computed checksum or CRC value to the resultant output file? Current options seem to want to place the checksum somewhere in the same range of the binary data derived from the hex file, thus overwriting some of that data. "Modify it to do that yourself" is a perfectly valid answer; I just wanted to make sure I'm not missing or misunderstanding something.
I will include your modification in the next release coming soon. Can you send me your solution and vcx project files? I'll include this as well for convenience. Thanks!
Append CRC to end of binary file
Please ignore ticket 23
-s option
Lately I compiled on Windows 7 o.s. machine with Visual Studio 2017 Community edition with some specific components (namely 'Windows Universal CRT SDK' and 'Windows Universal C Runtime') because Visual Studio 2017 Community edition is iamed at Windows 10 o.s., so Hex2bin compiles just fine on Visual Studio 2017 Community (I can provide .sln solution file and .vcxproj project files). Here I want to signal that, for the time being, I changed common.h include file like this /* To compile with Microsoft...
Release 2.5 available!
Patch for add a new feature and some little fixes
Patch for add a new feature and some little fixes
Website updated
Implemented as -k 5 checksum method
case CHK16 calculated incorrectly from HxD
Small Makefile issue causes compile issues on some Linux targets
contains illigal files.
Moved test files into its own release
Release 2.4 available!
The format in the sample is this: 000000 5B 5A 1B 4F 0E 9D E4 1F 40 8F 76 85 13 CA...
Required Input File Format
The format in the sample is this: 000000 5B 5A 1B 4F 0E 9D E4 1F 40 8F 76 85 13 CA...
The format in the sample is this: 000000 5B 5A 1B 4F 0E 9D E4 1F 40 8F 76 85 13 CA...
contains illigal files.
Required Input File Format
I'll make the change in the next release. Thanks!
Small Makefile issue causes compile issues on some Linux targets
I tried the string "123456789" with HxD: it gives 1DD which is the sum of 31 to 39...
case CHK16 calculated incorrectly from HxD
Message Force/Check address range
The message was displayed when force/check address feature was not used, so there...
Long Pathname crashes hex2bin
Release 2.3 available
In common.h, the filename size is defined at 81 characters. /* FIXME how to get it...
Long Pathname crashes hex2bin
Message Force/Check address range
Patch has been applied in Hex2bin 2.2
Two bug fixes for Hex2bin 2.1 w/patch file
hex2bin 2.x creates a very large bin file from a smaller hex
Release 2.2 is available!
Le 2015-11-23 22:55, Donna Whisnant a écrit : [patches:#5] http://sourceforge.net/p/hex2bin/patches/5/...
Two bug fixes for Hex2bin 2.1 w/patch file
It seems the large size is normal, since there is an extended linear address record...
It seems the large size is normal, since there is an extended linear address record...
hex2bin 2.x creates a very large bin file from a smaller hex
Website updated
Release 2.1 supports micros from TI
Patch and New Feature
Offset command line option ignored
length flag not working correctly
Upper_Address uninitialized in previous patch
Release 2.1 is available!
Release 2.1 is available!
Please add the missing folders and the .gz-file in the tarball
Patch and New Feature
Add CRC8
Hi, In the last section of common.c, I think that instead of: Module = Max_Length...
Release 2.0 available!
It would work as expected with -s 0000 instead of -s 0D00. Bin file will begin at...
It would work as expected with -s 0000. Bin file will begin at 0.0000 with 0.0000...
Release 2.0 coming soon...
Working on next release (2.0)
On next release: possibility to add CRC inside binary file
On next release: possibility to add CRC inside binary file
I made several CRC routines so I will incorporate them into the next release.
Add CRC8
Thanks for the patches! I will try to apply them manually to mot2bin.c too.
Upper_Address uninitialized in previous patch
length flag not working correctly