Intel Galileo and
e-Ink Reader
A Step By Step Guide
By:
Sriram Ranganathan Munish Sharma
Maharshi Shah
Pre-Requisite
Intel Galileo Board
Linux Host machine (Recommended: Ubuntu 12.04 Version)
o This machine should have Development Tools, GCC compiler and some other utilities like 7zip. Etc. This can be accomplished by running
following command
Sudo apt–get install build-essential p7zip-full
Windows Host Machine
o Download and install Teraterm Software on your Windows Host machine from following location
http://en.sourceforge.jp/projects/ttssh2/releases/
SD Card (Min Capacity: 1GB, 8GB Recommended)
E-Ink Display
o In our case we used 10.2 inch Pervasive Display available at below website
http://www.pervasivedisplays.com/
Required Cables for Connection:
Cable1: USB TYPE A to USB Micro B Cable
Cable 2: USB to 3.5mm TTL Serial Cable
Or
Serial Console Cable* and USB to RS232 Converter Cable with FTDI Driver
*See Annexure on how to create this cable
Cable 3: LAN Cable (Only if you want to connect Galileo through SSH)
Cable 4: USB Mini B to USB Micro B
Unboxing and Getting Started with Galileo
Unbox the Galileo and keep it handy to get started.
Download the Galileo software from the Intel website.
https://communities.intel.com/docs/DOC-22226
If you already have the Arduino IDE, don’t overwrite it. Even if the Intel software is based on the Arduino IDE, it is not 100% identical, and it will only manage the Galileo board, so if you want to use them both, simply unzip the Intel software, rename it into “Galileo”, and move it into your Application folder.
Don’t rename it into something with spaces, and do not put it into folders with a space in their name, because it won’t work.
Plug the 5V adapter, wait 10 seconds and then connect the USB client (the little usb port next to the ethernet plug) to your Host’s USB port
Open the device Manager. Under unknown devices, you will find a device with Name “Gadget Serial v2.4”
Right click on that Device, Gadget Serial Properties, select Update Driver Software. You will have two options select "Browse my computer for driver software." You will be prompted for a path, it should look something like this C:\arduino-1.5.3\hardware\arduino\x86\tools
Open Arduino IDE. Click and Select Tools->Board->IntelGalileo. Click and Select Tools->SerialPort->COMX (Where X is the COMPort Number on which Galileo is detected in Device Manager)
Now, you would need to update the Galileo’s firmware.
To update the Firmware, First Go on Help > Firmware Upgrade. If everything is ok, you should see a message asking for confirmation if the 5V power cable is plugged in. Since you have followed these instructions, it should be, so click yes, do the same on the next dialog and the process should begin. It will take 5-6 minutes. During the process, avoid touching the cables or the board or the IDE.
Just sit down and relax.
When the process is complete, the “Target Firmware upgraded successfully.”
message is displayed. Click OK to close the message.
Now choose the blink example from File > Examples > 01.Basics > Blink
Building Yocto Full Image for Galileo
Log in into your Linux Host machine. Go to Home Directory and create a folder name: “Yocto”
Download "Board Support Package Sources for Intel Quark" from
https://communities.intel.com/community/makers/software/drivers. And copy it to Yocto directory.
In our case the file name was
Board_Support_Package_Sources_for_Intel_Quark_v0.7.5.7z which we copied to Yocto Directory
Unzip the file using following command
7z x Board_Support_Package_Sources_for_Intel_Quark_v0.7.5.7z
Unzip meta-clanton_v0.7.5.tar.gz using following command:
tar xzvf Board_Support_Package_Sources_for_Intel_Quark_v0.7.5/meta- clanton_v0.7.5.tar.gz
Change directory to meta-clanton_v0.7.5:
cd meta-clanton_v0.7.5
Run setup.sh:
./setup.sh
Source poky/oe-init-build-env script, giving it the build directory (yocto_build) as a parameter:
source poky/oe-init-build-env yocto_build
To Compile Full Yocto Image, you would need to change following file:
vi ~/Yocto/Board_Support_Package_Sources_for_Intel_Quark_v0.7.5/meta- clanton_v0.7.5/yocto_build/conf/local.conf
This will open the local.conf file in Vi editor
You need to make changes in following lines in that file BB_NUMBER_THREADS = “4”
PARALLEL_MAKE = “-j 4”
MACHINE = “clanton”
DISTRO ?= “clanton-full”
EXTRA_IMAGE_FEATURES = “debug-tweaks tools-sdk”
Keep the other line items as it is.
Now save and close the file. To do this Press Esc and then “:wq!”
You should be back to yocto_build prompt. If not then run following command to go back to your build directory
cd ~/Yocto/Board_Support_Package_Sources_for_Intel_Quark_v0.7.5/meta- clanton_v0.7.5/yocto_build
Run bitbake to build the image:
bitbake image-full
Wait several hours, and if everything goes well you'll get your image in tmp/deploy/images/ directory. It will include:
o The Linux kernel: bzImage--3.8-r0-clanton-YYYYMMDDhhmmss.bin (YYYYMMDDhhmmss - timestamp indicating the build start time) o Initial RAM FS: core-image-minimal-initramfs-clanton-
YYYYMMDDhhmmss.rootfs.cpio.gz
o File system image: image-full-clanton-YYYYMMDDhhmmss.rootfs.ext3 o Kernel modules: modules--3.8-r0-clanton-YYYYMMDDhhmmss.tgz (not
really needed, they are already in the file system image) o Grub configuration: boot/grub/grub.conf
Copy these files to SD card renaming files as follows (resulting paths are relative to SD card's root):
o bzImage--3.8-r0-clanton-YYYYMMDDhhmmss.bin -> bzImage
o core-image-minimal-initramfs-clanton-YYYYMMDDhhmmss.rootfs.cpio.gz -
> core-image-minimal-initramfs-clanton.cpio.gz
o image-full-clanton-YYYYMMDDhhmmss.rootfs.ext3 -> image-full- clanton.ext3
o boot/grub/grub.conf -> boot/grub/grub.conf
o Note that you can keep names or use different names for all files except of the image-full-clanton.ext3, and just update grub.conf with the correct names. The file system image must be named image-full-clanton.ext3 (initramfs will look for that) unless you update the configuration.
Insert SD card to your Galileo board, reboot it, and enjoy!
Booting Galileo
Connect one end of Serial Console Cable to 3.5mm Audio Jack and other end to your Windows Host Machine. Now connect power cable to Galileo so Galileo should start booting.
Start TeraTerm
Click on Serial and Select the COM Port on which Galileo is connected.
Now select BaudRate in Setup->SerialPort->BaudRate to 115200. Press OK and you should start seeing the boot messages from Galileo.
After a minute or so, you will see a prompt with Clanton login:
Use “root” to login and the prompt will change to root@clanton:~#
Now, You are ready to work on Galileo! Enjoy!
Connecting e-Ink Display to Galileo
Connect e-Ink Display to Galileo on USB Host using Cable4(USB Mini B to USB Micro B)
It will be detected as USB Device mostly with Name 1-1. You would need cdc- acm driver to detect this device as Serial Device.
By Default this driver gets compile when we compile our full/mini image but it does not automatically load on every boot.
To load this driver run the following command
insmod /lib/modules/<linux version>/kernel/driver/usb/class/cdc-acm.ko
After running above command, remove and connect the e-Ink display again so it will be detected as ttyacm0 in devices.
Now you are ready to use the device as serial device and send the data to display the images.
In case you want to load this driver everytime you boot Galileo, then you can make following changes in auto.conf file available at /etc/modules-
load.d/auto.conf
Edit auto.conf file using vi editor and put a statement in it as follow cdc_acm
Annexure 1: Creating Serial to Aux Cable
This is how you can make a Serial to Aux Cable.
This way you will get a cable like below (Left):
You need a Serial to USB Cable (Above Right) like below if you do not have serial port on your laptop.
Connect the above two cables to create a complete Aux to USB Cable.
Annexure 2: Installing FTDI Driver and Detecting Galileo
on a COM Port in Windows
Download and Extract Intel_Galileo_Arduino_SW_1.5.3_on_Windows_v0.7.5.zip From below Website:
https://communities.intel.com/docs/DOC-22226 Connect Galileo to your Windows Host System.
Open Device Manager From Start->Control Panel->Hardware and Sound-> Device and Printer->Device Manager.
In Device Manager, Galileo will be detected as Gadget Serial 2.4 Device as shown in below image.
Right Click on that Device and Choose Update Driver. Select Browse My Computer for Driver Option
Now select the location as below for driver software
Intel_Galileo_Arduino_SW_1.5.3_on_Windows_v0.7.5/arduino-1.5.3/hardware/x86/tools
Press OK and a dialogue will popup asking whether to install driver or not. Choose Install Driver.
Within a Minute the driver will get installed and in Device Manager it will be listed as Galileo (COMxx) where xx is the COM port on which Galileo is connected.
Annexure 3: Connecting Galileo through SSH
How to - Use Galileo Linux with only an Ethernet cable directly connected between laptop and Galileo…
Attach the Ethernet cable directly from the Galileo to your Laptop.
Create a new sketch. In the setup function –
Start the telnet server on Galileo (system("telnetd -l /bin/sh");)
Give Galileo eth0 an IP address in the Link Local Address range 169.254.x.x (system("ifconfig eth0 169.254.1.1 netmask 255.255.0.0 up");)
Link Local Automatic addressing will assign your Windows or Mac an IP address, usually taking no longer than a minute.
Use putty or any Telnet client to connect to Galileo using the IP address you assigned to Galileo eth0.
How to – Use Galileo Linux using an Ethernet cable and a home network Router(DHCP server)
Attach Galileo to your router(DHCP server) using an Ethernet cable.
Create a new sketch –
In setup function - Start the telnet server on Galileo (system("telnetd -l /bin/sh");)
In Loop - Call ifconfig and redirect the output to ttyGS0 (system("ifconfig eth0 > /dev/ttyGS0");) so you can view Galileo’s IP address on the serial Monitor. We call this in the loop function because the serial monitor closes on sketch upload
Use putty or any Telnet client to connect to Galileo using the IP address returned on the Serial Monitor from ifconfig.
Annexure 4: Compile Time Error Section
During our Compilation, we faced following Error:
/home/munish/projects/gal/Board_Support_Package_Sources_for_Intel_Quar k_v0.7.5/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux- uclibc/nodejs/0.8.18-r0/node-
v0.8.18/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/whr lpool/wp_block.o ../deps/openssl/openssl/crypto/whrlpool/wp_block.c make[1]: execvp: printf: Argument list too long
make[1]: ***
[/home/munish/projects/gal/Board_Support_Package_Sources_for_Intel_Qua rk_v0.7.5/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux- uclibc/nodejs/0.8.18-r0/node-
v0.8.18/out/Release/obj.target/deps/openssl/libopenssl.a] Error 127 make[1]: Leaving directory
`/home/munish/projects/gal/Board_Support_Package_Sources_for_Intel_Qua rk_v0.7.5/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux- uclibc/nodejs/0.8.18-r0/node-v0.8.18/out'
make: *** [node] Error 2
ERROR: Function failed: do_compile
If you also face such error, please open
cd ~/Yocto/Board_Support_Package_Sources_for_Intel_Quark_v0.7.5/meta-
clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux/nodejs/0.8.18-r0/node-v0.8.18/out/
You will find a make file there. Open that file using any Text Editor and look for following line:
exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' Comment out that line like below
#exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' And try to compile, the error should go and compilation should complete successfully.
Images
References:
http://dev.mikamai.com/post/69163914657/intel-galileo-getting-started-with-mac-os-x http://en.sourceforge.jp/projects/ttssh2/releases/
http://www.malinov.com/Home/sergey-s-blog/intelgalileo-buildinglinuximage https://communities.intel.com/message/208564