This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
projects:virtualmachine:create_vm [2014-12-18 17:23] macke |
projects:virtualmachine:create_vm [2021-06-02 11:25] kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP center round important 60%> | ||
+ | This page has deprecated. Go to the readme of the github repository project: https:// | ||
+ | </ | ||
+ | |||
+ | ====== How to create your own VM ====== | ||
+ | If you don't want to download our VM you can create your own by following the instructions on this page. | ||
+ | |||
+ | ====== What you need ====== | ||
+ | There' | ||
+ | * Some visualization software, like [[https:// | ||
+ | * Any additional addons needed to get USB 2.0 functionality (like [[http:// | ||
+ | * A Linux distro. We use [[http:// | ||
+ | |||
+ | The rest of the instructions on this page will assume that you use VirtualBox and Xubuntu 14.10. | ||
+ | |||
+ | ====== Creating the VM ====== | ||
+ | After downloading VirtualBox, install it, install the VirtualBox extension pack and start VirtualBox: | ||
+ | * Go to // | ||
+ | * Go with the defaults and create a new disk (we use a 30GB dynamically allocated disk and 1024 MB RAM) | ||
+ | * When the VM is created, right-click on it and select settings | ||
+ | * Mount the Xubuntu iso on the storage tab | ||
+ | * Exit the settings, start the machine and install Xubuntu normally | ||
+ | * After installation, | ||
+ | * Start up the machine again and install the Guest additions for your VM host software | ||
+ | |||
+ | ====== Configuring Xubuntu ====== | ||
+ | First of all make sure that the system is up to date by running: | ||
+ | < | ||
+ | sudo apt-get update | ||
+ | sudo apt-get dist-upgrade | ||
+ | sudo reboot | ||
+ | </ | ||
+ | |||
+ | ===== Adding additional PPAs ===== | ||
+ | There' | ||
+ | |||
+ | < | ||
+ | sudo sh -c 'echo deb http:// | ||
+ | </ | ||
+ | |||
+ | After adding the extra PPAs you need to update the available packages: | ||
+ | < | ||
+ | sudo apt-get update | ||
+ | </ | ||
+ | |||
+ | ===== Installing software ===== | ||
+ | Most of the software that you will need is now available from the repositories so just run the following command to install it: | ||
+ | < | ||
+ | sudo apt-get -y install git kicad sdcc python2.7 python-usb python-qt4 qt4-designer kicad build-essential python-pip libsdl2-dev python-pyqtgraph openocd | ||
+ | </ | ||
+ | |||
+ | Install a Java JDK | ||
+ | < | ||
+ | sudo apt-get -y install openjdk-7-jdk | ||
+ | </ | ||
+ | |||
+ | Now install the Python SDL2 bindings using PIP | ||
+ | < | ||
+ | sudo pip install pysdl2 | ||
+ | </ | ||
+ | |||
+ | There' | ||
+ | < | ||
+ | sudo apt-get -y install gitg meld leafpad | ||
+ | </ | ||
+ | |||
+ | The [[https:// | ||
+ | |||
+ | Download it, unpack it, create a directory for it and copy it: | ||
+ | < | ||
+ | wget https:// | ||
+ | tar xjf gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2 | ||
+ | mkdir ~/bin | ||
+ | mv gcc-arm-none-eabi-4_9-2014q4 ~/ | ||
+ | </ | ||
+ | |||
+ | In order for the build system to find the toolchain when building the firmware it has to be added to the path: | ||
+ | < | ||
+ | echo -e " | ||
+ | source ~/.bashrc | ||
+ | </ | ||
+ | |||
+ | ===== Adding udev rules for Crazyradio ===== | ||
+ | In order to avoid being root when using the Crazyradio the following should be run to add udev rules for the Crazyradio and for the NRF bootloader used to update the Crazyradio firmware: | ||
+ | < | ||
+ | sudo usermod -a -G plugdev $USER | ||
+ | sudo sh -c 'echo SUBSYSTEM==\" | ||
+ | sudo sh -c 'echo SUBSYSTEM==\" | ||
+ | sudo sh -c 'echo SUBSYSTEM==\" | ||
+ | </ | ||
+ | |||
+ | ====== Clone the repos ====== | ||
+ | The following will create a project directory and clone all the Crazyflie/ | ||
+ | < | ||
+ | mkdir ~/projects | ||
+ | cd ~/projects | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | git clone git:// | ||
+ | </ | ||
+ | |||
+ | ====== Setting PyCharm ====== | ||
+ | Download [[https:// | ||
+ | < | ||
+ | sudo tar -xf pycharm-community-4.0.2.tar.gz -C /opt/ | ||
+ | echo -e " | ||
+ | source ~/.bashrc | ||
+ | </ | ||
+ | |||
+ | ====== Setting up Eclipse ====== | ||
+ | If you would like to build and debug the Crazyflie firmware using Eclipse follow the instructions below. Note that in order to do this you will need some device that can debug with JTAG. There' | ||
+ | * Download Eclipse CDT from [[https:// | ||
+ | * Unpack it into the home directory < | ||
+ | tar -xf < | ||
+ | </ | ||
+ | * Now import the project you are interested in by selecting // | ||
+ | * Configure the project to use the already cloned code in the project directory by setting the following settings: | ||
+ | * Project name: <same as the directory in projects> | ||
+ | * Use default location: False | ||
+ | * Location: / | ||
+ | * Project type: Makefile project -> Empty project | ||
+ | * Toolchains: -- Other Toolchain -- | ||
+ | |||
+ | Now install the CDT GDB addon by: | ||
+ | * Go to // | ||
+ | * Select //Work with// Luna .... | ||
+ | * Type //Filter// GDB | ||
+ | * Select and install the C/C++ GDB Harware debugging | ||
+ | |||
+ | Additional environment setup: | ||
+ | * Add the toolchain to the PATH | ||
+ | * Menu //Window -> Preferances// | ||
+ | * Add a new variable named //PATH// and set it to // | ||
+ | |||
+ | ====== Getting the latest versions ====== | ||
+ | Here's a script that will pull all the latest changes from the repos that is cloned. This will not work if you're developing, but if you are just running the software and want to update to the latest version it's ok. | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | # | ||
+ | # Simple script to update all the repos to the latest version. | ||
+ | |||
+ | for f in / | ||
+ | do | ||
+ | if [ -d " | ||
+ | echo " | ||
+ | cd $f | ||
+ | git pull | ||
+ | cd .. | ||
+ | fi | ||
+ | done | ||
+ | read -p "Press any key to exit" -n1 -s | ||
+ | </ | ||
+ | |||
+ | You can also create a shortcut on the desktop by right-clicking on it, selecting //Create launcher...// | ||
+ | * Name: Update all projects | ||
+ | * Command: / | ||
+ | * Run in terminal: True | ||
+ | |||
+ | When you click it the first time, select "Mark as executable" | ||
+ | |||
+ | ====== OVA export from VirtualBox ====== | ||
+ | Before the VM is exported as OVA the following should be done to make the image as small as possible: | ||
+ | * Inside the VM run the following commands: < | ||
+ | sudo apt-get autoremove | ||
+ | sudo apt-get autoclean | ||
+ | sudo apt-get clean | ||
+ | </ | ||
+ | * Now shut down the machine and do the following steps: | ||
+ | * Go to the settings for the VM, select storage and select the VDI image that has the installation. Make sure the //Solid state// options is set. Note the SATA port as well. | ||
+ | * Now go to a terminal and type the following: < | ||
+ | VBoxManage storageattach "< | ||
+ | </ | ||
+ | * Restart the machine and run the following command inside the VM: < | ||
+ | sudo fstrim -v / | ||
+ | </ | ||
+ | |||
+ | Now the VM can be exported as OVA by going to the menu // | ||
+ | {{tag> |