AnsweredAssumed Answered

[i.MX8] No high/low change in GPIO pins

Question asked by Kevin Chen on Nov 2, 2018
Latest reply on Nov 6, 2018 by igorpadykov

Hi Sir,

I have a problem about GPIO setting on i.MX8 EVK. The problem is all GPIO pins do not have high/low change after I exported them.

For example:

echo 489 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio489/direction
echo 1 > /sys/class/gpio/gpio489/value

root@imx8qxpmek:~# cat /sys/kernel/debug/gpio

......

gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-489 ( |sysfs ) out hi

 

echo 0 > /sys/class/gpio/gpio489/value

root@imx8qxpmek:~# cat /sys/kernel/debug/gpio

......

gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-489 ( |sysfs ) out lo

 

The scope does not measure high/low output change after above steps. Have anyone know why? Below is my pinmux setting in dts file.

pinctrl_testb: testgrp{
fsl,pins = <
SC_P_ESAI0_FST_LSIO_GPIO0_IO01 0xE0000021 // IMX_GNSS_TXREADY (in)
SC_P_ESAI0_SCKR_LSIO_GPIO0_IO02 0xE0000021 // VBAT_FAIL_N (in)
SC_P_ESAI0_SCKT_LSIO_GPIO0_IO03 0xE0000021 // M_SLEEP (in)
SC_P_ESAI0_TX0_LSIO_GPIO0_IO04 0xE0000021 // BT_EN (out)
SC_P_ESAI0_TX1_LSIO_GPIO0_IO05 0xE0000021 // WLAN_EN (out)
SC_P_ESAI0_TX2_RX3_LSIO_GPIO0_IO06 0xE0000021 // M_SHUTDOWN (out)
SC_P_ESAI0_TX3_RX2_LSIO_GPIO0_IO07 0xE0000021 // WLAN_SLP_CLK (out)
SC_P_ESAI0_TX4_RX1_LSIO_GPIO0_IO08 0xE0000021 // USB_HUB_RST_N (out)
SC_P_ESAI0_TX5_RX0_LSIO_GPIO0_IO09 0xE0000021 // M_RUN (out)
SC_P_SPDIF0_RX_LSIO_GPIO0_IO10 0xE0000021 // MODE1 (in)
SC_P_SPDIF0_TX_LSIO_GPIO0_IO11 0xE0000021 // MODE2 (in)
SC_P_SPDIF0_EXT_CLK_LSIO_GPIO0_IO12 0xE0000021 // IMX_GNSS_RESET (out)
>;
};

pinctrl_gpio1: gpio1grp{
fsl,pins = <
SC_P_ADC_IN5_LSIO_GPIO1_IO13 0xE0000021 // HDMI_INT (in)
SC_P_ADC_IN4_LSIO_GPIO1_IO14 0xE0000021 // M_WAKEUP_1V8 (in)
>;
};

pinctrl_gpio4: gpio4grp{
fsl,pins = <
SC_P_USDHC1_VSELECT_LSIO_GPIO4_IO20 0xE0000021 // SD1_VSELECT (out)
SC_P_USDHC1_WP_LSIO_GPIO4_IO21 0xE0000021 // GNSS_1PPS (in)
>;
};

.....

&gpio0 {
pinctrl-name = "default";
pinctrl-0 = <&pinctrl_testb>;
// pinctrl-0 = <&pinctrl_gpio0>;
status = "okay";
};

&gpio1 {
pinctrl-name = "default";
pinctrl-0 = <&pinctrl_gpio1>;
status = "okay";
};

&gpio4{
pinctrl-name = "default";
pinctrl-0 = <&pinctrl_gpio4>;
status = "okay";
};
// End of added by Kevin 20181008 -- for H7.1E GPIO group

&gpio5 {
pinctrl-names = "default";
// pinctrl-0 = <&pinctrl_testb>;
pinctrl-0 = <&pinctrl_gpio5>;
status = "okay";
};

 

Best regards

Kevin

Outcomes