How do i write code for the A13 board

Started by saand, December 26, 2012, 03:46:10 PM

Previous topic - Next topic

saand

Hi All,
I have my A13-olinuxino board up and running with X.
Now i am trying to write some code for it.

I started with this link
http://www.agilart.com/blog/debugging-on-embedded-using-opensource-tools-part-1
It has some great info and directions however when i follow the directions i dont have the option for "cross-compile project" Also the arm-unknown-linux-gnueabi- doesn't exist.

So i followed the directions and went to the build the toolchain myself link which is here
http://archlinuxarm.org/developers/distcc-cross-compiling
This is also a great link with good info however again i have a problem where it comes up with
'linux-custom' not found in '
this was placed on a forum as a topic but there is no response
http://archlinuxarm.org/forum/viewtopic.php?t=3646

so as i am not very familiar with linux i am at a loss.

Does anyone have any idea how i can start writing code for this device.
I am happy to use a cross compiler or just write code on the device itself.
As long as i have a GUI and debugging

Does anyone have any success stories and can they share how they did it.

Thanks

yt7pwr

You did not say what is your develop system (Build machine).
On Debian instead arm-unknown-linux-gnueabi- use arm-linux-gnueabi-  in Eclipse project settings. You can also compile directly on A13 board if you install gcc and binutils (change to arm-linux-gnueabihf- or just gcc).

saand

Sorry i should have put that in
I am building on ubuntu 11.10.

I have tried to put in arm-linux-gnueabi- and i know this exists however i do not know the path

I have used this before when i created the image for the card using these instructions
https://www.olimex.com/wiki/Build_Bootable_SD_Card_with_Debian

do you have any idea what the path to put into eclipse should be.

i did attempt to search for this file name but i did not find any results that looked to be what i was after


regarding building on the A13, this looks like something i will want to do at some point but mostly for debugging.
do you know of any appropriate GUI tools and debuggers that would suite running on the A13 board. I am assuming eclipse wouldn't work but maybe im wrong?

davidefa

On the eclipse project properties I have the following:



in the /usr/bin directory I have the following:



having installed arm-linux-gnueabihf cross compiler toolchain ( on ubuntu 12.04 )

saand

Thanks for the help so far, i would be very lost without it.

i looked for the files you showed and i lacked the hf version of the compiler so i installed that using
apt-get install gcc-arm-linux-gnueabihf

i then had the /usr/bin directory populated with the files you had except for arm-linux-gnueabihf-g++ not sure how to get that file.

I changed the properties to what you had listed and initially had a C++ project, when trying to build the compiler came back with an issue relating to not having arm-linux-gnueabihf-g++

i changed to a new project that was just a C project. This compiled with no issue.

I though i had succeeded so i copied by usb drive the executable file. I copied it to a directory in the home directory.
I attempted to execute the file by typing ./hello_world
it came back with permission issues
after a bit of googling i found i did not have execute permission on this file so i did
chmod ugo+x hello_world

again i tried to execute typing ./hello_world
it came back with the error
bash: ./hello_world: command not found


note i had the same result with the hf compiler and the non hf compiler

does anyone have any ideas
- why i am getting this error message
- why i dont see the arm-linux-gnueabihf-g++ file and therefore am unable to compile c++ projects

Thanks

yt7pwr

Your A13 system is missing link for library ld-linux.so.3 (or in your case ld-linux-armhf.so.3) in /lib directory. Try to open final executable with HEX editor and on address 0x134 (in my case) you can see exact library name with full PATH. Library exist but is in different folder (something like /lib/arm-linux...). Make symbolic link with command: ln -s "path to ld-linux.so.3 libabry"  /lib/ld-linux.so.3

saand

Hi yt7pwr
you were spot on, i found the programs i was creating were referencing /lib/ld-linux.so.3 even if i was compiling with arm-linux-gnueabihf-
I also only had ld-linux-armhf.so.3

to get around the problem i just made a copy of the file and renamed it and the hello world program worked.

Do you have any idea how to solve this issue properly or is this a suitable solution which wont cause me issues in the future.

Thanks

oprospero

Several months later.

I also followed the tutorial and also ran into the same problems and found my solutions in this thread.
So thanks to saand and yt7pwr for your contribution.

Making a symbolic (soft) is probably the way to do it. In the target board, if you look in /lib/arm-linux-gnueabi folder you'll see (hopefully) ld-linux-armhf.so.3 and ld-linux.so.3 that is soft linked. If it's not there then do a find

find / -name 'ld-linux.so.3'

Just copy that into /lib and you should be able to run your program.
Good luck!