Setting Up the Zybot-Software

by joshwoldstad in Circuits > Robots

12809 Views, 19 Favorites, 0 Comments

Setting Up the Zybot-Software

zybo.png

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!

Preparing Your Micro SD Card for Partitioning

IMG_0060.JPG
lsblk.png
lsblk2.png
part2.png

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.

Partitioning Your Micro SD Card

partition1.png
partition2.png
w.png

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.

Creating Your File Systems

mkfs.png

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/sdb1 into the terminal, this will format partition 1 and title it ZYBO_BOOT
  2. Enter sudo mkfs -t ext4 -L ROOT_FS /dev/sdb2 into 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.

Setting Up the Linux File System

linaro.png

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 commands cd 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.

Moving the File System Into the SD Card

commands.png
fs.png

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.

Adding Boot Loader

booter.png

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.

Downloads

Setting Up the ZYBO Board

WP_20150301_003.jpg
WP_20150301_005.jpg
WP_20150301_004.jpg

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).