Beagle Bone Black PRU overlay for fast I / O not working

I'm desperate to get PRU to work on my BBB. By working, I mean that I would like to use P8 pins 39-46 (GPIO2 [6-13]) as a fast output controlled by the PRU.

I have installed debian for BBB (2 weeks ago, should be current) on SD.

Then I started with the following article: http://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone/blog/2013/05/22/bbb--working-with-the- pru-icssprussv2

by doing this I got a PRU working with the LED example as well as pin P8 [12].

Now I am trying to get the other pins to work. I started all over again, slightly modifying the original am335x-boneblack.dtb. I have just activated PRU. I have not changed the LED heartbeat and also the P8.12 pin.

Then I turned off HDMI in uEnv.txt Now my "slots" look like this:

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-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN

      

I came across this post here: https://groups.google.com/forum/#!topic/beagleboard/JRG36bOURfk

EXACTLY what I would like to have, so I took dts (the second one), compiled it, copied to / lib / firmware and downloaded. Slots says the overlay has been loaded.

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-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-PRU-IO

      

BB-PRU-IO is me.

dmesg says:

... part_number 'BB-PRU-IO', version 'N/A'
... slot #7: generic override
... bone: Using override eeprom data at slot 7
... slot #7: 'Override Board Name,00A0,Override Manuf,BB-PRU-IO'
... slot #7: Requesting part number/version based 'BB-PRU-IO-00A0.dtbo
... slot #7: Requesting firmware 'BB-PRU-IO-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
... slot #7: dtbo 'BB-PRU-IO-00A0.dtbo' loaded; converting to live tree
... slot #7: #2 overlays
... slot #7: Applied #2 overlays.

      

Look good, I would say.

The problem is pinmux doesn't affect the seam:

pins for cats | grep 8a4 => pin 41 (44e108a4) 0000002f pinctrl-single

This is MODE 7 (GPIO Out). Not what I wanted. For all contacts, I decided to switch to PRU 5 mode.

Now I tried the supplied dtbo for PRU 01.02 in / lib / firmware

PRU-01.dtbo seems like a good example. Only Pin is different (P9.27). I downloaded it and modified the PRU example code. The pins did not show the expected result: pin 105 (44e109a4) 00000027 pinctrl-single When I run the modified test program from the first article, my osci shows a flat line.

I tried PRU-02.dtbo. At least the pins showed the expected result: pin 105 (44e109a4) 00000025 pinctrl-single When I run my little test program, I get a "bus error"

dmesg has multiple lines. i would say: [119.258978] WARNING: when arch / arm / mach-omap2 / omap_hwmod.c: 2096 _enable + 0x101 / 0x174 () [119.259004] omap_hwmod: pruss: the enabled state can only be entered from an initialized, idle or disabled state [119.259027] Modules related to: g_multi libcomposite btusb bluetooth rfkill uio_pruss mt7601Usta (O) .... multiple trace messages [119.272382] pru-rproc 4a300000.prurproc: # 8 PRU interrupts logged [119.272445] 4 pac-rpro000 Failed to read event array [119.287545] pru-rproc: probe 4a300000.prurproc failed with error -22

PRU-02 does more than PRU-01 (which I don't understand). And it doesn't seem to work for me.

Now I'm kind of helpless. Any ideas on this?

EDIT: I did what you shouldn't be doing. I changed the pinmux setting in the am335x-boneblack.dtb file. I just added: 0xA0 0x05 0xA4 0x05 0xA8 0x05 0xAC 0x05 0xB0 0x05 0xB4 0x05 0xB8 0x05 0xBC 0x05

in pinmux_userled_pins {pinctrl-single, pins = <

It works now, but I'm not happy with it. I will still appreciate a regular overlay file.

+3


source to share


1 answer


OK I got it working:

here it is:



/dts-v1/;
/plugin/;

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

    exclusive-use =
    "P8.46",
    "P8.45",
    "P8.44",
    "P8.43",
    "P8.42",
    "P8.41",
    "P8.40",
    "P8.39",
    "pr1_pru1_pru_r30_6",
    "pr1_pru_pru1_r30_7",
    "pr1_pru1_pru_r30_4",
    "pr1_pru1_pru_r30_5",
    "pr1_pru1_pru_r30_2",
    "pr1_pru1_pru_r30_3",
    "pr1_pru1_pru_r30_0",
    "pr1_pru1_pru_r30_1";

    fragment@0 {
    target = <&am33xx_pinmux>;
    __overlay__ {
        bs_pinmode_pru_out: pinmux_bs_pinmode_pru_out {
            pinctrl-single,pins = <0x0a4 0x5 0x0a0 0x5 0x0ac 0x5 0x0a8 0x5 0x0b4 0x5 0x0b0 0x5 0x0bc 0x5 0x0b8 0x5>;
        };
    };
};

    fragment@1 {
        target = <&ocp>;
        __overlay__ {
            bs_pinmode_pru_out_pinmux {
                compatible = "bone-pinmux-helper";
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <&bs_pinmode_pru_out>;
            };
        };
    };
};

      

I named the file bspm_pru_out-00A0.dts, compiled it to bspm_pru_out-00A0.dtbo and placed it in / lib / firmware.

You can load it via /boot/uEnv.txt or via echo ... to rc.local ... whatever.

+3


source







All Articles