First some environmental comments. I am a big fan of Xubuntu. I like it’s feel and it’s ease of use when it comes to installing packages using the apt-get command. I will be writing just about all of these blog posts using Xubuntu as my host OS.
I have installed on a development box Xubuntu 16.04 LTS. The only thing I selected during the install was to install OpenSSH so I could actually interface to the thing. We are going to install just a single additional package to allow us to compile ARM code, and it’s going to be really really simple to do!
Open up a command terminal on the local machine
In the event that you do not have SSH installed and would like it installed then here is the command:
# sudo apt-get install update
# sudo apt-get install openssh-server openssh-client
Now that you are at the prompt either on your local machine or via SSH, we can install the arm gcc tools:
$ sudo apt-get install gcc-arm-linux-gnueabi
Once the package is installed, you now have the ability to compile applications for your Zedboard!
I am going to go to my home directory and create a folder to do some development in, and then compile a hello world application:
mmphego@4n0m4ly:~$ mkdir arm-devel
mmphego@4n0m4ly:~$ cd arm-devel/
mmphego@4n0m4ly:~/arm-devel$ touch helloworld.c
mmphego@4n0m4ly:~/arm-devel$ cat > helloworld.c
So we have our source file, now we need to compile it. The application we will use is arm-linux-gnueabi-gcc.
$ arm-linux-gnueabi-gcc -o helloworld helloworld.c
Ok, so now we have our application written and compiled. But now what? We can’t run it on our development box because it isn’t ARM based. So we need to get it over to our Zedboard. The Zedboard conveniently ships with a SCP running on it! So all we need to do is connect to our Zedboard and drop our file there.
$ scp helloworld email@example.com:~/
Cool. So now our our Zedboard in the /home directory we have a file called helloworld. We need to change it’s properties so our shell knows it can be executed. To do this we will use chmod:
$ ssh firstname.lastname@example.org
$ root@avnet-digilent-zedboard-2017_2:~# chmod +x SMV_Pub_Zedboard
You will notice that the helloworld app now has the ability to be executed. Well, what are you waiting for!? let’s do it!
Woohoo! How cool is that!?. So now, you are well on your way to application development for the ARM cores running within the Zynq-7000 on you Zedboard.