New Device Tree Do not Change Pin Values

332 views
Skip to first unread message

Xsentius

unread,
Apr 4, 2016, 8:04:59 AM4/4/16
to BeagleBoard
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

Message has been deleted
Message has been deleted

Robert Nelson

unread,
Apr 4, 2016, 10:27:48 AM4/4/16
to Beagle Board, frankth...@gmail.com


On Mon, Apr 4, 2016 at 9:23 AM, frank brewer <frankth...@gmail.com> wrote:
Also now I checked whether uio_pruss is loaded:

root@beaglebone:~# lsmod
Module                  Size  Used by
c_can_platform          
6564  0
c_can                  
9605  1 c_can_platform
can_dev                
11455  1 c_can
spidev                  
6739  0
tieqep                  
8510  0
pwm_tiehrpwm            
4546  0
pwm_tiecap              
3492  0
8021q                  17344  0
garp                    
5975  1 8021q
mrp                    
7322  1 8021q
stp                    
1911  1 garp
llc                    
5257  2 stp,garp
pru_rproc              
11099  0
usb_f_acm              
7180  1
u_serial              
10646  3 usb_f_acm
usb_f_rndis            
22734  1
g_multi                
5316  0
usb_f_mass_storage    
42745  2 g_multi
u_ether                
12028  2 usb_f_rndis,g_multi
libcomposite          
43810  4 usb_f_acm,usb_f_rndis,g_multi,usb_f_mass_storage
pruss                  
14686  1 pru_rproc
omap_rng                
4358  0
rng_core                
7441  1 omap_rng
snd_soc_davinci_mcasp    
17352  0
snd_soc_edma            
1150  1 snd_soc_davinci_mcasp
spi_omap2_mcspi        
10681  0
uio_pdrv_genirq        
3521  0
uio                    
8467  1 uio_pdrv_genirq
cfg80211              
399381  0
rfkill                
17701  2 cfg80211

Seems like it is not. I have pruss and pru_rproc but not uio_pruss. Can that be the problem?

I tried loading it:

root@beaglebone:~# modprobe uio_pruss
modprobe
: FATAL: Module uio_pruss not found.


However I could not. Any ideas?

This is documented through out this forum..

In another thread you mentioned you were running:

4.1.18-ti-rt-r56

This "v4.1.x-ti" which uses remoteproc_pruss..

If you want uio_pruss, you need to use "4.1.x-bone" or "4.4.x-bone"..

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

Regards,


--
Robert Nelson
https://rcn-ee.com/

Xsentius

unread,
Apr 4, 2016, 10:42:40 AM4/4/16
to BeagleBoard, frankth...@gmail.com
So do you think that's why I cannot change pin mode settings? 

Kind Regards

Robert Nelson

unread,
Apr 4, 2016, 10:45:33 AM4/4/16
to Beagle Board, frankth...@gmail.com
On Mon, Apr 4, 2016 at 9:42 AM, Xsentius <satanas...@gmail.com> wrote:
So do you think that's why I cannot change pin mode settings? 

You are also assuming "sudo cat $PINS" works on 4.1.x... it doesn't currently show updates from loading overlays..

Regards,

Xsentius

unread,
Apr 4, 2016, 10:51:20 AM4/4/16
to BeagleBoard, frankth...@gmail.com
Oh, that is a very precious information, I really appreciate it. 

So is there a way to see updates? Do you recommend me to go back to 3.8, if it is stable?

Robert Nelson

unread,
Apr 4, 2016, 10:55:45 AM4/4/16
to Beagle Board, frank brewer

On Mon, Apr 4, 2016 at 9:51 AM, Xsentius <satanas...@gmail.com> wrote:
Oh, that is a very precious information, I really appreciate it. 

So is there a way to see updates? Do you recommend me to go back to 3.8, if it is stable?

Correctly set them in the overlay and don't worry about it..

Xsentius

unread,
Apr 4, 2016, 12:45:38 PM4/4/16
to BeagleBoard, frankth...@gmail.com
I am very grateful Robert, it worked. I can change pin modes easily, time to test some PRU codes. Thank you so much!
Message has been deleted

engka...@gmail.com

unread,
Jun 23, 2016, 7:03:45 AM6/23/16
to BeagleBoard, frankth...@gmail.com
Hi, I have the same problem with the same device tree overlay.
The setting of the PRU works when I put added the PRU pin mux in the am335x-boneblack-emmc-overlay.dts but not when I insert it to slots.

Here is my device tree that I add to the am335x-boneblack-emmc-overlay.dts.

/*
 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

&am33xx_pinmux {
    gpio_pins: gpio_pins {         // The GPIO pins
             pinctrl-single,pins = <
                0x070 0x07   // P9_11 MODE7 GPIO output pull‐down
                0x074 0x27   // P9_13 MODE7 GPIO input pull‐down
             >;
          };
 
 
 pru_cape_bone_pins: pru_cape_bone_pins {
  pinctrl-single,pins = <
   0x1a4 0x05   // P9_27 pr1_pru0_pru_r30_5, Mode5 output pull‐down
            0x19c 0x26   // P9_28 pr1_pru0_pru_r31_3, Mode6 input pull‐down
  >;
 };
};



&ocp {

   helper {
             compatible = "gpio-of-helper";
             status = "okay";
             pinctrl-names = "default";
             pinctrl-0 = <&gpio_pins>;
          };
   
};

&pruss {
        pinctrl-names = "default";
     pinctrl-0 = <&pru_cape_bone_pins>;
};

I'm not sure what is happening. But I am using kernel 4.4.9-ti-rt-r26.My my PRU code loaded to the pru is just blinking LEDs from GPIO P9_11  and pr1_pru0_pru_r30_5. However, only the P9_11 blinks. When I "sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins", the pins corresponding to the PRU pins are not changed. Why do you think this happens?


Thanks


Kister
Reply all
Reply to author
Forward
0 new messages