【问题标题】:Bonescript Unable to find devicetree fragmentBonescript 找不到设备树片段
【发布时间】:2014-01-22 13:02:52
【问题描述】:

我正在使用 BeagleBone Black 并尝试运行 bonescript。我正在运行 Debian Wheezy,其中包含最新的更新以及 node v0.10.21 和 bonescript 0.2.4 的最新版本。我可以使内部 LED 闪烁,所以我相当确定我的安装工作正常。我的问题是我无法控制任何 P8 或 P9 gpios。使用 bonescript 网站上的示例,我正在运行以下脚本。我不确定这个错误到底意味着什么,所以即使有人能指出我正确的方向,我也会很感激。

谢谢 斯科特

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

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调试,得到了以下关于找不到设备树片段的输出。

root@debian-armhf:/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 -@ /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";

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            bs_pinmode_P8_3_0x2f: pinmux_bs_pinmode_P8_3_0x2f {
                pinctrl-single,pins = <0x018 0x2f>;
            };
        };
    };
    fragment@1 {
        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>;
            };
        };
    };

    fragment@1 {
        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>;
            };
        };
    };
};

【问题讨论】:

    标签: node.js gpio


    【解决方案1】:

    我们已经分叉了bonescript并发布了新的包。我们遇到了同样的错误,现在通过在原始骨骼脚本中重写大量代码来解决所有问题。您可以在您的项目中安装和使用。 https://www.npmjs.org/package/octalbonescript

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-19
      • 2023-03-11
      • 1970-01-01
      • 2014-05-21
      • 2021-11-23
      相关资源
      最近更新 更多