Carduino 2.0 – Intel Galileo Setup

Out of the box the Galileo is setup to run sketches uploaded from volatile memory, which is really lame. I didn’t spend much time with it using the stock SPI kernel. So, an SD card is pretty much required to do any serious development with this board. This is not a bad thing (although you aren’t running in real-time anymore), since having a full OS to use has lots of advantages. Plus, this way I can automate the build process in a way I’m more familiar with.

Anyway, so after unboxing and testing (and updating firmware while your at it), you can load an SD card up with the larger image. The SD card should be formatting as FAT16 (<= 4GB), or FAT32 (> 4GB). I tried formatting in Linux via mkfs (mkdosfs), but I was getting data errors from the SD card in my kernel messages. I ended up downloading the SD Formatter 4.0 software that others recommend, and it worked. This required a Windows (or Mac) computer. I still used Linux to copy the files without issue as I did not have 7zip on Windows (and Windows Updates were installing, preventing the MSI from allowing me to install it!). The tar command will spit out some errors about not being able to set permissions (because of the FAT FS), and exit with a failure code but it works.

The SD Card image expands to about 330MB (kernel, boot files, and file system image). I used a 1GB microSD card. The SD card tarball has a directory in it, but you need to extract the files within that folder to the root of the SD card:

tar xf ~/Downloads/SD_image.tar.bz2 --strip-components=1

You should have these files in the root of the SD card:

  1. boot (directory)
  2. bzImage
  3. core-image-minimal-initramfs-clanton.cpio.gz
  4. image-full-clanton.ext3

Next, slide the SD card in, power up the board and connect the USB and wait. You’ll see the SD LED light up a lot (it lights up for only ~10 seconds if formatted incorrectly, ~30-60s if not). Also, your ttyACM device should show up eventually if it boots successfully, allowing you to communicate with it if you don’t have the stereo-serial cable (Arduino->Terminal sketch). Otherwise, if you have a LAN and an ethernet cable the SD image is configured with DHCP, so just plug it in and power the board. Now you can use SSH like a civilized person. You’ll need to grab the IP address from either your router interface or the device itself (using the serial port/serial port sketch). Then you can really start messing around.

The Arduino sketches are run as a user (root, specifically), and they are started via some init scripts. Check out /etc/init.d/, /opt/cln/galileo, and /sketch/ for all the relevant files. You can disable the init scripts if you are feeling confident. You’ll need a stereo-serial cable if you screw up and don’t have SSH access.

You’ll see the board has some space left on the file system image.

root@clanton:/# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                  295.1M    140.3M    139.8M  50% /
none                    115.3M      4.0K    115.3M   0% /dev
/dev/mmcblk0p1          951.6M    303.9M    647.7M  32% /media/realroot
/dev/loop0              295.1M    140.3M    139.8M  50% /
/dev/mmcblk0p1          951.6M    303.9M    647.7M  32% /media/mmcblk0p1
tmpfs                   116.2M    132.0K    116.1M   0% /var/volatile
tmpfs                   116.2M         0    116.2M   0% /media/ram

You can use extra space on the SD card as well. Or, build a new image altogether (which is a bit more work).

Next will be developing native applications for the board so we can use the Arduino hardware.