This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDS64EVM: GPIO pins as output

Part Number: TMDS64EVM

Tool/software:

Hello,


I'm trying to define a GPIO as an output.

I have added the following to my device tree file:

    under &main_pmx0:

mygpio1_pins_default: mygpio1-default-pins {
        pinctrl-single,pins = <
            AM64X_IOPAD(0x0150, PIN_OUTPUT, 7) /* (Y13) PRG1_PRU1_GPO18.GPIO0_20 */
        >;
    };

Theses lines define my GPIO0_20 pin. Is that correct?

    at the end of file:

&main_gpio0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&mygpio1_pins_default>;
    gpio-line-names = "", "", "", "", "", "", "", "", "", "", /* 10 */
              "", "", "", "", "", "", "", "", "", "GPIO0_20"; /* 20 */
};

main_gpio0 (gpio@600000) is defined as gpiochip3:


root@am64xx-evm:~# cat /sys/kernel/debug/gpio
[...]
gpiochip3: GPIOs 546-632, parent: platform/600000.gpio, 600000.gpio:
 gpio-558 (                    |regulator-5         ) out lo
 gpio-565 (GPIO0_20            )

gpiochip4: GPIOs 633-720, parent: platform/601000.gpio, 601000.gpio:

Under the evaluation board terminal, I use the gpioinfo command on /dev/gpiochip3:


root@am64xx-evm:~# gpioinfo -c 3
gpiochip3 - 87 lines:
        line   0:       unnamed                 input
        line   1:       unnamed                 input
        line   2:       unnamed                 input
        line   3:       unnamed                 input
        line   4:       unnamed                 input
        line   5:       unnamed                 input
        line   6:       unnamed                 input
        line   7:       unnamed                 input
        line   8:       unnamed                 input
        line   9:       unnamed                 input
        line  10:       unnamed                 input
        line  11:       unnamed                 input
        line  12:       unnamed                 output consumer=regulator-5
        line  13:       unnamed                 input
        line  14:       unnamed                 input
        line  15:       unnamed                 input
        line  16:       unnamed                 input
        line  17:       unnamed                 input
        line  18:       unnamed                 input
        line  19:       "GPIO0_20"              input
        line  20:       unnamed                 input
       [...]
        line  86:       unnamed                 input


Why is not "line 20" defined as an output?


Using gpioget:

root@am64xx-evm:~# gpioget -c 3 20
"20"=inactive

With a voltmeter, I get 0.6V on what is supposed to be the GPIO0_20. Is this because the pin is not well defined?


gpioset doesn't seem to work. Any inputs would be great!


Regards,

Julien

  • Hi Julien,

    As you've likely noticed, the gpio-line-names parameter is off by one to represent GPIO0_20.

    Why is not "line 20" defined as an output?

    The Pin Muxing only sets the pins' capability of transmitting. It does not set the GPIO state to output. Rather, it relies on the an application or userspace command to drive it to output.

    The default state of the register is input so before any commands are ran, the direction will remain input.

    With a voltmeter, I get 0.6V on what is supposed to be the GPIO0_20.

    When a pin is floating (or undefined), then it will be around ~.7V.

    gpioset doesn't seem to work. Any inputs would be great!

    Can you explain what this issue is? Can you try gpioset --unquoted -c 3 20=1?

  • Hi Anshu,

    As you've likely noticed, the gpio-line-names parameter is off by one to represent GPIO0_20.

    Indeed, thank you for noticing.

    Can you explain what this issue is? Can you try gpioset --unquoted -c 3 20=1?

    It works fine. I was surprise that the gpioset command kept running on the terminal; but I am able to manage the pin through gpioset.

    Thanks for the clarification.

    Julien