User forums > Embedded development
output file extension .bin/.hex
anandamu16:
Hi,
I have recently started using codeblocks for embedded development. Whenever I make any project it gives the output file with extension .exe. I checked into project "properties->build targets" and realized that it gives the output extension bcz of the setting available here.
There are different types available here such as "Console Application", "Library static/dynamic", "GUI Application", "Commands only", "Native".
I want hex file as output which can be then run on embedded chip. So Can i do something like this:
- Select type as console application and set the output file extension as xxx.hex
Will it be ok?
Also is there any way to generate a .map file as output ?
christobal:
--- Quote from: anandamu16 on March 03, 2017, 05:39:31 am --- So Can i do something like this:
- Select type as console application and set the output file extension as xxx.hex
Will it be ok?
--- End quote ---
No. How to get a hex file depends on the Compiler / Linker you use. For GCC, you need to build an "console application". This will generate an .elf File, which you have to convert to a HEX file in a post build step. You can use gcc objectcopy to accomplish this.
--- Quote from: anandamu16 on March 03, 2017, 05:39:31 am ---Also is there any way to generate a .map file as output ?
--- End quote ---
The linker usually provides a command line switch to produce a map file. Just add this to the linker options.
anandamu16:
--- Quote ---For GCC, you need to build an "console application". This will generate an .elf File
--- End quote ---
I am getting .exe file only but no .elf, although I have checked Compiler flag to "produce debugging symbols [-d]" still I am getting .exe file
--- Quote ---.elf File, which you have to convert to a HEX file in a post build step. You can use gcc objectcopy to accomplish this.
--- End quote ---
(I am using GCC Compiler 5.3.0 on windows7)
I know there are pre/post build steps, but where to know about the post build steps, I mean what to enter.?
--- Quote ---The linker usually provides a command line switch to produce a map file. Just add this to the linker options.
--- End quote ---
Did you mean "Project->Build Options->Linker Settings ->Other Linker options"?
Commaster:
--- Quote from: anandamu16 on March 03, 2017, 11:42:46 am ---I am getting .exe file only but no .elf, although I have checked Compiler flag to "produce debugging symbols [-d]" still I am getting .exe file
(I am using GCC Compiler 5.3.0 on windows7)
--- End quote ---
You have to install and use the compiler for your TARGET DEVICE. Only then will it produce the right format. You are getting .exe, because you are using a windows compiler. And since Windows runs .exe...
Other possibility is cross-compilation, and you'll have to specify your target platform in compiler arguments.
BlueHazzard:
it would help if you tell us for what platform you are developing (arm, avr, pic, nxp...)
Navigation
[0] Message Index
[#] Next page
Go to full version