I am trying a PRU example from Derek Molloy’s book, however whatever I do, pin values do not change. Could you please check what I am doing wrong?
dts file:
`
/* 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>;
};
};
};
};
`
I compile with:
`
dtc -O dtb -o EBB-PRU-Example-00A0.dtbo -b 0 -@ EBB-PRU-Example.dts
`
then copy it under /lib/firmware and do:
sudo sh ‐c "echo EBB‐PRU‐Example > $SLOTS"
Then I check:
$SLOTS output:
xsentius@beaglebone:~/chp13/overlay$ cat $SLOTS 0: PF---- -1 1: PF---- -1 2: PF---- -1 3: PF---- -1 6: P-O-L- 0 Override Board Name,00A0,Override Manuf,EBB-PRU-Example
dmesg output:
[ 701.582790] bone_capemgr bone_capemgr: slot #6: override [ 701.582839] bone_capemgr bone_capemgr: Using override eeprom data at slot 6 [ 701.582892] bone_capemgr bone_capemgr: slot #6: 'Override Board Name,00A0,Override Manuf,EBB-PRU-Example' [ 701.584950] bone_capemgr bone_capemgr: slot #6: dtbo 'EBB-PRU-Example-00A0.dtbo' loaded; overlay id #0
Everything seems normal up to here, but when I check pin values:
`
xsentius@beaglebone:~/chp13/overlay$ sudo cat $PINS|grep ‘103|105’
pin 103 (44e1099c.0) 00000027 pinctrl-single
pin 105 (44e109a4.0) 00000027 pinctrl-single
`
Those pins values seem not changed. They should be equal to 26 and 5.
Do you have an idea?
Here are my system properties:
xsentius@beaglebone:~/chp13/overlay$ uname -a Linux beaglebone 4.1.18-ti-rt-r56 #1 SMP PREEMPT RT Thu Mar 31 00:22:06 UTC 2016 armv7l GNU/Linux xsentius@beaglebone:~/chp13/overlay$ dtc --version Version: DTC 1.4.1-g1e75ebc9
Thanks