Trouble using config-pin to config P9.28 pin as spi or gpio

Hi,

I’m trying to use cdsteinkuehler’s beaglebone-universal-io to config P9_28-31 as spi interface. After loading cape-universal overlay first, I got the “P9_28 pinmux file not found!” message when I configure P9_28 pin

You'll need to load cape-universala for P9.28 to be available.

Here is my /boot/uEnv.txt:

cape_enable=bone_capemgr.enable_partno=cape-universala
cmdline=coherent_pool=1M quiet cape_universal=enable
dtb=am335x-boneblack-overlay.dtb
uname_r=4.4.41-ti-r83

I am able to set P9.28 to spi:

root@beaglebone:~# config-pin -l P9.28 spi
default gpio gpio_pu gpio_pd pwm spi pwm2 pruout pruin
root@beaglebone:~# config-pin P9.28 spi
root@beaglebone:~# config-pin -q P9.28
P9_28 Mode: spi

-Drew

Thanks, Drew

I’m able to set P9.28 after follow your uEnv.txt content.
But my screen also not working by loading cape-universala (of course it exported all pins),

My idea is cape-universal says it exports all pins not used by HDMIN and eMMC (including audio),
so I should be able to set P9.28 as SPI by loading cape-universal only, but I can’t.

And I found that cape-universal dts files are different between Robert’s and cdsteinkuehler’s, I would like to know do i need to modify dts file by myself?

-Lindo

Drew Fustini於 2017年1月25日星期三 UTC+8下午3時19分41秒寫道:

Charles / Robert:
Should P9.28 be SPI by default?

thanks,
drew

All pins are GPIO by default, with pull up/down set to match the reset
defaults of the processor. To use P9.28 as SPI, in addition to
loading cape-universal, it is necessary to run:

  config-pin P9.28 spi

If this does not result in the pinmux being set to spi, it's a bug.

Hi all,

I have to bring this thread to life again, as I’m facing the same issue:

all I want to do is to assign p9_29 as “spi_cs” on my BBB running “4.9.78-ti-r94”.

Running “config-pin -l p9_28” leads to “default gpio gpio_pu gpio_pd gpio_input spi_cs pwm pruout pruin”. So all looks good, as this pin can be used in spi_cs mode.

Now I want to configure the pin to actually work as spi pin:

config-pin p9_28 spi_cs
P9_28 pinmux file not found!
sudo: no askpass program specified, try setting SUDO_ASKPASS
Cannot write pinmux file: /sys/devices/platform/ocp/ocp*P9_28_pinmux/state

The same error is printed when running “config-pin p9_29 spi” or “config-pin p9_31 spi_sclk”. However, command “config-pin p9_30 spi” works well.

Would really appreciate if someone can help out here!

Best regards,
Marco

Did you add the BB-SPIDEV1-00A0.dtbo to the device tree boot list in uEnv.txt?
Chad

Did you add the BB-SPIDEV1-00A0.dtbo to the device tree boot list in uEnv.txt?

Should that be necessary if one is using CAPE-UNIVERSAL?

It is a workaround for a bug, I believe. When I enable the dtbo, I get the following directory constructed during the boot process
/sys/devices/platform/ocp/ocp:P9_28_pinmux
Without the dtbo, this directory is missing.
Chad

Hi all,

thanks for your responses. I will check once back in office and come back to you with results.

@cmbaker3/Chad: would it be possibe to share your uEnv.txt file with me (with the dtbo enabled)? Just do be sure that I do the right thing here…

Would be great and thank you so much!!!

Best,
Marco

It is a workaround for a bug, I believe. When I enable the dtbo, I get the following directory constructed during the boot process
/sys/devices/platform/ocp/ocp:P9_28_pinmux
Without the dtbo, this directory is missing.

Oh I see, thanks.

Hi guys,

I edited uEnv.txt according to the discussion. In particular I added these lines (I also copied my entire uEnv file in this post; see below):

uboot_overlay_addr0=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-SPIDEV1-00A0.dtbo

but doesn’t change anything; after reboot I still can’t use “config-pin p9_28 spi_cs” to enable SPI1.

My system: uname -a
Linux beaglebone 4.9.78-ti-r94

I also used “/opt/scripts/tools$ ./version.sh” to get more information (please find full log below) and found some interesting lines:

dmesg | grep pinctrl-single
[ 1.404852] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 1.648918] pinctrl-single 44e10800.pinmux: pin PIN103 already requested by 481a0000.spi; cannot claim for 48038000.mcasp
[ 1.660206] pinctrl-single 44e10800.pinmux: pin-103 (48038000.mcasp) status -22
[ 1.667697] pinctrl-single 44e10800.pinmux: could not request pin 103 (PIN103) from group mcasp0_pins on device pinctrl-single

→ Pin103 is P9_28.

Any hints what I could try next?

Would really appreciate your help and thank you all in advance!

Best regards,
Marco

MY UENV FILE

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.9.78-ti-r94
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1

My /boot/uEnv.txt differs, I do not use the uboot_overlay_addr lines, they are commented out.
I have a few more lines following the command=coherent …
The last lines in my file are

cmdline=coherent_pool=1M net.ifnames=0 quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 quiet video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
cape_enable=bone_capemgr.enable_partno=/lib/firmware/BB-SPIDEV1-00A0.dtbo

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

You might have the cape_enable line as

cape_enable=bone_capemgr.enable_partno=/lib/firmware/BB-SPIDEV0-00A0.dtbo,/lib/firmware/BB-SPIDEV1-00A0.dtbo

Hope this helps,
Chad

Hello,

I too have run into the issue of not being able to set P9.28 as well using the latest pre-built image from

https://rcn-ee.com/rootfs/bb.org/testing/2018-12-10/stretch-machinekit/bone-debian-9.6-machinekit-armhf-2018-12-10-4gb.img.xz

To fix the issue, simply disable the uboot audio overlay in /boot/uEnv.txt by uncommenting the line

disable_uboot_overlay_audio=1

And reboot the BBB

You can now set P9.28 as needed.

Best regards,
Scott

It works! Thanks for your help!

Hi
you should change configuration of pins from HDMI to SPI
type this command in terminal: sudo nano /boot/uEnv.txt
then you should remove # of disable-uboot-overlay-video=1
then you can use from SPI pins

Hi,
I’m trying to fix an error in my beaglebone green in which several PRU pin directories are not available. I’m using image 4.19.50-ti-r20. I’m using, Debian 10.2 which I have experienced as working well with the BBB and BBG. The pins directories that don’t show up are a sub-set of the 35 or so real time PRU I/O pins. These pins are supposed to be available are subdirectories of /sys/devices/platform/ocp/, as follows:
ocp:P8_11_pinmux

The ones (6 of them) with the asterisk are the real time PRU Input / Output pins that I really really need for my application.

Notes:
This is on the Beaglebone Green, not the Beaglebone Black, I’ll check if the same problem shows up on BBB as well a little later…
This is image 4.19
I have already gone into the /boot/uEnv.txt file and disabled the following: HDMI, audio, emmc. But I still have this same problem.

Is this a bug in the kernel / image ?

In reviewing page 211 of Derek Molloy’s Exploring Beaglebone book, I can’t see a pattern of all these pins belonging to a certain interface, so I cannot even guess what interface might be causing them to become not available.

Please let me know if you have any ideas on this.
Thanks!!

This smells like a mis-configuration, please run:

sudo /opt/scripts/tools/version.sh

and share it's output so we can help debug..

Regards,

This looks like it’s being detected as a BBG Wireless and not a regular BBG. None of those pins are available on the BBGW.

Dan

LOL i had this issue on a bunch of boards i bought.

They misprogrammed the eeprom. you will need to write the correct info into
the eeprom. When i notified the company that made the boards they did not give a shit.