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.

AM625: GPIO has no control over input and output

Part Number: AM625

Tool/software:

Problem description:

     There are problems when trying to test GPIO N20, M21 and V25.

     GPIO set output mode, set 0/1, the measurement found that the level does not change;

     GPIO set to input mode, external intervention high/low level, read value will not change.

My Operating:

 My dts :

  • Hello,

    In the device, you'll need a reference node. See this thread for an example:  https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1268671/sk-am62-using-the-gpios-in-the-40-pin-user-expansion-port/4804378

    Or see something like this:

    diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    index b1980b85c..6a34c9eeb 100644
    --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    @@ -186,6 +186,20 @@ AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14/E11) UART0_TXD */
     		>;
     	};
     
    +	main_gpio0_pins_default: main-gpio0-default-pins {
    +		pinctrl-single,pins = <
    +			AM62X_IOPAD(0x009c, PIN_INPUT, 7) /* (V25) GPMC0_WAIT1.GPIO0_38 */
    +			AM62X_IOPAD(0x00ac, PIN_INPUT, 7) /* (L21) GPMC0_CSn1.GPIO0_42 */
    +		>;
    +	};
    +
    +	main_gpio1_pins_default: main-gpio1-default-pins {
    +		pinctrl-single,pins = <
    +			AM62X_IOPAD(0x01b4, PIN_INPUT, 7) /* (A13) SPI0_CS0.GPIO1_15 */
    +			AM62X_IOPAD(0x01d0, PIN_INPUT, 7) /* (A15) UART0_CTSn.GPIO1_22 */
    +		>;
    +	};
    +
     	main_i2c0_pins_default: main-i2c0-pins-default {
     		pinctrl-single,pins = <
     			AM62X_IOPAD(0x1e0, PIN_INPUT_PULLUP, 0) /* (B16/E12) I2C0_SCL */
    @@ -329,6 +343,29 @@ AM62X_IOPAD(0x0078, PIN_OUTPUT, 1) /* (U24) GPMC0_AD15.VOUT0_DATA23 */
     	};
     };
     
    +&mcu_pmx0 {
    +	mcugpio0_pins_default: mcugpio0-default-pins {
    +		pinctrl-single,pins = <
    +			AM62X_MCU_IOPAD(0x003c, PIN_INPUT, 7) /* (E5) MCU_MCAN1_TX.MCU_GPIO0_15 */
    +			AM62X_MCU_IOPAD(0x0040, PIN_INPUT, 7) /* (D4) MCU_MCAN1_RX.MCU_GPIO0_16 */
    +		>;
    +	};
    +};
    +
    +&main_gpio0 {
    +	status = "okay";
    +	pinctrl-names = "default";
    +	pinctrl-0 = <&main_gpio0_pins_default>;
    +
    +};
    +
    +&main_gpio1 {
    +	status = "okay";
    +	pinctrl-names = "default";
    +	pinctrl-0 = <&main_gpio1_pins_default>;
    +
    +};
    +
     &wkup_uart0 {
     	/* WKUP UART0 is used by DM firmware */
     	status = "reserved";
    @@ -578,11 +615,13 @@ dpi1_out: endpoint {
     	};
     };
     
    -/* mcu_gpio0 and mcu_gpio_intr are reserved for mcu firmware usage */
    +/* mcu_gpio0 and mcu_gpio_intr are reserved for mcu firmware usage  */
     &mcu_gpio0 {
    -	status = "reserved";
    +	status = "okay";
    +	pinctrl-names = "default";
    +	pinctrl-0 = <&mcugpio0_pins_default>;
     };
     
     &mcu_gpio_intr {
    -	status = "reserved";
    +	status = "okay";
     };
    

    Best Regards,

    Anshu

  • Hi 

      Thank you very much for your reply

      I think it is not the problem of the device tree. The way of enumeration of the device tree is the same as that of my operation in the led node now. It should be my wrong calculation of the pin number.For example, I want to pull up m21 pin, the implementation of the echo 0 > / sys/class/gpio/gpio440 gpio440 / value but this may not be m21 pin, so I want to know how the gpio number calculation

    • It is true that my pin number was miscalculated, and now the problem has been solved