Upgrade to Pro — share decks privately, control downloads, hide ads and more …

カーネル/VM式ARMマイコン入門

 カーネル/VM式ARMマイコン入門

Linuxが動くARMマイコンボードBeagleBoneBlackにGentooを入れて電子工作する手順を解説します

635e53b96114c922fa5486b418895960?s=128

Fadis

May 09, 2015
Tweet

Transcript

  1. Χʔωϧ7.ࣜ ARMϚΠίϯೖ໳ Naomasa Matsubayashi

  2. @fadis_ Naomasa Matsubayashi

  3. #FBHMF#PBSEͬͯ஌ͬͯΔ

  4. None
  5. εϚʔτϑΥϯͱ͔ʹࡌͬͯΔ"3.ϓϩηοα %7*% 64#&UIFSOFU d

  6. #FBHMF#PBSE 3BTQCFSSZ1J d d ௒ಛՁ

  7. #FBHMF#POF 3BTQCFSSZ1J d 

  8. #FBHMF#POF#MBDL 3BTQCFSSZ1J d 

  9. None
  10. NJDSP)%.* 64#05( Ͳ͏΍ͬͯىಈ͢Ε͹ྑ͍ͷ

  11. Ͳ͏΍ͬͯىಈ͢Ε͹ྑ͍ͷ F..$ F..$ͱ͸ ϚϧνϝσΟΞΧʔυͷ ΨϫΛແͯ͘͠ ج൘ʹ௚઀ϋϯμ෇͚ Ͱ͖ΔΑ͏ʹͨ͠΋ͷ #FBHMF#POF#MBDLͷF..$ʹ͸ ࠷ॳ͔Β©OHTUSÖN͕ॻ͖ࠐ·Ε͍ͯΔ

  12. Ͳ͏΍ͬͯىಈ͢Ε͹ྑ͍ͷ ࣮૷͞Εͨӡ༻ ސ٬͕ຊ౰ʹඞཁͩͬͨ෺

  13. Ͳ͏΍ͬͯىಈ͢Ε͹ྑ͍ͷ ΛΠϯετʔϧ͠Α͏ ʹ

  14. (FOUPPΛΠϯετʔϧ͠Α͏ ΋͠طʹ(FOUPPΛ࢖͍ͬͯΔͷͳΒɺ #FBHMF#POF#MBDLʹ(FOUPPΛΠϯετʔϧ͢Δͷ͸೉͋͘͠Γ·ͤΜ IUUQEFWHFOUPPPSHdBSNJOBSNCFBHMFCPOFCMBDLJOTUBMMYNM

  15. ϒʔτͷྲྀΕ BNY 30. F..$ NJDSP4% .-0 VCPPUJNH [*NBHF .-0 VCPPUJNH

    ͕ͬͪ͜༏ઌ 6#PPU4-1 6#PPU (36#Ͱ͍͏TUBHF (36#Ͱ͍͏TUBHF
  16. 6#PPUΛϏϧυ͠Α͏ # crossdev -S armv7a-hardfloat-linux-gnueabi ΫϩείϯύΠϥΛΠϯετʔϧ # wget ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2 #

    tar xjpf u-boot-2013.04.tar.bz2 && cd u-boot-2013.04 # git clone https://github.com/beagleboard/meta- beagleboard.git # for i in meta-beagleboard/common-bsp/recipes-bsp/u-boot/ u-boot-denx/00*; do patch -p1 < $i; done 6#PPUͷιʔεΛμ΢ϯϩʔυͯ͠ #FBHMF#PBSE༻ͷύονΛ౰ͯΔ # make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux- gnueabi- am335x_evm_config # make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux- gnueabi- 6#PPUΛϏϧυ
  17. 6#PPUΛΠϯετʔϧ͠Α͏ 4%Χʔυ Ϧʔμʔ EFWTEC # wget http://dev.gentoo.org/~armin76/arm/beaglebone/ mkcard.sh # bash

    mkcard.sh /dev/sdb 30.͔Β࣮ߦ͞ΕΔϒʔτϩʔμʔ͕ಡΊΔΑ͏ʹ ύʔςΟγϣϯΛ੾Δ ໘౗ͳͷͰ༻ҙ͞ΕͨεΫϦϓτʹؙ౤͛
  18. 64#γϦΞϧίϯόʔλ 7༻ 6#PPUΛΠϯετʔϧ͠Α͏ /dev/sdb1 * 63 144584 72261 c W95

    FAT32 (LBA) /dev/sdb2 144585 15647309 7751362+ 83 Linux # mkdir /mnt/p1 && mount /dev/sdb1 /mnt/p1 # cp MLO u-boot.img /mnt/p1 γϦΞϧϙʔτ
  19. 6#PPUΛΠϯετʔϧ͠Α͏ musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4

    musb-hdrc: 28/31 max ep, 16384/16384 memory USB Peripheral mode controller at 47401000 using PIO, IRQ 0 musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn) musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory USB Host mode controller at 47401800 using PIO, IRQ 0 Net: <ethaddr> not set. Validating first E- fuse MAC cpsw, usb_ether U-Boot# 6#PPUίϯιʔϧ
  20. ΧʔωϧΛϏϧυ͠Α͏ #FBHMF#POF#MBDLͷϖϦϑΣϥϧͷυϥΠό͸ όχϥΧʔωϧʹೖ͍ͬͯͳ͍  ύον  ΠʔδʔϞʔυ  ύον 

    ϋʔυϞʔυ
  21. ΧʔωϧΛϏϧυ͠Α͏ # git clone https://github.com/beagleboard/kernel.git # cd kernel # git

    checkout origin/3.8 -b 3.8 # ./patch.sh # cd kernel ΧʔωϧΛर͖ͬͯͯύονΛ౰ͯΔ # wget "http://arago-project.org/git/projects/?p=am33x- cm3.git;a=blob_plain;f=bin/am335x-pm-firmware.bin;hb=HEAD" -O firmware/am335x-pm-firmware.bin ిݯ؅ཧ༻ϓϩηοαʹ৯΂ͤ͞ΔϑΝʔϜ΢ΣΞ # cp ../configs/beaglebone .config # make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux- gnueabi- menuconfig #FBHMF#POF༻ͷઃఆ͔ΒNFOVDPOpH
  22. ΧʔωϧΛϏϧυ͠Α͏ H[JQҎ֎ͰΧʔωϧΛѹॖ͢Δͱ Կނ͔FBSMZQSJOULΑΓલͰϋϯάͯ͠͠·͏ (FOFSBMTFUVQ,FSOFMDPNQSFTTJPONPEF

  23. ΧʔωϧΛϏϧυ͠Α͏ ཁΒͳ͍ϘʔυͷαϙʔτΛ੾Δ υϥΠόҰཡ͔Β໌Β͔ʹෆཁͳυϥΠό͕ফ͑Δ (FOFSBMTFUVQ5*0."14QFDJpD'FBSVSFT 5*0."1 ".99 (FOFSJD0."1 CPBSE 0."1#&"(-&CPBSE

  24. 0."1ͱ".Y 0."1 %BWJODJ ".Y 514 #FBHMF#PBSE #FBHMF#POF#MBDL

  25. ΧʔωϧΛϏϧυ͠Α͏ 0."1ͱ#&"(-&CPBSEΛ༗ޮʹ͓͔ͯ͠ͳ͍ͱ Ұ෦ͷ#FBHMF#POFʹඞཁͳઃఆ͕ӅΕͯ͠·͏ (FOFSBMTFUVQ5*0."14QFDJpD'FBSVSFT

  26. ΧʔωϧΛϏϧυ͠Α͏ ,FSOFM'FBUVSFT$PNQJMFUIFLFSOFMJO5IVNQNPEF ΧʔωϧΛ5IVNCͰ͸ͳ͘ "3.໋ྩηοτͰϏϧυ͢Δ

  27. "3.໋ྩηοτͱ5IVNC໋ྩηοτ 5IVNC໋ྩηοτ όΠτݻఆ௕ େମͷ"3.໋ྩηοτʹରԠ͢Δ໋ྩΛඋ͑Δ ྫ֎͕ൃੜ͢Δͱ"3.໋ྩηοτʹ໭Δ "3.໋ྩηοτͱ੾Γସ͑ͳ͕Β࢖͏ "3. 5IVNC ιϑτ΢ΣΞׂΓࠐΈͰ"3.ʹ໭ͬͯ͠·͏ͨΊ ΧʔωϧΛ"3.ɺϢʔβۭؒΛ5IVNCʹͯ͠࢖͏

  28. "3.໋ྩηοτͱ5IVNC໋ྩηοτ 5IVNC໋ྩηοτ όΠτόΠτՄม௕ શͯͷ"3.໋ྩηοτʹରԠ͢Δ໋ྩΛඋ͑Δ ྫ֎Λ5IVNC໋ྩηοτͰϋϯυϦϯάग़དྷΔ "OESPJEʹѪ͞Ε͍ͯΔ ιϑτ΢ΣΞׂΓࠐΈ͕ 5IVNC͚ͩͰย෇͚ΒΕΔͷͰ ΧʔωϧɺϢʔβۭؒڞʹ5IVNCʹग़དྷΔ

  29. "3.-JOVYͷ૯ຊࢁ -JOBSP

  30. "3.໋ྩηοτͱ5IVNC໋ྩηοτ 1IPSPOJYͷϕϯνϚʔΫʹΑΔͱɺ (FOUPP͕-JOBSPʹউͬͯ͠·ͬͨ͜ͱ͕͋Δ IUUQXXXQIPSPOJYDPNTDBOQIQ QBHFBSUJDMFJUFNHFOUPP@MJOBSP@PESPJE

  31. "3.໋ྩηοτͱ5IVNC໋ྩηοτ (FOUPP͸"3.໋ྩηοτΛ -JOBSP͸5IVNC໋ྩηοτΛ࢖͍ͬͯͨ 5IVNC໋ྩηοτ͸ ࣮ߦՄೳόΠφϦͷߴີ౓ԽͱҾ͖׵͑ʹ "3.໋ྩηοτΑΓੑೳ͕མͪΔ܏޲ʹ͋Δ 1IPSPOJYͷϕϯνϚʔΫʹΑΔͱɺ (FOUPP͕-JOBSPʹউͬͯ͠·ͬͨ͜ͱ͕͋Δ

  32. ΧʔωϧΛϏϧυ͠Α͏ %FWJDF%SJWFST(SBQIJDTTVQQPSU 0."1 %JTQMBZ4VCTZTUFNTVQQPSU͸ ඞͣϞδϡʔϧ.ʹ

  33. ΧʔωϧΛϏϧυ͠Α͏ %FWJDF%SJWFST..$4%4%*0DBSETVQQPSU 5*0."1.VMUJNFEJB$BSE*OUFSGBDFTVQQPSU )JHIU4QFFE͡Όͳ͍ํͷ..$ͷυϥΠόΛ੾Δ

  34. ..$ͱ4%Χʔυͷؔ܎ ϚϧνϝσΟΞΧʔυ 4%Χʔυ ্Ґޓ׵

  35. ..$ͱ4%Χʔυͷؔ܎ %"5 (/% $-, 7%% (/% $.% ະׂΓ౰ͯ

  36. ..$ͱ4%Χʔυͷؔ܎ %"5 %"5 %"5 (/% $-, 7%% (/% $.% %"5

    ͭͷσʔλઢͰ௨৴͢Δ ˠ)JHI4QFFE..$
  37. ..$ͱ4%Χʔυͷؔ܎ %"5 %"5 %"5 (/% $-, 7%% (/% $.% %"5

    NJDSP4%΋σʔλઢ͸ຊ
  38. ΧʔωϧΛϏϧυ͠Α͏ ஗͍ํͷ..$υϥΠόͷॳظԽ͕ઌʹ૸Δ ଎͍ํ͸σόΠε͕࢖༻தͰॳظԽʹࣦഊ͢Δ %FWJDF%SJWFST..$4%4%*0DBSETVQQPSU 5*0."1.VMUJNFEJB$BSE*OUFSGBDFTVQQPSU

  39. ΧʔωϧΛϏϧυ͠Α͏ # make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux- gnueabi- ͓΋ΉΖʹϏϧυ # mkfs.f2fs -L

    gentoo /dev/sdb2 # mkdir -p /mnt/p2 && mount /dev/sdb2 /mnt/p2 # cd /mnt/p2 # make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux- gnueabi- INSTALL_MOD_PATH=/mnt/p2 modules_install firmware_install # cp arch/arm/boot/zImage /mnt/p1/ # mkdir -p /mnt/p1/dtbs # cp arch/arm/boot/dts/am335x-boneblack.dtb /mnt/p1/dtbs 4%ΧʔυͷͭΊͷύʔςΟγϣϯΛ ޷͖ͳϑΝΠϧγεςϜͰϑΥʔϚοτͯ͠ ΧʔωϧΛΠϯετʔϧ
  40. (FOUPPΛΠϯετʔϧ͠Α͏ # cd /mnt/p2 # wget http://ftp.iij.ad.jp/pub/linux/gentoo/releases/arm/ autobuilds/current-stage3-armv7a_hardfp/stage3- armv7a_hardfp-20131006.tar.bz2 #

    tar xjpf stage3-armv7a_hardfp-20131006.tar.bz2 # wget http://ftp.iij.ad.jp/pub/linux/gentoo/snapshots/ portage-latest.tar.xz # tar xJpf portage-latest.tar.xz -C /mnt/p2/usr TUBHFͱQPSUBHFΛల։ # cat <<EOF >etc/fstab /dev/mmcblk0p1 /boot vfat noauto,noatime! 1 2 /dev/mmcblk0p2 / f2fs! noatime! ! 0 1 EOF GTUBCΛઃఆ
  41. NNDCML EFWTEB͡Όͳ͍ͷ ͕4%ΧʔυͷϓϩτίϧΛ஻Δ 4%Χʔυ Ϧʔμʔ ͕4%ΧʔυΛ64#ϚεετϨʔδʹݟ͔͚ͤΔ ͕64#ϚεετϨʔδΛ4$4*σΟεΫʹݟ͔͚ͤΔ ͕EFWTEC 4$4*σΟεΫ ʹݟ͑Δ

  42. NNDCML EFWTEB͡Όͳ͍ͷ ͕4%ΧʔυͷϓϩτίϧΛ஻Δ ͦͷ·· ʹಧ͘ʂ 64#ϚεετϨʔδυϥΠόͰ͸ͳ͘ ..$ϒϩοΫσόΠευϥΠό͕ॲཧ

  43. NNDCML EFWTEB͡Όͳ͍ͷ 64#ϚεετϨʔδυϥΠόͰ͸ͳ͘ ..$ϒϩοΫσόΠευϥΠό͕ॲཧ ͜ͷυϥΠό͕࡞ΔϒϩοΫσόΠεʹ Χʔωϧ͕෇͚Δ໊લ EFWNNDCML<> Q<> σόΠεΛࣝผ͢Δ൪߸ ύʔςΟγϣϯΛࣝผ͢Δ൪߸

  44. (FOUPPΛΠϯετʔϧ͠Α͏ # openssl passwd -1 Password: Verifying - Password: $1$N3kc0bfR$skOb0RdWIHxOen69/pstu0

    # vim etc/shadow ... root:$1$N3kc0bfR$skOb0RdWIHxOen69/pstu0:10770:0::::: ... SPPUύεϫʔυΛઃఆ # ln -sf /etc/init.d/swclock etc/runlevels/boot # rm etc/runlevels/boot/hwclock # touch sbin/rc ىಈ࣌ͷॲཧ͔Βϋʔυ΢ΣΞΫϩοΫΛ֎ͯ͠ ιϑτ΢ΣΞΫϩοΫΛ௥Ճ͢Δ
  45. (FOUPPΛΠϯετʔϧ͠Α͏ ి஑ͱ͔͍ͭͯͳ͍ 1$ʹ͸ ిݯ͕ڙڅ͞Ε͍ͯͳ͍ؒ #*04ͷઃఆͷҡ࣋ͱ ࣌ܭΛಈ͔͠ଓ͚ΔͨΊͷ ి஑͕͍͍ͭͯΔ   

                               
  46. (FOUPPΛΠϯετʔϧ͠Α͏ ೥݄೔ ɹԶ͸͍ͭ΋ͷΑ͏ʹϑΝΠϧͷ࠷ऴߋ৽࣌ࠁΛ νΣοΫ͠Α͏ͱͯ͠ɺحົͳࣄʹؾ͕͍ͭͨɻ ɹϑΝΠϧ͕ ೥ޙͷະདྷʹฤू͞Εͨࣄʹͳ͍ͬͯΔͷͩɻ Θ͚͕෼͔Βͳ͘ͳͬͨԶ͸ࢥΘͣ͜͏ڣΜͩ ʮBCPSU ʯ ͋Δϓϩηεͷखه

  47. (FOUPPΛΠϯετʔϧ͠Α͏ FUDJOJUETXDMPDLͰࢂܶΛճආ͢Δ γεςϜΛγϟοτμ΢ϯ͢Δ௚લʹ TCJOSDͷ࠷ऴߋ৽࣌ࠁΛߋ৽͢Δ γεςϜىಈ࣌ʹ TCJOSDͷ࠷ऴߋ৽࣌ࠁΛݱࡏͷ࣌ࠁʹ͢Δ γεςϜͷ࣌ࠁ͸ਖ਼͍͠ݱࡏ࣌ࠁͰ͸ͳ͍͕ ଞͷશͯͷϑΝΠϧͷ࠷ऴߋ৽࣌ࠁΑΓ͸ ਐΜͩ࣌ࠁʹͳΔ

  48. (FOUPPΛΠϯετʔϧ͠Α͏ # vim etc/inittab ... s1:12345:respawn:/sbin/agetty -L 9600 ttyS1 vt100

    Λ s1:12345:respawn:/sbin/agetty -L 115200 ttyO0 vt100 Ͱஔ͖׵͑Δ ... γϦΞϧ͔ΒϩάΠϯग़དྷΔΑ͏ʹ͢Δ
  49. (FOUPPΛΠϯετʔϧ͠Α͏ kernel_file=zImage initrd_file=uInitrd console=ttyO0,115200n8 mmcroot=/dev/mmcblk0p2 ro mmcrootfstype=f2fs rootwait fixrtc optargs=capemgr.disable_partno=BB-BONELT-HDMIN

    loadkernel=load mmc ${mmcdev}:${mmcpart} 0x80008000 ${kernel_file} loadinitrd=load mmc ${mmcdev}:${mmcpart} 0x81000000 ${initrd_file}; setenv initrd_size ${filesize} loadfdt=load mmc ${mmcdev}:${mmcpart} 0x815f0000 /dtbs/${fdtfile} console=ttyS0,115200n8 root=${mmcroot} rootfstype=${mmcrootfstype} $ {optargs} vram=24M omapfb.mode=hdmi:1024x768MR-16@60 omapdss.def_disp=hdmi omapfb.vram=0:4M,1:4M,2:4M,nolock mmcargs=setenv bootargs console=${console} console=ttyS0,115200n8 root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs} vram=24M omapfb.mode=hdmi:1280x720@60 omapdss.def_disp=hdmi omapfb.vram=0:8M, 1:8M,2:8M,nolock boot_ftd=run loadkernel; run loadfdt uenvcmd=run boot_ftd; run mmcargs; bootz 0x80008000 - 0x815f0000 {initrd_size} 0x815f0000 6#PPUͷઃఆϑΝΠϧV&OWUYUΛॻ͘
  50. (FOUPPΛΠϯετʔϧ͠Α͏ # cp uEnv.txt /mnt/p1/ # umount /mnt/p1 # umount

    /mnt/p2 V&OWUYUΛ[*NBHFͱಉ͡σΟϨΫτϦʹஔ͘ 4%Χʔυ Ϧʔμʔ
  51. (FOUPPΛΠϯετʔϧ͠Α͏ U-Boot SPL 2013.04-dirty (Jun 19 2013 - 09:57:14) musb-hdrc:

    ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn) musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory USB Peripheral mode controller at 47401000 using PIO, IRQ 0 musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn) musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory USB Host mode controller at 47401800 using PIO, IRQ 0 OMAP SD/MMC: 0 mmc_send_cmd : timeout: No status update reading u-boot.img reading u-boot.img U-Boot 2013.04-dirty (Jun 19 2013 - 09:57:14) I2C: ready DRAM: 512 MiB WARNING: Caches not enabled NAND: No NAND device found!!! 0 MiB
  52. FNFSHFͷ४උ # cat <<EOF >>/etc/conf.d/net config_eth0="dhcp" # cp /etc/init.d/net.lo /etc/init.d/net.eth0

    # rc-update add net.eth0 default # /etc/init.d/net.eth0 start FUIΛୟ͖ى͜͢ # vim /etc/portage/make.conf ... CFLAGS=”-O2 -pipe -march=armv7-a -mfpu=vfpv3-fp16 -mfloat- abi=hard” Λ CFLAGS="-Os -pipe -march=armv7-a -mcpu=cortex-a8 - mfpu=neon -mfloat-abi=hard" ʹม͑Δ ... $16Λ$PSUFY"ʹ '16Λ/&0/ʹ
  53. 7'1ͱ/&0/ 7'1 /&0/ "3.ʹ͸छྨͷුಈখ਺఺਺ԋࢉث͕͋Δ

  54. 7'1ͱ/&0/ 7'1 / CJUͷϨδελ͕ຊ·ͨ͸ຊ ୯ਫ਼౓࠷େͭɺഒਫ਼౓࠷େ͕ͭೖΔ ϕΫλಉ࢜ͷܭࢉ͸γʔέϯγϟϧʹ࣮ߦ͢Δ͔΋ *&&&ؙΊϞʔυʹରԠ ඇਖ਼نԽ਺Λѻ͑Δ "3.W͔Β֦ு໋ྩͱͯ͠౥ࡌ

  55. 7'1ͱ/&0/ /&0/ CJUͷϨδελ͕ຊ ୯ਫ਼౓࠷େͭɺCJU੔਺࠷େݸɺ CJU੔਺࠷େݸɺCJU੔਺࠷େݸ͕ೖΔ ϕΫλಉ࢜ͷܭࢉ͸4*.%Ͱ࣮ߦ͢Δ *&&&ؙΊϞʔυඇରԠ ඇਖ਼نԽ਺Λѻ͑ͳ͍ "3.W͔Β֦ு໋ྩͱͯ͠౥ࡌ

  56. 7'1ͱ/&0/ 7'1 /&0/ /&0/ͷϨδελ͸7'1ͷϨδελΛ ͭͮͭ૊ʹͨ͠΋ͷʹͳ͍ͬͯΔ ૒ํͷ໋ྩΛ૊Έ߹Θͤͯෆ଍Λิ͍ͳ͕Βܭࢉ͢Δ

  57. 7'1ͱ/&0/ HDD͸7'1ͱ/&0/ΛͲ͏࢖͏͔ NGQVWGQW 7'1WΛ࢖ͬͯුಈখ਺఺਺Λܭࢉ ௨ৗͷ"3.໋ྩΛ࢖ͬͯ੔਺Λܭࢉ NGQVOFPO 7'1WΛ࢖ͬͯුಈখ਺఺਺Λܭࢉ ௨ৗͷ"3.໋ྩͱ/&0/Λ࢖ͬͯ੔਺Λܭࢉ

  58. 7'1ͱ/&0/ HDD͸7'1ͱ/&0/ΛͲ͏࢖͏͔ TʙT 7'1Ϩδελ RʙR /&0/Ϩδελ vadd.i32 q1, q3, q5

  59. 7'1ͱ/&0/ HDD͸7'1ͱ/&0/ΛͲ͏࢖͏͔ TʙT 7'1Ϩδελ RʙR /&0/Ϩδελ vadd.f32 s5, s6, s14

  60. 7'1ͱ/&0/ /&0/ CJUͷϨδελ͕ຊ ୯ਫ਼౓࠷େͭɺCJU੔਺࠷େݸɺ CJU੔਺࠷େݸɺCJU੔਺࠷େݸ͕ೖΔ ϕΫλಉ࢜ͷܭࢉ͸4*.%Ͱ࣮ߦ *&&&ؙΊϞʔυඇରԠ ඇਖ਼نԽ਺Λѻ͑ͳ͍ "3.W͔Β֦ு໋ྩͱͯ͠౥ࡌ ͜ΜͳϠό͍ුಈখ਺఺਺ԋࢉث͔ͭ͑Ͷ͐Αʂ

  61. 7'1ͱ/&0/ ېஅͷढจ ͜ΜͳϠό͍ුಈখ਺఺਺ԋࢉث͔ͭ͑Ͷ͐Αʂ ුಈখ਺఺਺Λ/&0/Ͱܭࢉ͢ΔΑ GVOTBGFNBUIPQUJNJ[BUJPOT Ҿ਺͕༗ޮͳ஋Ͱ͋Δ͜ͱΛԾఆ *&&&΍"/4*ͷඪ४ʹҧ൓͢ΔڍಈΛڐ༰

  62. 7'1ͱ/&0/ HDD͸7'1ͱ/&0/ΛͲ͏࢖͏͔ TʙT 7'1Ϩδελ RʙR /&0/Ϩδελ vadd.f32 q2, s2, s12

  63. FNFSHFͷ४උ γεςϜͷશͯͷύοέʔδͷϏϧυʹ GVOTBGFNBUIPQUJNJ[BUJPOT ɹΛ෇͚Δͷ͸ා͍ # cat <<EOF >/etc/portage/env/enable_neon_fp CFLAGS="-O3 -pipe

    -march=armv7-a -mcpu=cortex-a8 - mfpu=neon -mfloat-abi=hard -ftree-vectorize -funsafe-math- optimizations -funroll-loops" CXXFLAGS="${CFLAGS}" EOF # cat <<EOF >/etc/portage/package.env media-libs/faad2 enable_neon_fp media-sound/mpg123 enable_neon_fp media-libs/mesa enable_neon_fp media-libs/libjpeg-turbo enable_neon_fp ... ුಈখ਺఺਺͕ॏཁͦ͏ͳύοέʔδ͚ͩ ෇͚͍ͯͬͯɺϠόͦ͏ͩͬͨΒҾͬࠐΊΔ
  64. ࣍ͷੈ୅ͷ"3.W CJU"3. Ͱ͸ ඪ४ʹ४ڌͨ͠7'1ͷڍಈͰ /&0/ͷ෯ͷුಈখ਺ԋࢉ͕ग़དྷΔΑ͏ʹͳ͍ͬͯΔ CJU"3.͸΍͘ීٴͯ͠ʔ

  65. "3.ΞʔΩςΫνϟͷछྨ "3.W "3.W "3.W "3.W "3.W "3.W "3. "3. "3.

    5 . 3 " "3. $PSUFY. $PSUFY3 $PSUFY" 55IVNC໋ྩରԠ .ϚΠΫϩίϯτϩʔϥ 5IVNCͷΈରԠ 3ϦΞϧλΠϜϓϩηοα "ΞϓϦέʔγϣϯϓϩηοα શ෦ೖΓ
  66. "3.ΞʔΩςΫνϟͷछྨ "3.W "3.W "3.W "3.W "3.W "3.W "3. "3. "3.

    5 . 3 " "3. $PSUFY. $PSUFY3 $PSUFY" ήʔϜϘʔΠΞυόϯε χϯςϯυʔ%4 ;BVSVT4-γϦʔζ 3BTQCFSSZ1J "SEVJOP%VF ॳ୅J1IPOF #FBHMF#PBSE J1IPOFT 147*5" େମͷεϚʔτϑΥϯ NCFE -1$6 5SJN4MJDF
  67. "3.ΞʔΩςΫνϟͷछྨ "3.W "3.W "3.W "3.W "3.WB "3.WB 5IVNC %41ԋࢉ '16

    7'1W 7'1W 7'1W /&0/ /&0/ 5IVNC 5IVNC&& ҉߸Խ Ծ૝Խࢧԉ #FBHMF#POF 3BTQCFSSZ1J
  68. "3.ΞʔΩςΫνϟͷछྨ "3.WB 0VUPG 0SEFS εʔύʔεΧϥ ϚϧνίΞ 7'1W -1"& Ծ૝Խࢧԉ "

    º º ˓ ˓ º º " º ˓ ˓ ˓ ˓ ˓ " º ˓ º º º º " ˓ ˓ ˓ º º ˓ " ˓ ˓ ˓ ˓ ˓ ˓ " ˓ ˓ ˓ ˓ ˓ ˓
  69. FNFSHFͷ४උ -march=armv7-a -mcpu=cortex-a8 HDDʹ"3.WBγϦʔζͷ$PSUFY"ͰΑΖ͘͠ ͱݴ͏ͨΊͷढจ

  70. ුಈখ਺఺਺ͷ"#* NqPBUBCJ ුಈখ਺఺਺ͷॲཧํ๏͕छྨ͔Βબ΂Δ NqPBUBCJTPGU ൚༻ϨδελͰड͚౉ͯ͠ ιϑτ΢ΣΞͰܭࢉ NqPBUBCJTPGUGQ ൚༻ϨδελͰड͚౉ͯ͠ ϋʔυ΢ΣΞͰܭࢉ NqPBUBCJIBSE

    7'1ϨδελͰड͚౉ͯ͠ ϋʔυ΢ΣΞͰܭࢉ ͜͜Ͱ"#*ޓ׵͕ແ͘ͳΔͷͰ ্ͱԼͷόΠφϦ͸ࠞͥΔͳةݥ
  71. ුಈখ਺఺਺ͷ"#* NqPBUBCJ BSNWB@IBSEGQ BSNWB औΓҧ͑ͳ͍Α͏ʹ஫ҙ

  72. FNFSHFͷ४උ CFLAGS=”-Os -pipe -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard” #FBHMF#POFͷҝͷ$'-"(4 CFLAGS=”-Os -pipe

    -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize” "VUPWFDUPSJ[BUJPOΛ࢖͏৔߹
  73. (FOUPPΛΠϯετʔϧ͠Α͏ ਅͬઌʹΠϯετʔϧ͢΂͖෺ EJTUDD # USE=-* emerge distcc # cat <<EOF

    >>/etc/portage/make.conf MAKEOPTS="-j4" FEATURES="distcc" EOF # distcc-config --set-hosts "<ϏϧυΛݞ୅ΘΓ͢Δϗετ>" Πϯετʔϧͯ͠ ϏϧυΛ೚ͤΔϗετΛઃఆ
  74. (FOUPPΛΠϯετʔϧ͠Α͏ # vim /etc/conf.d/distccd ... DISTCCD_OPTS="${DISTCCD_OPTS} --listen <BeagleBoneBlackͷ IPΞυϨε>" ...

    #FBHMF#POF͔ΒͷཁٻΛड͚ೖΕΔΑ͏ʹઃఆ # /etc/init.d/distccd start # /etc/init.d/distccd start ྆ํͰEJTUDDEΛىಈ
  75. (FOUPPΛΠϯετʔϧ͠Α͏ "3.ϚΠίϯ্ͰͷϏϧυ࣌ؒΛ ܶతʹ୹ॖ͢Δ *OUFMͷςΫϊϩδʔ

  76. (FOUPPΛΠϯετʔϧ͠Α͏ ͱมΘΒͳ͍ͷͰলུ ͋ͱ͸Yͷ

  77. 9Λಈ͔ͦ͏ NJDSP)%.* ө૾ग़ྗ͕͋ΔΜ͔ͩΒ 9αʔό͕ಈ͍ͯવΔ΂͖

  78. 9Λಈ͔ͦ͏ [ 10301.728] (II) Module omapfb: vendor="X.Org Foundation" [ 10301.728]

    ! compiled for 1.13.4, module version = 0.1.1 [ 10301.728] ! ABI class: X.Org Video Driver, version 13.1 [ 10301.728] (II) omapfb: Driver for OMAP framebuffer (omapfb) and external LCD controllers: ! omap1/2/3, S1D13745, HWA742 [ 10301.728] (--) using VT number 3 [ 10301.741] (WW) Falling back to old probe method for OMAPFB [ 10301.741] (WW) OMAPFBProbe: Not an omapfb device: [ 10301.741] (EE) No devices detected. [ 10301.741] Fatal server error: [ 10301.741] no screens found YGWJEFPPNBQGC ࡞ઓ
  79. 9Λಈ͔ͦ͏ # modprobe omapdss modprobe: ERROR: could not insert 'omapdss':

    No such device YGWJEFPPNBQ ࡞ઓ MJOVYͰΧʔωϧυϥΠόΛϩʔυ͠Α͏ͱ͢Δͱ Կނ͔σόΠε͕ແ͍ͱݴΘΕΔ MJOVYͰ͸ಈ͍͍ͯͨΒ͍͠
  80. 9Λಈ͔ͦ͏ YGWJEFPGCEFW ࡞ઓ # ls /dev/fb0 /dev/fb0 ϑϨʔϜόοϑΝσόΠε͸ಈ͍͍ͯΔ ΞΫηϥϨʔγϣϯ͸શ͘ޮ͔ͳ͘ͳΔ͚Ͳ GCEFWυϥΠόͰ9Λىಈग़དྷΔ

    Կނ͔F..$ͷ"OHTUSPN΋͜ͷํ๏Ͱ9Λىಈͯ͠Δ
  81. 9Λಈ͔ͦ͏

  82. Ͳ͜Ͱങ͑͹ྑ͍ͷ Digi-Keyͱ͔ͰചͬͯΔΑʂ

  83. ڞཱిࢠ ळ݄ిࢠ େࡕ ౦ژ Ͳ͜Ͱങ͑͹ྑ͍ͷ

  84. ͦΖͦΖϚΠίϯͬΆ͘࢖͓͏

  85. Χʔωϧ7.ࣜ ARMϚΠίϯೖ໳ Naomasa Matsubayashi

  86. -&% ͜͜ʹ-&%͕ͭ෇͍͍ͯΔ #FBHMF#POFͷΦϯϘʔυ-&%͸ (1*0ʹ઀ଓ͞Ε্ͨͰ Χʔωϧͷ-&%υϥΠό͕ૢ࡞͍ͯ͠Δ # ls /sys/class/leds/ beaglebone:green:usr0 beaglebone:green:usr1

    beaglebone:green:usr2 beaglebone:green:usr3
  87. -&% # ls /sys/class/leds/beaglebone\:green\:usr3/ brightness max_brightness subsystem uevent device power

    trigger CSJHIUOFTT ໌Δ͞Λઃఆ͢Δ -&%͕໌Δ͞ௐઅͷՄೳͳํ๏Ͱ઀ଓ͞Ε͍ͯΔ৔߹ ͔ΒNBY@CJSJHIUOFTT·Ͱͷ਺஋Λॻ͖ࠐΉͱ -&%ͷ໌Δ͕͞มԽ͢Δ ࢒೦ͳ͕Β(1*0઀ଓͷ-&%͸໌Δ͞Λௐઅग़དྷͳ͍
  88. -&% # ls /sys/class/leds/beaglebone\:green\:usr3/ brightness max_brightness subsystem uevent device power

    trigger USJHHFS -&%ΛޫΒͤΔ৚݅Λઃఆ͢Δ ಡΈग़͢ͱγεςϜ͕αϙʔτ͢Δ -&%ΛޫΒͤΔ৚͕݅ྻڍ͞ΕΔ # cat /sys/class/leds/beaglebone\:green\:usr3/trigger none nand-disk mmc0 [mmc1] timer oneshot heartbeat backlight gpio cpu0 default-on transient ͜ͷ-&%͸NND F..$ ΁ͷΞΫηε࣌ʹޫΔ
  89. -&% # ls /sys/class/leds/beaglebone\:green\:usr3/ brightness max_brightness subsystem uevent device power

    trigger USJHHFS # echo timer >/sys/class/leds/beaglebone\:green\:usr3/trigger -νΧΛ΍Γ͍ͨͷͰ৚݅ΛUJNFSʹ੾Γସ͑ # ls /sys/class/leds/beaglebone\:green\:usr3/ brightness delay_on max_brightness subsystem uevent delay_off device power trigger EFMBZ@POͱEFMBZ@P⒎͕ݱΕΔ
  90. -&% # ls /sys/class/leds/beaglebone\:green\:usr3/ brightness delay_on max_brightness subsystem uevent delay_off

    device power trigger EFMBZ@POEFMBZ@P⒎ 0/ʹͳΔ࣌ؒɺ0''ʹͳΔ࣌ؒ ͦΕͧΕϛϦඵͰઃఆ͢Δ # echo 10 >/sys/class/leds/beaglebone\:green\:usr3/delay_on # echo 490 >/sys/class/leds/beaglebone\:green\:usr3/delay_off
  91. -&% ࣗ෼Ͱ֎ʹ෇͚ͨ-&%Λ Χʔωϧͷ-&%υϥΠόͰಈ͔͢ʹ͸ Χʔωϧʹ-&%͕͋Δ͜ͱΛ఻͑Δඞཁ͕͋Δ

  92. %FWJDF5SFF 1$ͩͱσόΠεͷ৘ใΛ ʹڭ͑ͯ͘ΕΔౕ͕ډΔ 6&'*#*04"$1*ଞ "3.ϚΠίϯϘʔυʹ͸ͦ͏͍͏࢓૊Έ͕ແ͍ ͸ࣄલʹߏ੒Λ஌͍ͬͯͳ͚Ε͹ͳΒͳ͍

  93. %FWJDF5SFF # find /usr/src/linux-3.8.13-gentoo/arch/arm/mach-* /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91 /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/stamp9g20.h /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/soc.h /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/setup.c /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/sam9_smc.h /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/sam9_smc.c

    /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/pm_slowclock.S /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/pm.h /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/pm.c /usr/src/linux-3.8.13-gentoo/arch/arm/mach-at91/leds.c ... ಛఆͷϋʔυ΢ΣΞͷ৘ใΛฒ΂ͨίʔυͷ਺ʑ ͸ࣄલʹߏ੒Λ஌͍ͬͯͳ͚Ε͹ͳΒͳ͍
  94. %FWJDF5SFF -JOVTࢯͿͪ੾ΕΔ IUUQUISFBEHNBOFPSHHNBOFMJOVYLFSOFMGPDVT

  95. %FWJDF5SFF σόΠε৘ใΛΧʔωϧҎ֎ͷॴʹ෼཭͠Α͏ %FWJDF5SFF 0QFO'JSNXBSFͰ࢖ΘΕ͍ͯΔ γεςϜͷσόΠε৘ใΛهड़͢ΔϑΥʔϚοτ %54 %5# EUD Ұॹʹϩʔυͯ͠ ϒʔτ

    σόΠεͷछྨͱ ઃఆΛهड़
  96. %FWJDF5SFF BNYYEUTJ BNYCPOFDPNNPOEUTJ BNYCPOFCMBDLEUT %54ͷࡏॲ \,&3/&-@%*3^BSDIBSNCPPUEUT ".YYγϦʔζ ڞ௨ͷ৘ใ #FBHMF#POFγϦʔζ ݻ༗ͷ৘ใ

    #FBHMF#POF#MBDL ݻ༗ͷ৘ใ
  97. %FWJDF5SFF BNYCPOFDPNNPOEUTJ  HQJPMFET\ DPNQBUJCMFHQJPMFET QJODUSMOBNFTEFGBVMU QJODUSMVTFSMFE@QJOT MFE\ MBCFMCFBHMFCPOFHSFFOVTS HQJPTHQJP

    MJOVY EFGBVMUUSJHHFSIFBSUCFBU EFGBVMUTUBUFP⒎ ^  HQJPͷ൪໨ʹ HQJPMFETυϥΠό͕ ѻ͏͜ͱ͕Ͱ͖Δ -&%͕ܨ͕͍ͬͯͯ ໊લ͸ CFBHMFCPOFHSFFOVTS σϑΥϧτͷ༻్͸ IFBSUCFBU
  98. $BQF.BOBHFS #FBHMF#POFʹ͸$BQFͱݺ͹ΕΔ֦ுϘʔυ͕͋Δ "SEVJOPͰݴ͏TIJFMEΈ͍ͨͳ΋Μ IUUQDJSDVJUDPDPNTVQQPSUJOEFYQIQ UJUMF#FBHMF#POF@$BQFT

  99. $BQF.BOBHFS ֦ுϔομͷσόΠεΛ෇͚ସ͑Δ౓ʹ %FWJDF5SFFΛม͑ͯ࠶ىಈ͸ϝϯυΫαΠ ͜Ε ͬͪ͜΋ ࠶ىಈ͠ͳ͍Ͱ%FWJDF5SFFͷҰ෦Λߋ৽͍ͨ͠

  100. $BQF.BOBHFS # ls /lib/firmware/*.dtbo /lib/firmware/BB-ADC-00A0.dtbo /lib/firmware/BB-BONE-AUDI-01-00A0.dtbo /lib/firmware/BB-BONE-BACON-00A0.dtbo /lib/firmware/BB-BONE-BACONE-00A0.dtbo ... ৭Μͳ֦ுϘʔυ༻ͷ%FWJDF5SFFͷϓϥάΠϯ

    # cat /sys/devices/bone_capemgr.*/slots 0: 54:PF--- 1: 55:PF--- 2: 56:PF--- 3: 57:PF--- 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB- BONE-EMMC-2G 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB- BONELT-HDMI 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB- BONELT-HDMIN ݱࡏϩʔυ͞Ε͍ͯΔ%FWJDF5SFFͷϓϥάΠϯ
  101. $BQF.BOBHFS # echo cape-bone-iio >/sys/devices/bone_capemgr.10/slots "%$Λ**0σόΠεͱͯ͠࢖͏ϓϥάΠϯΛϩʔυ # cat /sys/devices/bone_capemgr.*/slots 0:

    54:PF--- 1: 55:PF--- 2: 56:PF--- 3: 57:PF--- 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB- BONE-EMMC-2G 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB- BONELT-HDMI 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB- BONELT-HDMIN 8: ff:P-O-L Override Board Name,00A0,Override Manuf,cape- bone-iio 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB- BONELT-HDMIN ݱࡏϩʔυ͞Ε͍ͯΔ%FWJDF5SFFͷϓϥάΠϯ
  102. -&% # emerge libftdi # cd /usr/src # git clone

    https://github.com/beagleboard/kernel.git # cd kernel # git checkout origin/3.8 -b 3.8 # ./patch.sh # cd kernel # make scripts/dtc # cp scripts/dtc /usr/sbin %FWJDF5SFFίϯύΠϥΛΠϯετʔϧ # cd /usr/src # git clone https://github.com/nomel/beaglebone.git # cd beaglebone/led-header/generated/ # ./compile.sh # ./install.sh -&%ͷ%54Λطʹ࡞͍ͬͯΔਓ͕͍Δ
  103. -&% # echo led-P9.12 >/sys/devices/bone_capemgr.*/slots ࠨଆͷ֦ுϔομͷ൪ϐϯΛ-&%ͱ͢Δ # ls /sys/class/leds/ beaglebone:green:usr0

    beaglebone:green:usr2 leds:P9.12 beaglebone:green:usr1 beaglebone:green:usr3 ΍͍ͤͷ-&%͕ͱͼ͖ͩͯͨ͠ # cd kernel # make scripts/dtc # cp scripts/dtc /usr/sbin %FWJDF5SFFίϯύΠϥΛΠϯετʔϧ # cd /usr/src # git clone https://github.com/nomel/beaglebone.git # cd beaglebone/led-header/generated/ # ./compile.sh # ./install.sh -&%ͷ%FWJDF5SFFΛطʹ࡞͍ͬͯΔਓ͕͍Δ
  104. -&% #FBHMF#POFͷ֦ுϔομ͸ ࠷େ N"·Ͱ͔͠ྲྀͤͳ͍ খ͍͞-&%Ͱ΋"SEVJOPͷΑ͏ʹ௚઀ܨ͙ͷ͸ ΍Ί͓͍ͯͨํ͕ྑ͍ -&% Њ

  105. -&% -&% LЊ Њ

  106. -&% # echo timer >/sys/class/leds/leds\:P9.12/trigger # echo 10 >/sys/class/leds/leds\:P9.12/delay_on #

    echo 490 >/sys/class/leds/leds\:P9.12/delay_off
  107. (1*0 εΠονΛ෇͚Α͏ Ж' LЊ

  108. # cd /usr/src/beaglebone/gpio-header/generated/ # ./compile.sh # ./install.sh (1*0ͷ%FWJDF5SFFϓϥάΠϯΛΠϯετʔϧ # echo

    gpio-P8.8 >/sys/devices/bone_capemgr.*/slots ӈଆͷ֦ுϔομͷ൪ϐϯΛ(1*0ͱ͢Δ # echo 67 >/sys/class/gpio/export (1*0Λ(1*0υϥΠόͷ഑Լʹ # echo rxEnable_pullUp >/sys/devices/ocp.*/gpio- P8.8_gpio67.*/state ϐϯͷঢ়ଶΛೖྗ͔ͭϓϧΞοϓʹ͢Δ ӈଆ൪ϐϯ͸4P$ͷ(1*0ʹܨ͕͍ͬͯΔ (1*0
  109. # cat /sys/class/gpio/gpio67/value 0 # cat /sys/class/gpio/gpio67/value 1 (1*0 #

    echo 67 >/sys/class/gpio/export (1*0Λ(1*0υϥΠόͷ഑Լʹ ӈଆ൪ϐϯ͸4P$ͷ(1*0ʹܨ͕͍ͬͯΔ
  110. FWEFW εΠον͕੾ΓସΘͬͨॠؒʹॲཧΛ͍ͨ͠ ࠓͷ··Ͱ͸ϢʔβۭؒͰϙʔϦϯά͕ඞཁ ੾ΓସΘͬͨॠؒʹ ͔Β௨஌ͯ͠ཉ͍͠ -JOVY*OQVU4VCTZTUFN

  111. FWEFW %FWJDF%SJWFST*OQVUEFWJDFTVQQPSU ,FZCPBSET(1*0#VUUPOT ੾ͬͯ͋ͬͨΒ༗ޮʹ͢Δ ϞδϡʔϧͰ΋0,

  112. --- gpio-P8.8-00A0.dts! 2013-10-15 22:29:14.871094049 +0900 +++ key-P8.8-00A0.dts! 2013-10-17 16:44:45.044921918 +0900

    @@ -8,7 +8,7 @@ ! compatible = "ti,beaglebone", "ti,beaglebone-black"; ! /* identification */ -! part-number = "gpio-P8.8"; +! part-number = "key-P8.8"; ! /* version = "00A0"; */ ! /* state the resources this cape uses */ @@ -106,6 +106,15 @@ ! ! ! ! pinctrl-4 = <&gpio_P8_8_rxDisable_pullDown>; ! ! ! ! pinctrl-5 = <&gpio_P8_8_rxEnable_pullDown>; ! ! ! }; +! ! ! gpio-key { +! ! ! ! compatible = "gpio-keys"; +! ! ! ! button@67 { +! ! ! ! ! linux,code = <67>; +! ! ! ! ! label = "toggle0"; +! ! ! ! ! gpios = <&gpio3 3 0>; +! ! ! ! ! gpio-key,wakeup; +! ! ! ! }; +! ! ! }; ! ! }; ! }; Ωʔίʔυ ద౰ ໊લUPHHMF ద౰ (1*0(1*0ͷ൪໨
  113. # dtc -@ -O dtb -o key-P8.8-00A0.dtbo key-P8.8-00A0.dts # cp

    key-P8.8-00A0.dtb0 /lib/firmwares HQJPLFZͷ%FWJDF5SFFΛΠϯετʔϧ # echo key-P8.8 >/sys/devices/bone_capemgr.*/slots ͦͯ͠ϩʔυ # ls /dev/input/by-path/ platform-44e0b000.i2c-event platform-gpio-key.17-event platform-gpio-keys.9-event ৽͍͠ΠϕϯτσόΠε͕ݱΕͨ # echo rxEnable_pullUp >/sys/devices/ocp.*/gpio- P8.8_gpio67.*/state ϐϯͷঢ়ଶΛೖྗ͔ͭϓϧΞοϓʹ͢Δ FWEFW
  114. # ls /dev/input/by-path/ platform-44e0b000.i2c-event platform-gpio-key.17-event platform-gpio-keys.9-event ৽͍͠ΠϕϯτσόΠε͕ݱΕͨ FWEFW # cat

    /dev/input/event2 |hexdump
  115. # ls /dev/input/by-path/ platform-44e0b000.i2c-event platform-gpio-key.17-event platform-gpio-keys.9-event ৽͍͠ΠϕϯτσόΠε͕ݱΕͨ FWEFW # cat

    /dev/input/event2 |hexdump 0000000 9c1c 525f d80a 000d 0001 0043 0000 0000 0000010 9c1c 525f d80a 000d 0000 0000 0000 0000
  116. # ls /dev/input/by-path/ platform-44e0b000.i2c-event platform-gpio-key.17-event platform-gpio-keys.9-event ৽͍͠ΠϕϯτσόΠε͕ݱΕͨ FWEFW # cat

    /dev/input/event2 |hexdump 0000000 9c1c 525f d80a 000d 0001 0043 0000 0000 0000010 9c1c 525f d80a 000d 0000 0000 0000 0000 0000020 9c1f 525f e8ad 0008 0001 0043 0001 0000 0000030 9c1f 525f e8ad 0008 0000 0000 0000 0000
  117. struct input_event { ! struct timeval time; ! __u16 type;

    ! __u16 code; ! __s32 value; }; UJNF UZQF DPEF WBMVF Πϕϯτ͕ൃੜͨ࣌͠ࠁ Πϕϯτͷछྨ Ωʔೖྗͱ͔Ϛ΢εͷҠಈͱ͔ ԿʹมԽ͕͔͋ͬͨ Ϛ΢εͷӈϘλϯͱ͔ Ͳ͏͍͏ঢ়ଶʹͳ͔ͬͨ FWEFW MJOVYJOQVUI
  118. FWEFW IUUQE TTIE TONQE σʔϞϯىಈ͢ΔεΠονͱ͔࡞ΕΔ

  119. ϦΞϧλΠϜΫϩοΫ ΍ͬͺΓٱʑͷىಈͰ΋ ਖ਼͍࣌ؒ͠ʹͳͬͯͯ΄͍͠ΑͶ *$઀ଓ35$.5 ࣌ܭ ి஑ ᣀ-JOVYͰԁ IUUQTUSBXCFSSZMJOVYDPNDBUBMPHJUFNT DPEF

  120. *$ *$ͱ͸ ུ͍ͯ͋͑͋͘͢͠͠ʔ ຊͷ৴߸ઢ ͭͷϗετίϯτϩʔϥʹෳ਺ͷσόΠε ൒ೋॏ௨৴ *OUFS*OUFHSBUFE$JSDVJU ".Yʹ΋*$ϗετ͕ͭࡌ͍ͬͯΔ σόΠεΛࣝผ͢ΔͨΊͷCJUຢ͸CJUͷΞυϨε νοϓؒͷγϦΞϧ௨৴ͷҝͷن֨

  121. #FBHMF#POFͷ*$ *$4$-   *$4%" *$4$-   *$4%" *$4$-

      *$4%"   *$4$-   *$4%" ֦ͨͩ͠ுϔομʹग़ͯΔͷ͸ͭ ".Yʹ΋*$ϗετ͕ͭࡌ͍ͬͯΔ
  122. ϦΞϧλΠϜΫϩοΫ *$4$-   *$4%" *$4$-   *$4%" *$4$-

      *$4%"   *$4$-   *$4%" 4%"   4$-   (/%   7%%   #FBHMF#POFͷ*$ʹ35$Λܨ͙
  123. ϦΞϧλΠϜΫϩοΫ #include <iostream> #include <string> #include <cstdlib> #include <cstdint> #include

    <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/spirit/include/karma.hpp> #include <boost/range/irange.hpp> #include <boost/range/algorithm.hpp> #include <boost/program_options.hpp> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <linux/i2c-dev.h> uint8_t unpack( uint8_t value ) { return ( ( value >> 4 ) & 0xF ) * 10 + ( value & 0xF ); } uint8_t pack( uint8_t value ) { return ( ( value / 10 ) << 4 ) | ( value % 10 ); } struct communication_failed {}; boost::posix_time::ptime get_time( int fd ) { std::vector< uint8_t > dump; dump.reserve( 8u ); boost::transform(boost::irange( 0u, 8u ), std::back_inserter( dump ), [&]( uint8_t addr ) { if( write( fd, &addr, 1 ) < 0 ) throw communication_failed(); uint8_t data;if( read( fd, &data, 1 ) < 0 ) throw communication_failed(); return data; } ); boost::posix_time::ptime now( boost::gregorian::date(2000+unpack( dump[ 7 ] ), unpack( dump[ 6 ] & 0x1F ), unpack( dump[ 5 ] & 0x3F )), boost::posix_time::time_duration(unpack( dump[ 3 ] & 0x3F ), unpack( dump[ 2 ] & 0x7F ), unpack( dump[ 1 ] & 0x7F )) ); return now; } void set_time( int fd, const boost::posix_time::ptime &time ) { std::vector< uint8_t > dump{{0,0, pack( time.time_of_day().seconds() ), pack( time.time_of_day().minutes() ), pack( time.time_of_day().hours() ), pack( time.date().week_number() ), pack( time.date().day() ), pack( time.date().month() ), pack( time.date().year() - 2000 ) }}; if( write( fd, dump.data(), dump.size() ) < 0 ) throw communication_failed(); } int main( int argc, char* argv[] ) {
  124. ϦΞϧλΠϜΫϩοΫ boost::posix_time::ptime now( boost::gregorian::date(2000+unpack( dump[ 7 ] ), unpack( dump[

    6 ] & 0x1F ), unpack( dump[ 5 ] & 0x3F )), boost::posix_time::time_duration(unpack( dump[ 3 ] & 0x3F ), unpack( dump[ 2 ] & 0x7F ), unpack( dump[ 1 ] & 0x7F )) ); return now; } void set_time( int fd, const boost::posix_time::ptime &time ) { std::vector< uint8_t > dump{{0,0, pack( time.time_of_day().seconds() ), pack( time.time_of_day().minutes() ), pack( time.time_of_day().hours() ), pack( time.date().week_number() ), pack( time.date().day() ), pack( time.date().month() ), pack( time.date().year() - 2000 ) }}; if( write( fd, dump.data(), dump.size() ) < 0 ) throw communication_failed(); } int main( int argc, char* argv[] ) { boost::program_options::options_description options("Options"); options.add_options()( "help,h", "show this message" ) ( "device,d", boost::program_options::value< std::string >(), "I2C device" ) ( "set,s", boost::program_options::value< std::string >(), "set current time" ) ( "get,g", "get current time" ); boost::program_options::variables_map variables; boost::program_options::store( boost::program_options::parse_command_line( argc, argv, options ), variables ); boost::program_options::notify( variables ); if( variables.count( "help" ) || !( variables.count( "device" ) ) || !( variables.count( "set" ) || variables.count( "get" ) ) || ( variables.count( "set" ) && variables.count( "get" ) ) ) std::cout << options << std::endl; else { const int fd = open( variables[ "device" ].as< std::string >().c_str(), O_RDWR ); if( fd < 0 ) exit( 1 ); ioctl( fd, I2C_SLAVE, 0x68 ); try { if( variables.count( "set" ) ) set_time( fd, boost::posix_time::time_from_string( variables[ "set" ].as< std::string >() ) ); else if( variables.count( "get" ) ) std::cout << get_time( fd ) << std::endl; } catch( const communication_failed& ) { exit( 1 ); } } } const int fd = open( variables["device"].as<std::string>().c_str(), O_RDWR ); ioctl( fd, I2C_SLAVE, 0x68 ); read( fd, &data, 1 ); write( fd, dump.data(), dump.size() );
  125. ϦΞϧλΠϜΫϩοΫ # ./i2c_clock -d /dev/i2c-1 -g 2013-Oct-15 08:28:13 ͪΐͬͱୟ͍ͯΈΔ

  126. ϦΞϧλΠϜΫϩοΫ ࣮͸ΧʔωϧυϥΠό͕͋Δ %FWJDF%SJWFST3FBM5JNF$MPDL%BMMBT.BYJN %4 45.5 &140/ "9

  127. ϦΞϧλΠϜΫϩοΫ # echo m41t62 0x68 >/sys/class/i2c-adapter/i2c-1/new_device # ls /dec/rtc* /dev/rtc0

    # hwclock Tue Oct 15 08:29:19 2013 -0.872509 seconds -JOVYΒ͍͠ํ๏Ͱ࣌ࠁ͕ͱΕΔ # rc-update delete swclock boot # rc-update add hwclock boot # vim /etc/init.d/hwclock ... start() { echo m41t62 0x68 >/sys/class/i2c-adapter/i2c-1/new_device ... ࣮͸ΧʔωϧυϥΠό͕͋Δ
  128. ϦΞϧλΠϜΫϩοΫ ͜ΕͰిݯΛམͱͯ͠΋ ࣍ճىಈ࣌ਖ਼͍࣌͠ࠁʹͳ͍ͬͯΔ # rc-update delete swclock boot # rc-update

    add hwclock boot # vim /etc/init.d/hwclock ... start() { echo m41t62 0x68 >/sys/class/i2c-adapter/i2c-1/new_device ...
  129. *$͕͍͚͔ͨΒ ࣍͸41*͍ͬͯΈΑ͏

  130. δϟΠϩηϯαʔ ςΩτʔͳ41*ͷσόΠε IUUQBLJ[VLJEFOTIJDPNDBUBMPHHH. -(% ळ݄ిࢠͰԁ

  131. 41* ຊͷ৴߸ઢ ͭͷϗετίϯτϩʔϥʹෳ਺ͷσόΠε શೋॏ௨৴ 4FSJBM1FSJQIFSBM*OUFSGBDF ".Yʹ΋41*ϗετ͕ͭࡌ͍ͬͯΔ νοϓηϨΫτઢͷຊ਺͚ͩσόΠεΛ෇͚ΒΕΔ पลػثͷγϦΞϧ௨৴ͷҝͷن֨ 41*ͱ͸

  132. #FBHMF#POFͷ41* ͨͩ͠ຊ͸ΦʔσΟΦ৴߸ͱڝ߹ ΋͏ຊ͸*$ͱڝ߹ 41*$4   41*% 41*$4  

    41*$4 410%   4$*4$-,     41*$4 41*%   41*% 41*4$-,       41*$4 ".Yʹ΋41*ϗετ͕ͭࡌ͍ͬͯΔ
  133. δϟΠϩηϯαʔ 41*$4   41*% 41*$4   41*$4 410%

      4$*4$-,     41*$4   4%0  4%*  4$-  $4  7*/  (/% 
  134. δϟΠϩηϯαʔ %FWJDF%SJWFST*OEVTUSJBM*0TVQQPSU%JHJUBM HZSPTDPQFTFOTPST45.JDSPFMFDUSPOJDT HZSPTDPQFT"YJT%SJWFS

  135. --- am335x-bone-common.dtsi.orig! 2013-10-17 23:18:50.595705986 +0900 +++ am335x-bone-common.dtsi! 2013-10-17 23:24:48.398440404 +0900

    @@ -52,6 +52,14 @@ ! ! ! ! 0x160 0x2f /* GPIO0_6 (PIN_INPUT | MUX_MODE7) */ ! ! ! >; ! ! }; +! ! spi0_pins: pinmux_spi0_pins { +! ! ! pinctrl-single,pins = < +! ! ! ! 0x150 0x30 /* spi0_sclk.gpio0_2, OUTPUT_PULLUP | MODE0 */ +! ! ! ! 0x154 0x30 /* spi0_d0.gpio0_3, INPUT_PULLUP | MODE0 */ +! ! ! ! 0x158 0x10 /* spi0_d1.i2c1_sda, OUTPUT_PULLUP | MODE0 */ +! ! ! ! 0x15c 0x10 /* spi0_cs0.i2c1_scl, OUTPUT_PULLUP | MODE0 */ +! ! ! >; +! ! }; ! }; ! ocp: ocp { @@ -548,3 +556,14 @@ ! status = "okay"; }; +&spi0 { +! pinctrl-names = "default"; +! pinctrl-0 = <&spi0_pins>; +! status = "okay"; +! gyrometer {
  136. ! ! }; +! ! spi0_pins: pinmux_spi0_pins { +! !

    ! pinctrl-single,pins = < +! ! ! ! 0x150 0x30 /* spi0_sclk.gpio0_2, OUTPUT_PULLUP | MODE0 */ +! ! ! ! 0x154 0x30 /* spi0_d0.gpio0_3, INPUT_PULLUP | MODE0 */ +! ! ! ! 0x158 0x10 /* spi0_d1.i2c1_sda, OUTPUT_PULLUP | MODE0 */ +! ! ! ! 0x15c 0x10 /* spi0_cs0.i2c1_scl, OUTPUT_PULLUP | MODE0 */ +! ! ! >; +! ! }; ! }; ! ocp: ocp { @@ -548,3 +556,14 @@ ! status = "okay"; }; +&spi0 { +! pinctrl-names = "default"; +! pinctrl-0 = <&spi0_pins>; +! status = "okay"; +! gyrometer { +! ! compatible = "st,l3g4200d"; +! ! reg = <0>; +! ! spi-max-frequency = <1000000>; +! }; +}; + 41*ͷ$4ʹδϟΠϩ͕͋Δ ϋʔυ΢ΣΞ͸MHHͰ ࠷େ.)[Ͱ௨৴ग़དྷΔ
  137. δϟΠϩηϯαʔ # ls /sys/bus/iio/devices/iio\:device0/ dev in_anglvel_z_scale in_anglvel_scale_available name in_anglvel_x_raw power

    in_anglvel_x_scale sampling_frequency in_anglvel_y_raw sampling_frequency_available in_anglvel_y_scale subsystem in_anglvel_z_raw uevent # cat /sys/bus/iio/devices/iio\:device0/in_anglvel_z_raw -105 ֯଎౓͕ͱΕΔ αʔό͕Կނ͔ߴ଎ճస͍ͯͨ͠Β ΞϥʔτϝʔϧΛඈ͹͢ ͱ͔Ͱ͖Δ
  138. Ξφϩά৴߸Λಡ΋͏

  139. #FBHMF#POFͷ"%$ ֦ͨͩ͠ுϔομʹग़͍ͯΔͷ͸ຊ  7%%@"%$ "*/   (/%"@"%$ "*/ 

     "*/ "*/   "*/ "*/   "*/ ".Yʹ͸νϟωϧͷ"%$͕͋Δ
  140. "%$ #FBHMF#POFͷϓϩηοα͸ 7Ͱಈ͍͍ͯΔ σδλϧ৴߸༻ͷϐϯ͸ શͯ 7ʹม׵͞Ε͍ͯΔ "%ίϯόʔλͷج४ిѹ͸ 7ʹͳ͍ͬͯΔ (/% 7ిݯ

    7ిݯ 7ిݯ 7*0 7*0
  141. "%ίϯόʔλͷج४ిѹ͸ 7ʹͳ͍ͬͯΔ ࣠Ճ଎౓ηϯαʔ ᣀ-JOVYͰԁ IUUQTUSBXCFSSZMJOVYDPNDBUBMPHJUFNT DPEF ಈ࡞ిѹ7 ֤࣠ํ޲ͷՃ଎౓͕ ࠷େ7ͷΞφϩά৴߸Ͱग़ͯ͘Δ 7ͷ"%$͸ࢮ͵

    "%$
  142. "%$ ख࣋ͪͷ෦඼ͷதͰ7ͷ"%$ʹܨ͛ͦ͏ͳϠπ ಾͷεϥΠυϘϦϡʔϜԁ

  143. "%$ Њ

  144. "%$ %FWJDF%SJWFST*OEVTUSJBM*0TVQQPSU"OBMPH UPEJHJUBMDPOWFSUFST5*`T"%$ESJWFS

  145. "%$ # modprobe ti_am335x_adc # echo BB-ADC >/sys/devices/bone_capemgr.10/slots # ls

    /sys/bus/iio/devices/iio\:device1/ ls /sys/bus/iio/devices/iio\:device1/ buffer in_voltage4_raw scan_elements dev in_voltage5_raw subsystem in_voltage0_raw in_voltage6_raw trigger in_voltage1_raw in_voltage7_raw uevent in_voltage2_raw name in_voltage3_raw power "%$ͷϞδϡʔϧͱ%54Λϩʔυ # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_raw 2367
  146. "%$ # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_raw 1 # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_raw 607 #

    cat /sys/bus/iio/devices/iio\:device1/in_voltage0_raw 1728 # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_raw 2871 # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_raw 4094 ຊ౰͸λονύωϧ༻Β͍͠
  147. 18. ".Yʹ͸νϟωϧͷ18.͕͋Δ  ͸ͣͳΜ͚ͩͲ # echo bone_pwm_P8_13 >/sys/devices/bone_capemgr.*/slots # dmesg

    [ 1757.358156] bone-capemgr bone_capemgr.10: part_number 'bone_pwm_P8_13', version 'N/A' [ 1757.358250] bone-capemgr bone_capemgr.10: slot #9: generic override [ 1757.358275] bone-capemgr bone_capemgr.10: bone: Using override eeprom data at slot 9 [ 1757.358301] bone-capemgr bone_capemgr.10: slot #9: 'Override Board Name, 00A0,Override Manuf,bone_pwm_P8_13' [ 1757.358497] bone-capemgr bone_capemgr.10: slot #9: Requesting part number/version based 'bone_pwm_P8_13-00A0.dtbo [ 1757.358524] bone-capemgr bone_capemgr.10: slot #9: Requesting firmware 'bone_pwm_P8_13-00A0.dtbo' for board-name 'Override Board Name', version '00A0' [ 1757.358553] bone-capemgr bone_capemgr.10: slot #9: dtbo 'bone_pwm_P8_13-00A0.dtbo' loaded; converting to live tree [ 1757.358987] bone-capemgr bone_capemgr.10: slot #9: #2 overlays [ 1757.359830] bone-capemgr bone_capemgr.10: slot #9: Applied #2 overlays. [ 1757.373925] pwm_test pwm_test_P8_13.17: unable to request PWM [ 1757.373986] platform pwm_test_P8_13.17: Driver pwm_test requests probe deferral ͳΜ͔υϥΠόͷॳظԽͰ͚ͯ͜Δ
  148. ·ͱΊ

  149. 1$-JOVYͰͷϓϩάϥϛϯάͱ ϚΠίϯϓϩάϥϛϯάͷ༥߹ #FBHMF#POF#MBDL

  150. ഑ઢ͸ܭըతʹ

  151. ͓·͚

  152. *OUFMº"SEVJOP TI AM3359౥ࡌ Arduino Tre CFBHMFCPBSEPSHº"SEVJOP IUUQBSEVJOPDDFO.BJO"SEVJOP#PBSE5SF

  153. *OUFMº"SEVJOP Intel Quark SoC X1000౥ࡌ Galileo IUUQBSEVJOPDDFO"SEVJOP$FSUJpFE*OUFM(BMJMFP

  154. ࢀߟ63- IUUQJOGPDFOUFSBSNDPNIFMQJOEFYKTQ IUUQDJSDVJUDPDPNTVQQPSUJOEFYQIQ UJUMF#FBHMF#POF#MBDL #FBHMF#POF#MBDL8JLJ IUUQEFWHFOUPPPSHdBSNJOBSNCFBHMFCPOFCMBDLJOTUBMMYNM (FOUPPPOUIF#FBHMF#POF#MBDL IUUQTHJUIVCDPNCFBHMFCPBSE #FBHMF#PBSEPSHPO(JUIVC IUUQTHJUIVCDPNOPNFMCFBHMFCPOF

    CFBHMFCPOFHQJPMFEIFBEFSPO(JUIVC IUUQIJQTUFSDJSDVJUTDPN IJQTUFSDJSDVJUT "3.*OGPDFOUFS
  155. 5IBOLZPVGPSMJTUFOJOH 18.͕ಈ͔ͳͯ͘ ग़൪͕ແ͔ͬͨCFFQج൘