【问题标题】:Beaglebone black - Debian 4.1 - PRU - prussdrv_open() failed with -1Beaglebone black - Debian 4.1 - PRU - prussdrv_open() 以 -1 失败
【发布时间】:2016-03-22 13:24:28
【问题描述】:

我以root http://mythopoeic.org/BBB-PRU/pru-helloworld/example.c 运行示例 我收到错误:

"prussdrv_open() failed with -1" during the execution

BBB 有Debian 4.1

这些是使用的命令:

sudo cp EBB-PRU-Example‐00A0.dtbo /lib/firmware
echo EBB-PRU-Example > /sys/devices/platform/bone_capemgr/slots
cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1
 1: PF----  -1
 2: PF----  -1
 3: PF----  -1
 4: P-O-L-   0 Override Board Name,00A0,Override Manuf,EBB-PRU-Example
modprobe uio_pruss
dmesg
[  195.985512] bone_capemgr bone_capemgr: part_number 'EBB-PRU-Example', version 'N/A'
[  195.994182] bone_capemgr bone_capemgr: slot #4: override
[  195.999703] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[  196.006752] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,EBB-PRU-Example'
[  196.039095] pruss_uio 4a300000.pruss: No children
[  196.057144] gpio-of-helper ocp:gpio_helper: ready
[  196.070956] bone_capemgr bone_capemgr: slot #4: dtbo 'EBB-PRU-Example-00A0.dtbo' loaded; overlay id #0

/boot/uEnv.txt 已禁用 HDMI

EBB-PRU-Example.dts

/* Device Tree Overlay for enabling the pins that are used in Chapter 13
* This overlay is based on the BB-PRU-01 overlay
* Written by Derek Molloy for the book "Exploring BeagleBone: Tools and 
* Techniques for Building with Embedded Linux" by John Wiley & Sons, 2014
* ISBN 9781118935125. Please see the file README.md in the repository root 
* directory for copyright and GNU GPLv3 license information.
*/
/dts-v1/;
/plugin/;

/ {
   compatible = "ti,beaglebone", "ti,beaglebone-black";

   part-number = "EBB-PRU-Example";
   version = "00A0";

   /* This overlay uses the following resources */
   exclusive-use =
         "P9.11", "P9.13", "P9.27", "P9.28", "pru0";

   fragment@0 {
      target = <&am33xx_pinmux>;
      __overlay__ {

         gpio_pins: pinmux_gpio_pins {         // The GPIO pins
            pinctrl-single,pins = <
               0x070 0x07  // P9_11 MODE7 | OUTPUT | GPIO pull-down
               0x074 0x27  // P9_13 MODE7 | INPUT | GPIO pull-down
            >;
         };

         pru_pru_pins: pinmux_pru_pru_pins {   // The PRU pin modes
            pinctrl-single,pins = <
               0x1a4 0x05  // P9_27 pr1_pru0_pru_r30_5, MODE5 | OUTPUT | PRU
               0x19c 0x26  // P9_28 pr1_pru0_pru_r31_3, MODE6 | INPUT | PRU
            >;
         };
      };
   };

   fragment@1 {         // Enable the PRUSS
      target = <&pruss>;
      __overlay__ {
         status = "okay";
         pinctrl-names = "default";
         pinctrl-0 = <&pru_pru_pins>;
      };
   };

   fragment@2 {         // Enable the GPIOs
      target = <&ocp>;
      __overlay__ {
         gpio_helper {
            compatible = "gpio-of-helper";
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&gpio_pins>;
         };
      };
   };
};

【问题讨论】:

    标签: linux debian beagleboneblack


    【解决方案1】:

    repos 中有两个用于 BBB 的 4.1 内核的预编译版本:“TI”版本和“Bone”版本。 TI 版本使用更新的 API 来控制 PRU,Bone 版本具有与 3.8 内核相同的 API,并且 prussdrv_open() 函数应该可以正常工作。 要安装 4.1 “bone”内核,您可以:

    cd /opt/scripts/tools
    sudo ./update_kernel.sh --bone-rt-kernel --lts-4_1
    

    更多信息:https://groups.google.com/forum/#!topic/beagleboard/cyM3f935wMA

    【讨论】:

    • 使用这种方法从 4.4.43 TI 内核迁移到 4.9.20 Bone 内核解决了我的问题。
    【解决方案2】:

    嗯,看起来类似于 previous issue.. 问题是 PRU 没有启用,我引用: echo BB-BONE-PRU-01 > /sys/devices/bone_capemgr.8/slots 修复了它。

    【讨论】:

    • 我用过:echo EBB-PRU-Example > /sys/devices/platform/bone_capemgr/slots
    【解决方案3】:

    您可以尝试使用 4.1.5-ti-r10 版本的内核。显然 pruss_uio 不适用于某些 4.1.x 内核。

    此外,您使用的 dts 文件对我也不起作用(不知道为什么)。我使用了以下,prussdrv_open 没有失败:

    /dts-v1/; 
    /plugin/; 
    
    / { 
        compatible = "ti,beaglebone", "ti,beaglebone-black"; 
    
        /* identification */ 
        part-number = "BB-ENABLE-PRU"; 
    
        /* version */ 
        version = "00A0"; 
    
            fragment@1 {         // Enable the PRUSS 
                    target = <&pruss>; 
                    __overlay__ { 
                        status = "okay"; 
                    }; 
            }; 
    }; 
    

    如果在该线程上找到所有这些:https://groups.google.com/forum/#!category-topic/beagleboard/VBNEoCbEHUQ

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-31
      • 1970-01-01
      • 1970-01-01
      • 2014-08-26
      • 1970-01-01
      • 2015-02-20
      • 2016-04-19
      相关资源
      最近更新 更多