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
- USB Splitter
- LAN Cable
- 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.
- Identify your SD card
- With your Micro SD card not plugged in, open up a terminal (CTRL + t), and enter the command lsblk. This will "list block devices."
- 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.
- Take note of where the card is located (i.e. sdb).
- If your Micro SD card has already been partitioned, there will be more than just sdb1 in sdb to unmount.
- 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
- 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.
- If you run the command again, it should just give you a not found notice.
- Enter the command sudo fdisk /dev/sdb. This will start the fdisk menu running.
- Press p(rint)and hit enter, this will display the partitions of the Micro SD card.
- Press d(elete)and hit enter, if there are multiple partitions already, be sure to delete all of them.
- 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.
- Press n to create the first partition. (Image 1)
- Press p for primary partition.
- Partition 1.
- Select default location for the beginning of the first partition, mine was 2048, but this might be different.
- Enter +1G for last sector, we just want one Gb of memory for the first partition. This finished up this partition.
- Press p for primary partition.
- Use defaults as all the rest of the choices for partitioning.
- Press w.
- 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!
- Enter sudo mkfs -t vfat -n ZYBO_BOOT /dev/sdb1into the terminal, this will format partition 1 and title it ZYBO_BOOT
- 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.
- mkdir -p /tmp/linaro
- Go into the Downloads folder by entering the commandscd Downloads
Now that your into Downloads enter the command sudo cp linaro-precise-ubuntu-desktop-20120923-436.tar.gz /tmp/linaro/fs.tar.gz
Now go into the the linaro folder we created, you can do this by using the command cd /tmp/linaro.
If everything went correctly, you can use the command ls and the only thing that should print out is fs.tar.gz
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.
- sudo umount /media/josh/ZYBO_BOOT
- sudo umount /media/josh/ROOT_FS
- 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:
- mkdir -p /tmp/sd_ext4
- sudo mount /dev/sdb2 /tmp/sd_ext4
- cd binary/boot/filesystem.dir/
- sudo rsync –a ./ /tmp/sd_ext4
- This will take a bit of time.
- 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.
- Download boot.zip and extract the files inside.
- After you extract everything, you'll see three binary files and a files folder.
- 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.
- Insert the Micro SD Card into the SD MICRO slot.
- Attach your LAN cable to the ZYBO and insert the other end into your router (or any place that has internet).
- Attach the HDMI cable to the ZYBO and plug it into your monitor.
- Attach power adapter.
- 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).
jose_enrique_catastrophe made it!
We have a be nice policy.
Please be positive and constructive.