No announcement yet.

Problem using configuring GPIO input pins when using 7 inch LCD touch screen

  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem using configuring GPIO input pins when using 7 inch LCD touch screen

    I am on the recommended distribution which is "bone-debian-8.10-lxqt-4gb-armhf-2018-01-01-4gb.img.xz". While the LCD works fine, I am unable to configure pins as inputs using Adafruit's BBIO library when the LCD cape is attached. Oddly, I can configure the same pin as an output and it will work fine. Without the LCD attached, I can configure pins as inputs and outputs with no problem. Here is my simple code

    import Adafruit_BBIO.GPIO as GPIO
    GPIO.setup("P8_14", GPIO.IN)
    And it gives me this error

    File "", line 2, in <module>
    GPIO.setup("P8_8", GPIO.IN)
    ValueError: Set gpio mode failed, missing file or invalid permissions.
    I have tried running in sudo and it gives me the same error

    I havent modified anything in the /boot/uEnv.txt file and I suspect I should be changing something there.
    Last edited by boing; 26 January 2018, 02:59 PM.

  • #2
    Hi boing,

    Welcome to the forums.

    Luckily, I have a similar project that uses the same GPIO pin as an output pin, it works well as an output pin then I recreated your scenario here on my end and had the same issue.

    But something is amiss on your post, say there, GPIO.setup("P8.8, GPIO.IN") gives you the problem not the GPIO.setup("P8.14, GPIO.IN"). You probably pasted a wrong error. Mine is saying the GPIO.setup("P8.14, GPIO.IN") when I changed it to input in the GPIO.setup

    I researched everything I can find about this issue, I am not a BBB/Linux expert myself and struggled a lot in finding a solution. I assume that the problem lies on the pin multiplexing of the 4DCAPE. We could assume that the pins are no longer available due to pin multiplexing even they are not really used by the 4DCAPE, Although I have to research more on that assumption.

    I opened up the Github page of the Adafruit BBIO and used the pin-config command they have for the library. I keep on check the status of the pin P8_14 and it keeps on giving me:
    P8_14 pinmux file not found!
    Cannot read pinmux file: /sys/devices/platform/ocp/ocp*P8_14_pinmux/state

    So I checked out the folder sys/devices/platform/ocp/. I found only two pinmux file available:
    drwxrwxr-x 3 root gpio 0 Jan 1 2000 ocp:P9_19_pinmux
    drwxrwxr-x 3 root gpio 0 Jan 1 2000 ocp:P9_20_pinmux

    Then I used the P9_20 instead of P8_14 and it went through. But I havent tested it throughly yet since my project are all output, I have to write a new program and wire this out.
    Can you try this for me first? I'll test it out as soon as possible.


    • #3
      I've used P9_20, and you are correct, the program runs. Sadly I have to use more pins so I hope there is a solution.


      • #4
        Hi boing,

        You may be able to free some GPIO if you recompile the kernel. Recompiling the image means you have to change the pin mux for the 4D LCD Cape
        Unfortunately we can no longer assist you in this suggestion as this is more of a Linux/Debian/BBB expertise.