We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I was import Hello World example from Linux_example.zip file (C:\Program Files\DS-5\examples\Linux_example.zip) and coding a short program.
When I try to debug the program, I'm confusing about the debug setting. It looks different from Hello World Project create by DS-5.
As attached file, ds-5_debug.jpg image is Hello World example import from DS-5 example file, and ds-5_debug_1.jpg is Hello World Project create by DS-5.
It seems like some configuration missing and I don't know how to config ARM compiler.
Hi William,
If you are modifying the Hello World example for Linux, then it is compiled using GCC, not the ARM Compiler. Are you trying to create a Linux application, or a bare metal one?
Here is the tutorial for Hello World for bare metal, which explains the compiler settings you need: http://ds.arm.com/developer-resources/tutorials/working-with-arm-ds-5/#creating-a-simple-hello-world-c-program-for-a-bare-metal-target
For Linux, you need to:
1. start a new C project, set the toolchain to DS-5 GCC
2. right click on the project in the Project Explorer view and select properties
3. under C/C++ Build > Settings > ... GCC C Compiler > Miscellaneous, add -marm -march=XXX -mfloat-abi=soft to the "other flags" box (leave the other flags in that box as they are)
4. under GCC Linker > Miscellaneous > Linker Flags, add -marm -march=XXX -mfloat-abi=soft
XXX needs to be replaced with the specific architecture version, (for example) armv4t (which will allow it to run on the Cortex-A8 FVP which is included in DS-5) - more info on the flags can be found here: http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
5. create a new c source file in your project and add the Hello World code:
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Hello world\n");
return 0;
}
6. build and run your Hello World application.
Hope this helps,
Joe
Hi Joe,
Thanks for reply.
I'm looking for a way to create Linux application project with ARM Compiler, is that possible?
Linux applications *generally* need to be compiled with GCC. It's included in DS-5. ARM Compiler is generally for bare metal (running without an operating system) applications, so no, it's not possible.
Thanks,