Hello.
I'm fairly new to embedded software development, and could use some clarification on how to generate .elf files from .c files.
I've recently downloaded the following toolchain installation:
developer.arm.com/.../gcc-arm-none-eabi-7-2017-q4-major-win32-sha2.exe
One of my confusions was the purpose for all of the .exe files in the main bin folder (I noticed there are several bin folders). The folder, $TOOL_ROOT\7 2017-q4-major\bin contains 30-ish .exe files, such as,
arm-none-eabi-ar.exe
arm-none-eabi-gdb-py.exe
arm-none-eabi-gcc-7.2.1.exe
To do a basic compile of .c to .o or .elf, which ones do I need to know about?
The main task I'm trying to achieve with the tool chain is to compile .c to .elf, to load into a third-party SoC development tool (VLab by ASTC, if that helps). The .c file contains code to program a Cortex M3, and the development tool I'm using loads .elf files.
Please note that I'm more of a chip designer than a software developer, so don't assume much knowledge about embedded design.
Thanks!
Hello,
All these .exe files are different components of the GNU toolchain. In your three examples you have the archiver, the debugger, and the compiler (gcc). If you wanted to compile (and link) "main.c" you would run something like:
gcc main.c
from the command line. This should generate a .axf or .elf image which can be run on some platform. Running:
gcc -c main.c
only compiles the file into a .o file, which is compiled, but not linked. If you have't found it already, this page contains information about the GNU-arm toolchain, as well as links to the GNU documentation if you need it.
Hope that helps,
Tim
Thanks Tim for the overview. This was what I needed.
When I was in college, C-compilers produced .o compiled files by default. On a separate site I learned that years ago gcc was changed, from compiling by default and generating a .o file, to compiling and linking by default. So, the default output today is the executable .elf format. I guess today I joined the 21st century. :)
Glad I could help! Happy programming :D