Page 1 of 1

Segmentation fault by running simple Hello World file

Posted: Mon Aug 01, 2005 12:26 pm
by Jelle
I have compiled the Hello_world file with GNU tools in windows. I transferred the file to my AT91RM9100-DK board. Then I do #chmod 777 Hello_world so the file is executable and run it with #./Hello_world. Instead of seeing the result I get a segmentation fault as answer. What did I do wrong? It would be nice if someone could help me. I am really stuck with my project now.

Found the problem!!!!!!!!!!!

Posted: Tue Aug 02, 2005 3:53 pm
by Jelle
I know what went wrong. The compiler for the arm9 that is included on the CD-ROM, has the wrong libraries in its file that causes this fault. By changing them it is possible to compile your .c file on Windows using Cygwin.
For getting the right library in Cygwin you need to unpack the following files by Cygwin:

arm-linux-binutils-cygwin-2[1].9.5.0.37.tgz
arm-linux-gcc-cygwin-2[1].95.3.tgz
libc6-arm-cross-2[2].1.3-19.tgz
libc6-dev-arm-cross-2[1].1.3-19.tgz

Look at this site for the links for the tgz-files: http://www.gp32x.com/board/lofiversion/ ... 12412.html

Now you are ready to compile your file with the following command:

#arm-linux-gcc –o filename filename.c

That’s it!

Greetings,
Jelle