Cannot access pin 26 only with MRAA

I have installed up kernel and resolve permission issue but I still can't access pin 26. Every time I invoke mraa-gpio get 26 in terminal it returns Could not initialize gpio 26. Every other pin I tried is working fine. My Up board is new and I never mess around with pin 26. Can somebody confirm this on their Up board?

Comments

  • AchmadFathoni
    AchmadFathoni New Member Posts: 5

    From cat /sys/kernel/debug/gpio I get:

    gpio-7 ( |cs ) out hi

    Which mean pin 26 or gpio-7 is used by process cs. Does that mean I can't use pin 26 for input/output? Or I can just kill process cs.

  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin

    As you can see from our wiki: https://wiki.up-community.org/Pinout

    the pin 26 is SPI_CS1 feature by default.

    You would need first to export the PIN as GPIO (pin26 is Linux GPIO 7): https://wiki.up-community.org/Pinout#GPIO

  • AchmadFathoni
    AchmadFathoni New Member Posts: 5
    edited May 2020

    @DCleri said:
    You would need first to export the PIN as GPIO (pin26 is Linux GPIO 7): https://wiki.up-community.org/Pinout#GPIO

    I tried that but since is being used by cs driver module the command sudo echo 7 > /sys/class/gpio/export return echo: write error: Device or resource busy. I don't know cs driver module came from and I can't kill it. I do all this in fresh reboot.

  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin

    Hi @AchmadFathoni

    it seems to be stuck with the SPI chip select function.

    We have just verified and we are able to replicate the issue on both 4.15 and the newer 5.0 kernel.
    The issue only happens on UP Board (not on UP Squared or UP Xtreme) which is using a legacy pinctrl driver.

    We would need some time to debug internally, but we will keep you posted.

Privacy Policy