lauantai 27. syyskuuta 2014

Installing Digispark extensions for Arduino at Ubuntu system

Now as nights become darker, it is time to get hands on OLIMEXINO-85BC board I bought last spring. The first thing is to set up development environment. Unfortunately, instructions follow bad system management style (aka Windows style: just copy over installation) that will lead to problems with upgrades at some point.
Making full Debian package was a bit too complicate to do before Saturday night sauna, so decided just to make local install from existing arduino setup.
sudo cp -a --reflink /usr/share/arduino /usr/local/share/digispark-arduino
sudo cp -a --reflink /usr/bin/arduino /usr/local/bin/sparkduino
Running on btrfs filesystem, so those file content take no additional disk space with --reflink option. Then edited the /usr/local/bin/sparkduino (with sudo) and changed the APPDIR variable.
APPDIR=/usr/local/share/digispark-arduino
After that followed instructions on this new location. First copied files on place. Because debian/ubuntu by default has all documentation in /usr/share/doc both the examples and reference are symlinks, now broken as they are relative. We need to fix them also here. We just replace examples with digispark ones.
cd /usr/local/share/digispark-arduino
sudo rm examples reference
sudo cp -a /tmp/DigisparkArduinoIntegration-master/* .
ln -s /usr/share/doc/arduino-core/reference .
To replace avrdude with custom wrapper, I compiled the version and installed it to /usr/local/bin.
Again, to avoid any changes to system default install, I made a symlink from avrdude_orginal to /usr/bin/avrdude. As the wrapper program above execs the file in the same directory where it was found this works nicely.
sudo ln -s /usr/bin/avrdude /usr/local/bin/avrdude_original
Then compiled micronucleus command line utility, in addition to packages provided by build-essential package, at least also libusb-dev was needed. Complained about missing usb.h header file.
So far they share same preference file, but also that could be taken care with suitable wrapper. Needs to check where java reads user.home variable.

Ei kommentteja:

Lähetä kommentti