Introduction: Setting Up the Zybot-Software

This Instructable is part one of a six-part series of building the Zybot. In this Instructable we will be setting up the software side of the Zybot. The ZYBO (Zynq Board) is an embedded software and digital circuit development platform.

We are going to be setting up Ubuntu and other software that will set up the ZYBO to be used on the Zybot. For the easiest installation you will need:

  • ZYBO and power adapter
  • 8 GB Micro SD card and adapter
  • WiFi Adapter
  • Webcam
  • USB Splitter
  • LAN Cable
  • Mouse
  • Keyboard
  • Computer Monitor
  • HDMI cable (and adapter that connects to your monitor)

Before you start, be sure to boot up your computer in a Linux system. (I'm using Fedora)

If you want to learn how to dual-boot, check out this Instructable!

Step 1: Preparing Your Micro SD Card for Partitioning

If you plug in your ZYBO now and turn it on, the only LED that will turn on is the red PGOOD light. This is good, because right now nothing is booting up on the ZYBO. For us to change this, we need to mount Ubuntu onto our Micro SD card.

Before we can put Ubuntu onto the Micro SD card, we have to partition the Micro SD into two parts. Right now, we are still using the computer, I'll mention when we switch over to the ZYBO.

  1. Identify your SD card
    1. With your Micro SD card not plugged in, open up a terminal (CTRL + t), and enter the command lsblk. This will "list block devices."
    2. Plug your Micro SD card into your computer (with an adapter if need be). Press lsblk again and note what wasn't there before. For me, the sdb is the Micro SD card.
    3. Take note of where the card is located (i.e. sdb).
  2. Unmount the Micro SD Card
    1. If your Micro SD card has already been partitioned, there will be more than just sdb1 in sdb to unmount.
    2. We want to unmount the Micro SD card so we can partition the Device, to do this we go back into the terminal and enter the command sudo umount /media/josh/7D38-6641
      1. The underlined portion for this step will be slightly different for each user, but just use the path of the Micro SD card that lsblk gave us. Any portion that may change per user I will underline for ease of use.
      2. If you run the command again, it should just give you a not found notice.
  3. After all the partitions of the Micro SD card have been unmounted, we can (re)partition it using the fdisk command.
    1. Enter the command sudo fdisk /dev/sdb. This will start the fdisk menu running.
    2. Press p(rint)and hit enter, this will display the partitions of the Micro SD card.
    3. Press d(elete)and hit enter, if there are multiple partitions already, be sure to delete all of them.
    4. Check out the last picture to see what your terminal should look like.

Step 2: Partitioning Your Micro SD Card

Now that everything is deleted, we can partition our Micro SD Card. We are going to create two partitions.

  1. Press n to create the first partition. (Image 1)
    1. Press p for primary partition.
    2. Partition 1.
    3. Select default location for the beginning of the first partition, mine was 2048, but this might be different.
    4. Enter +1G for last sector, we just want one Gb of memory for the first partition. This finished up this partition.
  2. Press n to create the second partition. (Image 2)
    1. Press p for primary partition.
    2. Use defaults as all the rest of the choices for partitioning.
  3. Now that we have both partition created, we want to write these to the Micro SD Card. (Image 3)
    1. Press w.
    2. This will write partitions and automatically exit fdisk.

Step 3: Creating Your File Systems

This is the final step of partitioning the Micro SD Card, so we can almost move onto installing Ubuntu!

  1. Enter sudo mkfs -t vfat -n ZYBO_BOOT /dev/sdb1into the terminal, this will format partition 1 and title it ZYBO_BOOT
  2. Enter sudo mkfs -t ext4 -L ROOT_FS /dev/sdb2into the terminal, which will format partition 2 and title it ROOT_FS. This will take a little bit of time.

Now your Micro SD Card is all partitioned!

We can test this out by unplugging and plugging the Micro SD back in and run lsblk again, then ZYBO_BOOT and ROOT_FS should be in sdb1 and sdb2.

Step 4: Setting Up the Linux File System

In order for us to run Ubuntu on the ZYBO, we need to download Linaro Release of Ubuntu.

Go to this link and select the last link. (it should be 533.4M size)

After that is downloaded we need to copy it onto the Micro SD Card. This will take a few commands.

  1. mkdir -p /tmp/linaro
  2. Go into the Downloads folder by entering the commandscd Downloads
  3. Now that your into Downloads enter the command sudo cp linaro-precise-ubuntu-desktop-20120923-436.tar.gz /tmp/linaro/fs.tar.gz

  4. Now go into the the linaro folder we created, you can do this by using the command cd /tmp/linaro.

  5. If everything went correctly, you can use the command ls and the only thing that should print out is fs.tar.gz

  6. Finally, we want to enter the command sudo tar zxf fs.tar.gz to unpack the tar file. This will take a bit of time, and should produce a binary file.

Step 5: Moving the File System Into the SD Card

Before we can move anything over, we have to unmount the partitions like we did earlier.

  1. sudo umount /media/josh/ZYBO_BOOT
  2. sudo umount /media/josh/ROOT_FS
  3. lsblk
    1. If everything was unmounted successfully, sdb should have sdb1 and sdb2, but no title on the right-hand side.

Now that everything is unmounted, we can move the file system into the Micro SD card. For this, we need to be in /tmp/linaro folder. (We should be there already)

Follow these commands:

  1. mkdir -p /tmp/sd_ext4
  2. sudo mount /dev/sdb2 /tmp/sd_ext4
  3. cd binary/boot/filesystem.dir/
  4. sudo rsync –a ./ /tmp/sd_ext4
    1. This will take a bit of time.
  5. sudo umount /tmp/sd_ext4

Now that everything is copied over, you should be able to check out ROOT_FS and there should be folders in it, ZYBO_BOOT should still be empty.

Step 6: Adding Boot Loader

The last step we need to do before the ZYBO board will work, is moving the attached files into the ZYBO_BOOT partition.

  1. Download boot.zip and extract the files inside.
  2. After you extract everything, you'll see three binary files and a files folder.
  3. Move all these into the ZYBO_BOOT partition that we created. The binary files are used to boot the ZYBO, files is going to be used in the next instructable, but putting it onto our ZYBO now is going to save us some time.

Step 7: Setting Up the ZYBO Board

Now we can move over from computer to the the ZYBO! For us to use the ZYBO we have to set up a few things.

  1. Insert the Micro SD Card into the SD MICRO slot.
  2. Attach your LAN cable to the ZYBO and insert the other end into your router (or any place that has internet).
  3. Attach the HDMI cable to the ZYBO and plug it into your monitor.
  4. Attach power adapter.
  5. Attach usb splitter and plug Mouse and Keyboard into usb splitter.

Turn on the ZYBO and (after a little time) the Desktop should be booted up.

Open up a terminal on the ZYBO and enter the command sudo apt-get install linux-firmware.

The linux-firmware allows us to connect to the wifi.

That finished up our software set-up of the ZYBOT, other instructables in this collection will focus on hardware and other relevant parts to setting up the ZYBOT.

Now you can move onto the next Instructable (Setting up the Zybot Server).

Comments

author
ShwetS1 (author)2016-07-29

I am using an HDMI to DVI converter and I used simple move (mv) command to move the files from boot.zip folder (after extracting it) to ZYBO_BOOT partition. Can any one of this has anything to do with me not being able to get the output on the screen?

author
j054n (author)2016-06-09

Any solution for sound? new fpga configurations tested?

author
Ionutzybo (author)2015-10-10

Hi!

Have you solved the problem with the VGA ?

Thank you!

author
GabrielA20 (author)2015-08-05

hi!
i have a problem trying to use a usb-serial converter conected to zybo. first, in linaro doesn't recognize the device (lsubs just shows "Bus 001 Device 002: ID 2341:0010" ). For previous tutorial ( https://www.instructables.com/id/Embedded-Linux-Tutorial-Zybo/?ALLSTEPS ) I compiled a driver for cdc-acm.c to get cdc-acm.ko file and work it, but for this system when i try to install with $insmod cdc-acm.ko shows "$ insmod: error inserting 'drivers/cdc-acm.ko': -1 Invalid module format ". maybe i need the source of the kernel you use to compile the uImage file. What kernel you use??. or something else i miss?

author
StevenM9 (author)2015-05-22

Hi

This tutorial is excellent, great work. I followed every step and have desktop linaro working fine, however, after plugging a webcam into the zybo the linux kernel can't find it. After some investigation there was no /dev/video0 where the vwebcam usually is, also i could not find UVC module needed to display usb webcams.

i have used cheese and guvcview but neither seem to work.

Will this Zybo-Software release with the current kernel show a webcam image?

Thanks

author
NicanorG (author)2015-05-10

Hello, another question:

Is there a way to play sound in the Linaro system installed in this tutorial?

By default no sound devices are found in the sound configuration settings.

Thank you.

author
joshwoldstad (author)NicanorG2015-05-11

You definitely can! The audio section of the ZYBO reference manual gives some more insight on it. Unfortunately, I can't help you beyond that, but our forums should be able to!

author
NicanorG (author)joshwoldstad2015-05-11

Yes, I have used those capabilities before, but not in a project with an operative system, and in that project I included the audio codec hardware component found in the Zybo Base System.

According to the reference manual the audio codec is connected to the SoC through the programmable logic, so a hardware component is needed to use it.

The correct question to ask is: Does the Zybot hardware support audio?

Thank you very much.

author
wolfstrassen (author)2015-04-28

Did you write a custom driver to display the desktop UI?

I have lots of projects that use custom AXI peripherals. A graphic UI would be nice, but I know nothing about device tree and custom video drivers.

Since everything on the web is for the Zedboard, I'm having a hard time finding information about this.

If you could give some pointers on how to do this I'd be gratefull

author

I personally didn't write the driver (our applications manager did), but it's something I'm working on. You can check out the https://www.instructables.com/id/Embedded-Linux-Tutorial-Zybo/ that my coworker wrote, you could check out the Digilent Forums, they'll be able to help you out too.

author

In that tutorial, the author said:
"The Zybo doesn't have a graphics card so it can't run linaro. To do that you would need a board such as the zedboard, or use a desktop remotely. Unfortunately you can't run linaro directly on the board."

But you are clearly running Linaro on the Zybo.


The driver uses the HDMI module that is present on the Zybo base system, right? It is available anywhere?

author

When I wrote that tutorial, we didn't have the resources to write the correct driver for running a desktop, but now we do!

In the following forum post someone asks similar questions and you fill find links to what you need.

https://forum.digilentinc.com/index.php?/topic/430...

I'm sorry for the confusion I will fix that in my tutorial.

author

Thanks, I made it work with Linaro and archlinux. A tutorial to build the kernel with those "custom drivers" would be nice.

author
NicanorG (author)2015-05-03

I have a question related to the system implemented in this tutorial:

Can I use the external ports with this system? I plan to use them as digital outputs to control things like a relay (through a driver obviously) and also to perform serial communications with other modules.

Can I use the buttons, switches and LEDS in the board?

Or do I have to start over with a Vivado project?

author
joshwoldstad (author)NicanorG2015-05-04

https://www.instructables.com/id/Embedded-Linux-Tut...

This is an instructable that my coworker wrote, she works a lot more with FPGAs than me, and this will hopefully be able to help you out.

author
NicanorG (author)2015-04-29

I followed the tutorial and I'm getting the following error:

modprobe: FATAL: Could not load /lib/modules/3.17.0-xilinx-00114-gda2d296-dirty/modules.dep: No such file or directory.

And I get no GUI. The system boots, but only works on console. I tried startx command, but only the background appear.

Any help would be greatly appreciated. Thank you very much.

author
joshwoldstad (author)NicanorG2015-04-30

You don't have to worry about the modprobe error, it's just something that pops up on the system (we're working on getting rid of the error).

I'm not sure about the GUI, but I've got a couple of ideas. I would try using a different monitor first thing, the driver is written to auto-size to the screen, but we haven't tested it with 1080i video (all our monitors have 720p or 1080p).

It's also possible that your microSD card doesn't have the right kind of formatting, another person commented below: "Turns out my ZYBO_BOOT partition did not have a FAT32-32KB Cluster format. For some reason I could not do this with 1GB so I had to up it to 4GB."

author
NicanorG (author)joshwoldstad2015-05-01

Thank you very much.

After entering the command startx the GUI is running but I can't see the menu. If I try to take a screen shot using the screenshot key on the keyboard, the screenshot dialog appears. I can get the mouse cursor to appear if I press Ctrl+ Alt + L. But still I get no menu.

author
joshwoldstad (author)NicanorG2015-05-01

I was looking around some and I think this might help (from here, on the very last page)

"...this problem is reported quite frequently when the
(Micro)SD card is a non-Sandisk. The graphical software reads a large amount of
data from the card when starting up, and is therefore likely to be the notable victim of
an (Micro)SD card that generates read errors."

I'm using a Kingston 8GB class 10 MicroSD card, and that hasn't had any problems either.

author
NicanorG (author)joshwoldstad2015-05-01

I'm using the Micro SD than came with the Digilent kit, bought together with the Zybo.

author
joshwoldstad (author)NicanorG2015-05-04

Awesome! That's the kind I'm using so we know the SD card isn't the problem. I'd recommend using a different Linux distrubution (Fedora would be the best)

author
joshwoldstad (author)NicanorG2015-05-01

Hmmm... I'm not sure why that's happening, you can also check out the Digilent forums, there are people who know way more about the ZYBO than me, and they'll probably be able to help!

author
jose_enrique_catastrophe made it! (author)2015-04-27

Haha. Finally got this first part to work!! Turns out my ZYBO_BOOT partition did not have a FAT32-32KB Cluster format. For some reason I could not do this with 1GB so I had to up it to 4GB. In any case here is an image. I can go home now.

KIMG0185.jpg
author

Awesome! We were throwing ideas around that it could be anything from using 1080i (instead of 1080p) to just how your computer was formatting the file systems.

author

I think I have narrowed it down. So in my previous tries I have turned the Zybo on and I've only seen the red PGOOD light come on. I recently tried the base design found on the Digilent site and after the boot file was read from the SD card the green PROGB light came on and the everything ran fine. I then just pasted the boot files for this tutorial similarly to what the base design did and the Zybo actually booted, the green light came on, this of course did not fully work since I did not have the root_fs partition but I think what is happening is that I am not formatting the ZYBO_BOOT partition correctly. I will let you know once I have tried.

author

-Josh

Yea, I ran through the link below. I didn't see anything different. Another question is? Do we have program the Zynq to boot from SD card first? or is this already flashed somewhere on the board?

author
joshwoldstad (author)2015-04-21

To Jose,

As of right now, the monitor will only work if it's plugged into the HDMI port, VGA is still in the works. Some of the monitors we have around the office didn't display everything correctly.

We also have an updated guide at this link:

https://reference.digilentinc.com/zybo:zybo:zybotg...

which I hope helps!

-Josh

author

So I think my setup is correct. I have tried two different SD Cards and on both ubuntu and fedora. I have hunch, however, that it is the boot, uimage, and devicetree files that are not working. i believe it is because by downloading them I do not have permissions to write to or execute these files. When i try to extract to a mounted folder the terminal shows that these are read only files....Is there anyway to create these myself? I looked into this doc:

https://www.digilentinc.com/Data/Products/EMBEDDED...

but I am not sure how applicable it is and it mentions having to use the Xilinx tools. Lastly has anyone outside of your office successfully recreated the Zybot that could help a newbie out?

author

Hello. I am stuck on this step and i have several questions that perhaps you can answer. First it looks like there are several jumpers on the board to which I have matched the picture shown above is that correct? Also I connected the Zybo to the monitor and it just gives me color bands to which I ask, are there any monitor requirements if so where can I find them? Overall great tutorial though thanks for posting this.

About This Instructable

9,461views

18favorites

License:

More by joshwoldstad:Uploading Firmware to your chipKIT boardsFixing your Car keysUsing the PmodCON3 with chipKIT  products
Add instructable to: