Skip to Content

本 (Ben) NanoNote Editing/Compiling/Flashing an Arduino sketch



Following we detail the steps needed to edit, build, an upload an  Arduino directly on 本 (Ben) NanoNote

First is to have serial port accessible and be sure it works as explained in this post

Then we proceed to install Debian on Ben, basically following the  pyneo.org instructions but using other  uboot/kernel/rootfs, I recommend the reading of  this wiki page about Ben NanoNote flashing

wget http://downloads.qi-hardware.com/software/images/Ben_NanoNote_2GB_NAND/latest/openwrt-xburst-u-boot.bin
wget http://pyneo.org/downloads/nano/openwrt-xburst-qi_lb60-uImage.bin
wget http://mister-muffin.de/nanonote/debian-sid.ubi

Put NanoNote on  USBboot mode and like root on the host PC where you have NanoNote connected

usbboot -c "boot"
usbboot -c "nerase 0 4096 0 0"
usbboot -c "nprog 0 openwrt-xburst-qi_lb60-u-boot.bin 0 0 -n"
usbboot -c "nprog 1024 openwrt-xburst-qi_lb60-uImage.bin 0 0 -n"
usbboot -c "nprog 2048 debian-sid.ubi 0 0 -n"

When it finish, next boot will be done in a brand new Debian  :),

Let fill it with some packages,
Connect NanoNote to  internet though USB
The Debian image I have installed have some issues with the ssh keys but are easily solved reinstall ssh.
apt-get remove openssh-server
apt-get install openssh-server

This will install packages build tools and base libraries needed to compile in C like make, autotools, etc...
apt-get install build-essential

But to compile to Arduino (Atmel architecture) we need the following too
apt-get install gcc-avr avr-libc binutils-avr

and to upload the result binaries to the Arduino board.
apt-get install avrdude

To be able to use the libraries and hardware definitions from the Arduino software we need to copy them into NanoNote from an already installed Arduino IDE, for example in you host PC, in my Ubuntu machine is on  /usr/share/arduino

we create on the NanoNote the following directory
mkdir /usr/share/arduino
on PC
scp -r /usr/share/arduino root@192.168.254.101:/usr/share/arduino

use your own NanoNote IP address.

Only the Makefile left, the Makefile has to be in same folder where you have the sketch(.pde file), I have modified the original one from   http://johanneshoff.com/arduino-command-line.html to adapt it to Arduino Duemilanove, my library path, serial port device and some other chages to aling it with the 018 version, you can  download my modifie Makefile here
From here nothing you have not seen in the video, it's as easy as move to the folder where the .pde and Makefile are and
make
make upload

Hey wait! I forget one thing, due we are not using the USB connection but  0 & 1 serial pins this cannot make use of the autoreset feature, so we must press the Arduino reset button just before avrdude starts .

I have in the TODO list haw to deal with the dependencies with other libraries like (Ethernet, PID,...) when I find a few time I will go for it.
Happy Hacking :)