I am using DS-5 eclipse to create Hello world project referring to this. I got output file HelloWorld.axf file. I have transferred to target and tried to execute. I got following error
HelloWorld.axf
firefly@firefly:~$ ./HelloWorld.axf Killed
./HelloWorld.axf
I am not understanding, what are the properties should i consider while creating executable. Please help me to solve this issue .
Hi,
It looks like you have compiled a 'bare-metal' executable and then tried to run it under the Linux OS.
This won't work. Linux has set rules as to how any application should interact with it and the 'Hello World' application that you have created assumes there is no underlying OS running and so will attempt to initialise things for itself.
Whereas of course Linux has already done this.
What you need to do is follow the tutorial at
DS-5 Development Studio | Linux Application Debugging Using DS-5 – ARM Developer
which tells you how to build a Linux 'Hello World' application using GCC.
Once you have built that application you could try it on your target.
I hope that helps ?
Regards,
Stuart
Thanks for ...reading and replying
if i go for GCC every thing work fine....able to execute programme but i want to use ARM Compiler to build programme so i am following this documents.
Please guide how to use ARM Compiler to build and execute the programme on ARM ubuntu?
I'm not sure it's supported in the ARM compiler any more (it was briefly some years ago). Based on the current compiler selection guide:
C/C++ Compilers for ARM – ARM Developer
... all of the ARM Compiler releases are designed for bare-metal development without an OS, and the recommended C compiler for Linux development is GCC.
HTH, Pete
Hi Mohan,
You probably want to follow this blog instead: Building an ARMv8 Linux Hello World with ARM Compiler 6. Since your board has a Cortex-A17 there's a little modification in that you're building a 32-bit application, but for AC6 the process is exactly the same.
However, if you're using ARM Compiler 5, that's completely different. As Pete said we used to support it through armcc->armlink, but no longer do, so you have to manually configure things in a similar way, except rather than just telling the compiler and linker where GCC's programs and libraries are, you have to micromanage the build process with these sorts of flags:
ARM Compiler armcc User Guide : 8.115 --library_interface=lib
ARM Compiler armcc User Guide : 8.6 --apcs=qualifier...qualifier
.. and obviously manually link the Linux libc using GNU binutils rather than armlink, since none of the ARM Compiler 5 tools will magically figure this out for you. If you are extremely patient you might be able to manually coerce the ARM Linker to generate a Linux application for you, by telling it (along with compiling with the above) not to scan for libraries among myriad other options, but at the very, very least:
ARM Compiler armlink User Guide : 12.124 --scanlib, --no_scanlib
ARM Compiler armlink User Guide : 12.136 --startup=symbol, --no_startup
The use model most people settle on is generating compiled objects in a static library (.a) and linking it as a part of a Linux application that is otherwise built by GCC and GNU binutils in the normal way. This way you can include code built by the ARM Compiler, without it being too complex, and without involving the ARM Linker.
Ta,
Matt