2014-01-22 62 views
0

我正在使用BeagleBone Black並嘗試運行bonescript。我正在運行Debian Wheezy以及最新的更新和最新版本的節點v0.10.21和bonescript 0.2.4。我能夠閃爍內部LED,所以我相當肯定我的安裝工作正常。我的問題是我無法控制任何P8或P9 gpios。使用bonescript網站上的示例,我正在運行以下腳本。我不確定這個錯誤究竟意味着什麼,即使有人能指出我正確的方向,我將不勝感激。Bonescript無法找到設備碎片

謝謝 Scottt

====================================== =======

var b = require('bonescript'); 
var led = "P8_3"; 
var state = 0; 

b.pinMode(led, b.output); 
toggleLED = function() { 
    state = state ? 0 : 1; 
    b.digitalWrite(led, state); 
}; 

timer = setInterval(toggleLED, 100); 

stopTimer = function() { 
    clearInterval(timer); 
}; 

setTimeout(stopTimer, 30000); 

==================================== ================= 我打開bonescript調試,並得到以下輸出有關無法找到devicetree片段。

[email protected]:/usr/lib/node_modules/bonescript# nodejs blinkext.js 
debug: cpuinfo = processor  : 0 
model name  : ARMv7 Processor rev 2 (v7l) 
BogoMIPS  : 660.76 
Features  : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls 
CPU implementer : 0x41 
CPU architecture: 7 
CPU variant  : 0x3 
CPU part  : 0xc08 
CPU revision : 2 

Hardware  : Generic AM33XX (Flattened Device Tree) 
Revision  : 0000 
Serial   : 0000000000000000 

debug: index.js loaded 
debug: pinMode(P8_3,,,,); 
debug: templateFilename = /usr/lib/node_modules/bonescript/bspm_template.dts 
debug: fragment = bspm_P8_3_2f 
debug: command = dtc -O dtb -o /lib/firmware/bspm_P8_3_2f-00A0.dtbo -b 0 [email protected] /lib/firmware/bspm_P8_3_2f-00A0.dts 
error: Failed to find devicetree fragment: bspm_P8_3_2f 
info: 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 

debug: Unable to configure mux for pin [object Object]: Error loading devicetree overlay for P8_3 using template bspm 
debug: getPinMode(P8_3); 
debug: getPinMode(P8_3): Error: ENOENT, no such file or directory '/sys/kernel/debug/pinctrl/44e10800.pinmux/pins' 
debug: pinMode: mode = {"pin":"P8_3","name":"GPIO1_6","options":["gpmc_ad6","mmc1_dat6","NA","NA","NA","NA","NA","gpio1_6"],"gpio":{"allocated":false}} 
debug: getPinMode(P8_3); 
debug: getPinMode(P8_3): Error: ENOENT, no such file or directory '/sys/kernel/debug/pinctrl/44e10800.pinmux/pins' 
info: Error loading devicetree overlay for P8_3 using template bspm 

=========================================== ============ 這是我相信是bonescript創建的疊加模板。

/* 
* This is a template-generated file from BoneScript 
*/ 

/dts-v1/; 
/plugin/; 

/{ 
    compatible = "ti,beaglebone", "ti,beaglebone-black"; 
    part_number = "BS_PINMODE_P8_3_0x2f"; 
    version = "00A0"; 

    exclusive-use = 
     "P8.3", 
     "gpio1_6"; 

    [email protected] { 
     target = <&am33xx_pinmux>; 
     __overlay__ { 
      bs_pinmode_P8_3_0x2f: pinmux_bs_pinmode_P8_3_0x2f { 
       pinctrl-single,pins = <0x018 0x2f>; 
      }; 
     }; 
    }; 
    [email protected] { 
     target = <&ocp>; 
     __overlay__ { 
      bs_pinmode_P8_3_0x2f_pinmux { 
       compatible = "bone-pinmux-helper"; 
       status = "okay"; 
       pinctrl-names = "default"; 
       pinctrl-0 = <&bs_pinmode_P8_3_0x2f>; 
     target = <&am33xx_pinmux>; 
     __overlay__ { 
      bs_pinmode_P8_3_0x2f: pinmux_bs_pinmode_P8_3_0x2f { 
       pinctrl-single,pins = <0x018 0x2f>; 
      }; 
     }; 
    }; 

    [email protected] { 
     target = <&ocp>; 
     __overlay__ { 
      bs_pinmode_P8_3_0x2f_pinmux { 
       compatible = "bone-pinmux-helper"; 
       status = "okay"; 
       pinctrl-names = "default"; 
       pinctrl-0 = <&bs_pinmode_P8_3_0x2f>; 
      }; 
     }; 
    }; 
}; 

回答