BBAI: Assistance requested with configuring P9_15 as an output gpio

Hi,

I’ve been trying to configure a header gpio pin such as P9_15 as an output port on the BBAI but I am having no luck. This pin is used with the Cloud9 Python and JS examples but it is not working so I have tried to enable it manually.

I’ve added the following in the am5729-beagleboneai.dts file and run make and make install and a reboot:

`
cape_pins: cape_pins {
compatible = “gpio-leds”;
pinctrl-names = “default”;
gpios = <&gpio3 12 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&cape_pins_default>;
};

`

`
DRA7XX_CORE_IOPAD(0x3514, PIN_OUTPUT | MUX_MODE14) /* AG4: P9.15: vin1a_d8.gpio3_12 - MDIR2A */

`

The config-pins tools shows

`
debian@beaglebone:~$ sudo config-pin -q p9.15
[sudo] password for debian:
P9_15 pinmux file not found!
Pin has no cape: P9_15

`

The show-pins tools shows:

`
debian@beaglebone:~$ sudo /opt/scripts/device/bone/show-pins.pl
Can’t locate Inline/Files.pm in @INC (you may need to install the Inline::Files module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/arm-linux-gnueabihf/perl5/5.24 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabihf/perl-base) at /opt/scripts/device/bone/show-pins.pl line 11.
BEGIN failed–compilation aborted at /opt/scripts/device/bone/show-pins.pl line 11.

`

This is the output of version.sh:

debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh git:/opt/scripts/:[b4e40ed94bc1e15bb291d10af48e0e9893864197] model:[BeagleBoard.org_BeagleBone_AI] dogtag:[BeagleBoard.org Debian Image 2019-08-03] UBOOT: Booted Device-Tree:[am5729-beagleboneai.dts] kernel:[4.19.73-ti-r29] nodejs:[v6.17.0] /boot/uEnv.txt Settings: pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>] pkg:[bb-cape-overlays]:[4.4.20191017.0-0rcnee0~stretch+20191017] pkg:[bb-wl18xx-firmware]:[1.20190227.1-0rcnee0~stretch+20190227] pkg:[kmod]:[23-2rcnee1~stretch+20171005] pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0~stretch+20190327] pkg:[firmware-ti-connectivity]:[20180825+dfsg-1rcnee1~stretch+20181217] groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev gpio pwm eqep remoteproc admin spi tisdk weston-launch xenomai cloud9ide] cmdline:[console=ttyS0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.default_quality=80 quiet video=HDMI-A-1:1920x1080@60e] dmesg | grep remote [ 1.209487] remoteproc remoteproc0: 4b234000.pru is available [ 1.209792] remoteproc remoteproc1: 4b238000.pru is available [ 1.210130] remoteproc remoteproc2: 4b2b4000.pru is available [ 1.210420] remoteproc remoteproc3: 4b2b8000.pru is available [ 1.580068] remoteproc remoteproc4: 58820000.ipu is available [ 1.580495] remoteproc remoteproc5: 55020000.ipu is available [ 1.580963] remoteproc remoteproc6: 40800000.dsp is available [ 1.581450] remoteproc remoteproc7: 41000000.dsp is available [ 1.582238] remoteproc remoteproc4: Direct firmware load for dra7-ipu1-fw.xem4 failed with error -2 [ 1.582247] remoteproc remoteproc4: powering up 58820000.ipu [ 1.582322] remoteproc remoteproc4: Direct firmware load for dra7-ipu1-fw.xem4 failed with error -2 [ 1.582330] remoteproc remoteproc4: request_firmware failed: -2 [ 1.588375] remoteproc remoteproc5: Direct firmware load for dra7-ipu2-fw.xem4 failed with error -2 [ 1.588383] remoteproc remoteproc5: powering up 55020000.ipu [ 1.588455] remoteproc remoteproc5: Direct firmware load for dra7-ipu2-fw.xem4 failed with error -2 [ 1.588463] remoteproc remoteproc5: request_firmware failed: -2 [ 1.594532] remoteproc remoteproc6: Direct firmware load for dra7-dsp1-fw.xe66 failed with error -2 [ 1.594542] remoteproc remoteproc6: powering up 40800000.dsp [ 1.594630] remoteproc remoteproc6: Direct firmware load for dra7-dsp1-fw.xe66 failed with error -2 [ 1.594639] remoteproc remoteproc6: request_firmware failed: -2 [ 1.600688] remoteproc remoteproc7: Direct firmware load for dra7-dsp2-fw.xe66 failed with error -2 [ 1.600697] remoteproc remoteproc7: powering up 41000000.dsp [ 1.600770] remoteproc remoteproc7: Direct firmware load for dra7-dsp2-fw.xe66 failed with error -2 [ 1.600777] remoteproc remoteproc7: request_firmware failed: -2 dmesg | grep pru [ 1.209487] remoteproc remoteproc0: 4b234000.pru is available [ 1.209560] pru-rproc 4b234000.pru: PRU rproc node pru@4b234000 probed successfully [ 1.209792] remoteproc remoteproc1: 4b238000.pru is available [ 1.209874] pru-rproc 4b238000.pru: PRU rproc node pru@4b238000 probed successfully [ 1.210130] remoteproc remoteproc2: 4b2b4000.pru is available [ 1.210200] pru-rproc 4b2b4000.pru: PRU rproc node pru@4b2b4000 probed successfully [ 1.210420] remoteproc remoteproc3: 4b2b8000.pru is available [ 1.210487] pru-rproc 4b2b8000.pru: PRU rproc node pru@4b2b8000 probed successfully dmesg | grep pinctrl-single [ 0.967269] pinctrl-single 4a003400.pinmux: 282 pins, size 1128 dmesg | grep gpio-of-helper lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 046d:082d Logitech, Inc. HD Pro Webcam C920 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub END

Any assistance would be greatly appreciated
.

Cheers,

Jon

Hi,

I've been trying to configure a header gpio pin such as P9_15 as an output port on the BBAI but I am having no luck. This pin is used with the Cloud9 Python and JS examples but it is not working so I have tried to enable it manually.

I've added the following in the am5729-beagleboneai.dts file and run make and make install and a reboot:

        cape_pins: cape_pins {
                compatible = "gpio-leds";
                pinctrl-names = "default";
                gpios = <&gpio3 12 GPIO_ACTIVE_HIGH>;
                pinctrl-0 = <&cape_pins_default>;
        };

DRA7XX_CORE_IOPAD(0x3514, PIN_OUTPUT | MUX_MODE14) /* AG4: P9.15: vin1a_d8.gpio3_12 - MDIR2A */

^ looks correct..

The config-pins tools shows

debian@beaglebone:~$ sudo config-pin -q p9.15
[sudo] password for debian:
P9_15 pinmux file not found!
Pin has no cape: P9_15

Don't use config-pin the bbai..

The show-pins tools shows:

debian@beaglebone:~$ sudo /opt/scripts/device/bone/show-pins.pl
Can't locate Inline/Files.pm in @INC (you may need to install the Inline::Files module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/arm-linux-gnueabihf/perl5/5.24 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabihf/perl-base) at /opt/scripts/device/bone/show-pins.pl line 11.
BEGIN failed--compilation aborted at /opt/scripts/device/bone/show-pins.pl line 11.

sudo apt install libinline-files-perl

Regards,

Oh, duh! I should have caught that missing lib.
Okay, so the output of show-pins shows P.15 but it neither shows as up or down. Is this correct?

debian@beaglebone:~$ sudo /opt/scripts/device/bone/show-pins.pl | grep "P9.15"
P9.15 69 AG4 e fast gpio3_12

Also, is the ‘69’ value the gpio number that is used to enable this?
Such as :

debian@beaglebone:~$ sudo echo 69 > /sys/class/gpio/export
debian@beaglebone:~$ sudo echo out > /sys/class/gpio/gpio69/direction
debian@beaglebone:~$ sudo echo 1 > /sys/class/gpio/gpio69/value

Since this is gpio3_12 I was thinking it was ‘108’ considering the 32x3+12 calculation as with the BB Black.
Neither 69 or 108 seems to work though.

Also, are the failed messages from the version output something to be concerned about?

[ 1.582238] remoteproc remoteproc4: Direct firmware load for dra7-ipu1-fw.xem4 failed with error -2
[ 1.582247] remoteproc remoteproc4: powering up 58820000.ipu
[ 1.582322] remoteproc remoteproc4: Direct firmware load for dra7-ipu1-fw.xem4 failed with error -2
[ 1.582330] remoteproc remoteproc4: request_firmware failed: -2
[ 1.588375] remoteproc remoteproc5: Direct firmware load for dra7-ipu2-fw.xem4 failed with error -2
[ 1.588383] remoteproc remoteproc5: powering up 55020000.ipu
[ 1.588455] remoteproc remoteproc5: Direct firmware load for dra7-ipu2-fw.xem4 failed with error -2
[ 1.588463] remoteproc remoteproc5: request_firmware failed: -2
[ 1.594532] remoteproc remoteproc6: Direct firmware load for dra7-dsp1-fw.xe66 failed with error -2
[ 1.594542] remoteproc remoteproc6: powering up 40800000.dsp
[ 1.594630] remoteproc remoteproc6: Direct firmware load for dra7-dsp1-fw.xe66 failed with error -2
[ 1.594639] remoteproc remoteproc6: request_firmware failed: -2
[ 1.600688] remoteproc remoteproc7: Direct firmware load for dra7-dsp2-fw.xe66 failed with error -2
[ 1.600697] remoteproc remoteproc7: powering up 41000000.dsp
[ 1.600770] remoteproc remoteproc7: Direct firmware load for dra7-dsp2-fw.xe66 failed with error -2
[ 1.600777] remoteproc remoteproc7: request_firmware failed: -2
dmesg | grep pru

Thanks,

Jon

Oh, duh! I should have caught that missing lib.
Okay, so the output of show-pins shows P.15 but it neither shows as up or down. Is this correct?

debian@beaglebone:~$ sudo /opt/scripts/device/bone/show-pins.pl | grep "P9.15"
P9.15 69 AG4 e fast gpio3_12

Also, is the ‘69’ value the gpio number that is used to enable this?
Such as :

debian@beaglebone:~$ sudo echo 69 > /sys/class/gpio/export
debian@beaglebone:~$ sudo echo out > /sys/class/gpio/gpio69/direction
debian@beaglebone:~$ sudo echo 1 > /sys/class/gpio/gpio69/value

Since this is gpio3_12 I was thinking it was ‘108’ considering the 32x3+12 calculation as with the BB Black.
Neither 69 or 108 seems to work though.

There’s no gpio0 on AM57x, so it is 2*32 +12 = 76.

Huzzah! Using 76 did the trick. There is now light on P9.15
I guess I missed that the AM57x did not have a gpio0.

Thanks a bunch.

Jon

Okay, so based on a discussion on element14 and out of my own curiosity, I am attempting to set a header pin to PWM but I am not having much luck.
Looking again at the am5729-beagleboneai-roboticscape.dts as an example, I set P8_23 (gpio22) as follows:

DRA7XX_CORE_IOPAD(0x3794, PIN_OUTPUT | MUX_MODE10) /* AC8: P8.23: mmc3_dat4.ehrpwm3A - PWM3A */

And then rebuild the .dtb

cd /opt/source/dtb-4.19-ti/
make src/arm/am5729-beagleboneai.dtb
sudo make install
sudo reboot

If I run the analogInOut.js Cloud9 example, the LED does not turn on. I have to set the pin back to GPIO Mode14 for it to work.

Nothing seems to get populated in ‘/sys/class/pwm’ so I suspect I am missing something.

Is there an easier way to set this?

Cheers,

Jon