2014/01/30

Intel Galileo BSP 0.9.0.7

經過數小時完成 0.9.0.7 版本的影像檔,檔案複製到SD 之後開機,確會停在如下畫面:


因為有之前 0.7.5 版的成功經驗,認為應該完成的image沒有問題才對,於是測試了一下終於找到問題,問題是 grub.conf 檔案的設定,比較如下:

正常可用的內容
title Clanton SVP kernel-MassStorage initrd-MassStorage big-rootfs IMR-On IO-APIC/HPET NoEMU debug
    root (hd0,0)
    kernel /bzImage root=/dev/ram0 console=ttyS1,115200n8 earlycon=uart8250,mmio32,0x8010f000,115200n8 reboot=efi,warm apic=debug rw LABEL=boot debugshell=5
    initrd /core-image-minimal-initramfs-clanton.cpio.gz

有問題的內容
title Clanton SVP kernel-MassStorage initrd-MassStorage image-full IMR-On IO-APIC/HPET NoEMU debug
    root (hd0,0)
    kernel /bzImage root=/dev/ram0 console=ttyS1,115200n8 earlycon=uart8250,mmio32,$EARLY_CON_ADDR_REPLACE,115200n8 reboot=efi,warm apic=debug rw LABEL=boot debugshell=5
    initrd /core-image-minimal-initramfs-clanton.cpio.gz

置換後終於正常開機



但是由 Adruino IDE 上傳 Sketch 時確無法使用,不是已經用 image-full-galileo 製作。



進入系統發現沒有原 /opt/cln/galileo 提供的檔案。
由 LINUX IMAGE FOR SD for Intel Galileo 提供的環境開機,將 /opt 下的檔案備出,儲存於SD卡上
#tar cvf opt.tar /opt
#cp opt.tar /media/realroot

再用0.9.0.7版的image啟動
#tar xvf /media/realroot/opt.tar

手動啟用 root@clanton:~# sh /opt/cln/galileo/launcher.sh &


發現 Arduino IDE 可以 Transfer complete 了,並正常執行程序。

將 Sketch clloader 載入與執行於每次開機即自動執行,進行修改 /etc/inittab 檔案,加上 galileo_sketch_reset 與 launcher 的設定。

複製 /opt/cln/galileo/launcher.sh 至 /etc/init.d
# cp /opt/cln/galileo/launcher.sh /etc/init.d


存檔後,執行指令,立即生效
# telinit q
或重新啟動系統。

這樣就完成一完全 Linux 功能,包括 gcc make 等開發工具,與原 Sketch 功能正常的環境。





2014/01/29

Intel Galileo BSP 0.7.5.7

Intel Galileo BSP (Board Support Package) 試作


由 Thingiverse 幫他找一個家。

因為出廠預設於SPI所含的 Linux 功能有限,於是參照 Intel Galileo BSP 的文件進行SD 載入的 Linux 系統建置,相關步驟記錄如:

操作環境 CentOS 6.4

需要的軟體安裝
$sudo yum install build-essential

$sudo yum install git (.setup.sh git)
$sudo yum install gcc   (bitbake gcc)
$sudo yum install gcc-c++               (bitbake c++, g++)
$sudo install texi2html texinfo           (bitbake makeinfo)

$sudo yum install wget
$sudo wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
$sudo rpm -i rpmforge-release-0.5.2-2.el6.rf.i686.rpm
$sudo yum install p7zip

下載 Intel 提供的BSP Source
$wget http://downloadmirror.intel.com/23171/eng/Board_Support_Package_Sources_for_Intel_Quark_v0.7.5.7z
$7za x Board_Support_Package_Sources_for_Intel_Quark_v0.7.5.7z
$tar xzvf Board_Support_Package_Sources_for_Intel_Quark_v0.7.5/meta-clanton_v0.7.5.tar.gz
cd meta-clanton_v0.7.5

$./setup.sh


環境設定
$source poky/oe-init-build-env yocto_build
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
[yjwang@proxycore yocto_build]$

修改需要的功能及參數
可另存設定檔後進行
$cp ../meta-clanton-distro/recipes-core/images/image-full.bb ../meta-clanton-distro/recipes-core/images/image-custom.bb


IMAGE_FEATURES += "package-management tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
or
IMAGE_ROOTFS_SIZE = "921600"
IMAGE_FEATURES += "package-management dev-pkgs"
IMAGE_INSTALL += "autoconf automake binutils binutils-symlinks cpp cpp-symlinks gcc gcc-symlinks g++ g++-symlinks gettext make libstdc++ libstdc++-dev file coreutils"

等的設定

執行
$bitbake image-custom
Pseudo is not present but is required, building this first before the main build
WARNING: Host distribution "CentOS-6.5" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |#########################################| Time: 00:03:18
Parsing of 1250 .bb files complete (0 cached, 1250 parsed). 1613 targets, 118 skipped, 0 masked, 0 errors.
Build Configuration:
BB_VERSION        = "1.18.0"
BUILD_SYS         = "i686-linux"
NATIVELSBSTRING   = "CentOS-6.5"
TARGET_SYS        = "i586-poky-linux-uclibc"
MACHINE           = "clanton"
DISTRO            = "clanton-tiny"
DISTRO_VERSION    = "1.4.2"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta            
meta-yocto      
meta-yocto-bsp    = "clanton:d734ab491a30078d43dee5440c03acce2d251425"
meta-intel        = "clanton:048def7bae8e3e1a11c91f5071f99bdcf8e6dd16"
meta-oe           = "clanton:13ae5105ee30410136beeae66ec41ee4a8a2e2b0"
meta-clanton-distro
meta-clanton-bsp
meta-clanton-galileo = "<unknown>:<unknown>"

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
$<50>Currently 1 running tasks (38 of 56):
$<50>WARNING: Failed to fetch URL ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://cheeseshop.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://www.apache.org/dist/apr/apr-1.4.6.tar.bz2, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://www.apache.org/dist/apr/apr-util-1.5.1.tar.gz, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://www.apache.org/dist/subversion/subversion-1.7.8.tar.bz2, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://downloads.sourceforge.net/libusb/libusb-compat-0.1.4.tar.bz2, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://downloads.sourceforge.net/libusb/libusb-1.0.9.tar.bz2, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://pkg-shadow.alioth.debian.org/releases/shadow-4.1.4.3.tar.bz2, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL http://downloads.sourceforge.net/project/libpng/libpng16/1.6.0/libpng-1.6.0.tar.xz, attempting MIRRORS if available
$<50>WARNING: Failed to fetch URL ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-2.11.src.tar.gz, attempting MIRRORS if available
$<50>NOTE: validating kernel config, see log.do_kernel_configcheck for details
$<50>Currently 7 running tasks (1702 of 2962):
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/x264/r2230+git-r1/packages-split/x264/usr/lib/libx264.so.129' has relocations in .text
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/libav/0.8.4+gitAUTOINC+2c8ce46250ff78191fe6565876ddc4bc03fdf519-r8.0/packages-split/libswscale/usr/lib/libswscale.so.2.1.0' has relocations in .text
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/libav/0.8.4+gitAUTOINC+2c8ce46250ff78191fe6565876ddc4bc03fdf519-r8.0/packages-split/libpostproc/usr/lib/libpostproc.so.52.0.0' has relocations in .text
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/libav/0.8.4+gitAUTOINC+2c8ce46250ff78191fe6565876ddc4bc03fdf519-r8.0/packages-split/libavutil/usr/lib/libavutil.so.51.22.1' has relocations in .text
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/libav/0.8.4+gitAUTOINC+2c8ce46250ff78191fe6565876ddc4bc03fdf519-r8.0/packages-split/libavformat/usr/lib/libavformat.so.53.21.0' has relocations in .text
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/libav/0.8.4+gitAUTOINC+2c8ce46250ff78191fe6565876ddc4bc03fdf519-r8.0/packages-split/libavfilter/usr/lib/libavfilter.so.2.15.0' has relocations in .text
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/libav/0.8.4+gitAUTOINC+2c8ce46250ff78191fe6565876ddc4bc03fdf519-r8.0/packages-split/libavdevice/usr/lib/libavdevice.so.53.2.0' has relocations in .text
$<50>WARNING: QA Issue: ELF binary '/home/yjwang/meta-clanton_v0.7.5/yocto_build/tmp/work/i586-poky-linux-uclibc/libav/0.8.4+gitAUTOINC+2c8ce46250ff78191fe6565876ddc4bc03fdf519-r8.0/packages-split/libavcodec/usr/lib/libavcodec.so.53.35.0' has relocations in .text
$<50>NOTE: Tasks Summary: Attempted 2962 tasks of which 1771 didn't need to be rerun and all succeeded.

Summary: There were 9 WARNING messages shown.

完成

參考資料來源
http://www.malinov.com/Home/sergey-s-blog/intelgalileo-buildinglinuximage
http://ph0b.com/adding-dev-tools-gcc-make-to-galileo-sd-image/

於 tmp/deploy/images 目錄中將檔案更名複製到 SD卡中
------------------------------------------------------------------------------------------------------------
rename  bzImage-*.bin  as bzImage
rename  core-image-minimal-initramfs-* as core-image-minimal-initramfs-clanton.cpio.gz
rename  image-* as image-full-clanton.ext3
boot folder as boot

完成SD image 開機,但確無法執行 sketch  clloader,並出現錯誤訊息。


再找了一些網站發現 Intel 於2014/01/21 出了新版本 0.9.0.7

https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23197
Quark_BSP_BuildGuide_329687_004.pdf
------------------------------------------------------------------------------------------------------------
下載2014/01/21 Board_Support_Package_Sources_for_Intel_Quark_v0.9.0.7z 依法製作
於0.9.07版中可使用 bitbake image-full-galileo ,是否就可以支援原有的 adruino sketch 功能,待完成後分曉。

Image-full-galileo.bb 內容如下包括 image-full.bb之設定
require image-full.bb
IMAGE_INSTALL += "galileo-target"
IMAGE_INSTALL += "mtd-utils-jffs2"
ROOTFS_POSTPROCESS_COMMAND += "install_sketch ; "
install_sketch() {
        install -d ${IMAGE_ROOTFS}/sketch
}