From 4d55b9825ac4afccde0f48975e65df3028d554f4 Mon Sep 17 00:00:00 2001 From: Adam Engstrom Date: Thu, 5 Jan 2017 22:45:13 +0100 Subject: [PATCH] Add Vagrantfile with environment for flashing Only tested with BSL flashing, need USB rules for specific JTAG programmer. This directory is mapped into the home directory of the virtual machine so just go to ~/novatools and run make as normally. --- 99-hidraw.rules | 1 + Vagrantfile | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 99-hidraw.rules create mode 100644 Vagrantfile diff --git a/99-hidraw.rules b/99-hidraw.rules new file mode 100644 index 0000000..3a19553 --- /dev/null +++ b/99-hidraw.rules @@ -0,0 +1 @@ +KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", OWNER="vagrant" diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..edc87c5 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,30 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/trusty64" + + config.vm.synced_folder "./", "/home/vagrant/novatools" + + # Enable USB and attach Novatouch in bootloader mode to the VM + config.vm.provider "virtualbox" do |vb| + vb.customize ['modifyvm', :id, '--usb', 'on'] + vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'USB HID device', '--vendorid', '0x2047', '--productid', '0x0200'] + end + + config.vm.provision "shell", inline: <<-SHELL + sudo apt-get update + sudo apt-get install -y make gcc-msp430 libhidapi-hidraw0 mspdebug python-pip bzr linux-image-extra-$(uname -r) + + # udev rule to be able to access /dev/hidraw0 as vagrant user + cp novatools/99-hidraw.rules /etc/udev/rules.d + udevadm control --reload-rules ; udevadm trigger + + # python-msp430-tools upstream package is broken.. install directly from bzr repo + # https://bugs.launchpad.net/python-msp430-tools/+bug/936695 + pip install -e bzr+lp:python-msp430-tools#egg=python-msp430-tools + + # cleanup + apt-get -y autoremove + SHELL +end