Zedboard - Setting up a ARM development environment in Linux

Well now that you have your Zedboard up and running with Petalinux installed, and your network is configured to talk to the outside world, let's get some code running on this thing!

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!

That simple!!!

I am going to go to my home

rectory and create a folder to do some development in, and then compile a hello world application:

$ cd
$ mkdir arm-devel
$ cd arm-devel/
$ ~/arm-devel$ touch helloworld.c
$ ~/arm-devel$ cat > helloworld.c
  #include
  #include
  int main(){
    printf("Hello World!\n");
    return 0;
  }

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 root@192.168.1.237:~/

On Zedboard:

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 root@192.168.1.237
$ root@avnet-digilent-zedboard-2017_2:~# chmod a+x helloworld
You will notice that the helloworld app now has the ability to be executed. Well, what are you waiting for!? let's do it!

root@avnet-digilent-zedboard-2017_2:~# ./helloworld
Hello World!

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.