Hi,
Anybody knows where I can find a simple intel hex to bin file converter running on 32 bit platform (Win10)?
My old died moving to win10. :-)
Perhaps AtmelStudio should have the possibility to generate bin files??
Hi,
Anybody knows where I can find a simple intel hex to bin file converter running on 32 bit platform (Win10)?
My old died moving to win10. :-)
Perhaps AtmelStudio should have the possibility to generate bin files??
objcopy -I ihex Demo.hex -O binary Demo.bin
Any (avr-, arm-none-eabi-) objcopy will work the same.
Thanks a lot, it works!
Build Events: Post-build event command line: "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -I ihex ml6.hex -O binary ml6.bin
Is it possible to get the bin file filled with 0xFF up to some size with the tool?
For example, I get bin file size 32433, but I need to get it 32768. The rest should be just 0xFF.
Could the tool do it?
Appending?
That's only a few hundred bytes. Use hexedit and add the 0xFF bytes yourself.
Alternately:
$ while [ $(stat -c %s foo.bin) -ne 32768 ] ; do echo -en "\0377" >> foo.bin ; done
Ugly and slow, but works.
Why do you need this?
Is it possible to get the bin file filled with 0xFF up to some size with the tool?
For example, I get bin file size 32433, but I need to get it 32768. The rest should be just 0xFF.Could the tool do it?
http://srecord.sourceforge.net/
See this page in the manual:
see if this helps http://sourceforge.net/projects/...
+1 why?
if it's a normal setup everything not programmed will be 0xFF
Srecord can do that (and about a 1,000 other things). It is the "go to" tool for working with any kind of micro load image. It supports all forms of Intel Hex and Motorola Srecord and about 40 other formats too. http://srecord.sourceforge.net/
Thanks
$ while [ $(stat -c %s foo.bin) -ne 32768 ] ; do echo -en "\0377" >> foo.bin ; done
hmmm, I don't know how to run it.
+1 why?
I have to append some specific data to a firmware file pefore programming. The data should be at the very end of the MCU flash memory. The rest bytes should stay 0xFF.
hex2bin converter has the option /Ln, but it doesn't work in Win10
I've written a small tool to do it already. I append 0xFFs and add the needed data at the end.
I'm just interested if other CLI tools could do the same (to append and change bytes in binary file) from command line (from *.bat file).
joeymorin wrote:$ while [ $(stat -c %s foo.bin) -ne 32768 ] ; do echo -en "\0377" >> foo.bin ; donehmmm, I don't know how to run it.
Joey runs that on a Linux/Unix system, on a shell prompt. If you're on windows then you cant run that command.
Tim0xA wrote:
joeymorin wrote:
$ while [ $(stat -c %s foo.bin) -ne 32768 ] ; do echo -en "\0377" >> foo.bin ; donehmmm, I don't know how to run it.
Joey runs that on a Linux/Unix system, on a shell prompt. If you're on windows then you cant run that command.
Cygwin
Wouldn't touch that with a 10 foot pole, based on old experiences. (They introduced their own DLL hell by having different incompatible versions of Cygwin1.dll.)
I prefer MinGW (with MSYS) for getting Unix/Linux functionality on a Windows system. I would have supplied the link to the MinGW build with threading support in G++, but I can't locate the link ATM.
Well, actually I prefer Linux in a VM.
Well, actually-actually I hope I can soon prefer it running as the native OS.
EDIT: Link to MinGW build with GCC G++ with std::Thread support: http://sourceforge.net/projects/...
Wouldn't touch that with a 10 foot pole
I tend to agree, but mind you I have even stronger feelings about Windows ;-)
In all honestly, I haven't touched Cygwin in almost twenty years. I posted hastily from my my mobile.
When I need to generate a win32 executable, I use MinGW on Linux.
There are also a number of "Unix utilities for Windows" packages out there:
https://www.google.ca/search?q=unix+utilities+for+windows
In any event, Cliff has the better solution: Srecord.
I have written a Windows tool that works in Windows 10 (x86/64).
Batch files are not necessary, the tool has a small automation.
See http://blog.copcea.ro/2016/12/28... for info and download.
What's the point when objcopy exists in binutils anyway?
Thanks for sharing your opinion. Some may agree, others may not.
Just out of curiosity, your post comes 2 minutes after mine.
Did you even download the tool and see what it does?
Fyi, I do not use Gnutils on Windows. So do others too.
You'll find few around here who will risk downloading an arbitrary executable from an unknown website.
especially when well-known, widely used & trusted tools already exist
Thank you guys for the support.
It is not important who takes as long as I feel good giving and sharing.
"Some people choose to see the ugliness in this world, the disarray. I choose to see the beauty. To believe there is an order to our days. A purpose"
- Dolores
Fyi, I do not use Gnutils on Windows.
What you may not understand is that objcopy is part of Atmel Studio.
So if you have installed Atmel Studio on your Windows computer, objcopy is there and ready to use.
I believe this is why clawson asked what motivated you to write your own.
Chuck,
thanks for the comment.
My motivation is exactly the one I have stated before:
- I do not use gnutils, I personally hate having to write a batch file for every single project.
- I find easier to have a Windows application and use it visually to make simple conversions.
- The application has also a silent button to redo countless times whatever conversion was done the first time. After each rebuild, pressing a button makes the conversion and also shows me - visually - whatever flash space is occupied, This way I can easily decide if, for example, I'll start writing a new menu taking up lots of space or if I'll just use an EEMEM variable to implement a new feature.
- the application is not intended to void the use of objcopy, it is intended to come as an alternative feature.
and finally
- I still use Studio 4.19, which does not come with objcopy or other similar tool. When using an MKII programming device, every time I shift from Studio 4.19 to Studio 7, I have to flash the MKII again, which is an additional pain.
If there are others struggling with the same issues than I did, this tool would be useful.
You gave me an idea here: I wish to provide my work free of charge for the community. I will post also the source code so everybody will be able to compile it with lazarus.