Toggling gpiochip2 20 as GPIO

Hi,

We would like to toggle gpiochip2/20 as a GPIO output pin on the Apalis imx8qm. We have a device tree file where we configure this pin as follows (short snippet):

&iomuxc {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_debug_leds>, <&pinctrl_front_io>;

apalis-imx8qm {        
    pinctrl_front_io: frontiogrp {
        fsl,pins = <
            IMX8QM_SPI3_CS0_LSIO_GPIO2_IO20       0x21    /* SODIMM 37   */
        >;
    };

};

I see that when using libgpiod method gpioset I can see that it is configured as an GPIO output which can be toggled. However on the hardware side of things I see no change on the physical voltage level on this pin.

I would kindly request some assistance. We have other GPIO inputs and outputs which are correctly configured and working but this one boggles me.

Kind regards,

Asterix.

Hi @Asterix ,

Thank you for using the community.

the pin you are trying to use is by default defined as a GPIO and it looks like you want to remove the WAKEUP functionality, which is fine.

Besides that did you try to disconnect the pin by removing the jumper at X3/24?
This jumper connects the WAKE1_MICO to MXM3_37.

Give this a try, if you haven’t already and let us know if it worked.

Best Regards
Kevin

Hi Kevin,

Thanks for the reply. Indeed I would like to remove the wakeup functionality and not use it as a wakeup source anymore.

However we have a custom PCB for the system so I have no jumper which should be disconnected. This pin is in our system is connected to an LED which we are trying to toggle.

Kind regards,

Asterix

Hi @Asterix,

thanks for confirming.

To better support you, would it be possible to share your schematics, regarding the pin. We will then have a look.

BR
Kevin

Hi Kevin,

Have to ask if I’m allowed to share, but the circuit is not difficult. The pin is driving a MOSFETT gate which switches the power to a LED. If I measure directly on the SODIMM 37 pin with a multimeter I see no voltage change regardless whether or not I switch the pin state.

We have an identical circuit for another LED, connected to SODIMM 2, which is working fine.

Therefore I don’t think the problem is in the electronics but more in the configuration of this specific pin.

Kind regards,

Asterix

Hi Kevin,

I was wondering if you could help us with overriding the wake up behaviour of the pin and change it to a GPIO, since I strongly believe that this is likely the issue.

Any assistance would be appreciated.

Kind regards,

Tom

Hello Asterix,

yes I can confirm that issue. We are investigation it.
can you sent your Device tree file please.

Best Regards,

Matthias

Hi Matthias,

Thanks for the reply. I’m a colleague of Asterix.
Here is our custom part of the device tree file that we’re using:

/dts-v1/;

#include "imx8qm-apalis-v1.1.dtsi"
#include "imx8-apalis-eval.dtsi" 

/ {
    model = "Toradex Apalis iMX8QM/QP on Custom Carrier Board (dts v0.20)";
    compatible = "toradex,apalis-imx8-v1.1-eval",
		     "toradex,apalis-imx8-eval",
		     "toradex,apalis-imx8",
		     "fsl,imx8qm";
             
    chosen {
        stdout-path = &lpuart1;
    };
    
    gpio-keys {
        compatible = "gpio-keys";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_rotary_encoder_button>;
        status = "okay";

        user-button {
            label = "Rotary encoder push button";
            gpios = <&lsio_gpio0 9 GPIO_ACTIVE_LOW>;
            linux,code = <KEY_ENTER>;
            debounce-interval = <10>;
            wakeup-source;
        };
    };
    
    rotary@0 {
        status = "okay";
        compatible = "rotary-encoder";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_rotary_encoder>;
        gpios = <&lsio_gpio0 12 GPIO_ACTIVE_LOW>, <&lsio_gpio0 13 GPIO_ACTIVE_LOW>; /* GPIO00.IO12 and GPIO00.IO13 */
        linux,axis = <0>; /* REL_X */
        rotary-encoder,encoding = "gray";
        rotary-encoder,relative-axis;
        rotary-encoder,steps-per-period = <1>;
    };
    
    lvds1_panel {
        compatible = "logictechno,lt161010-2nhc";
        backlight = <&backlight>;

        port {
            panel_lvds1_in: endpoint {
                remote-endpoint = <&lvds1_out>;
            };
        };
    };
};

&flexcan1 {
    disable-fd-mode;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_flexcan1>;
};

&flexcan2 {
    disable-fd-mode;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_flexcan2>;
};

&iomuxc {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_debug_leds>, <&pinctrl_front_io>;

    apalis-imx8qm {
        pinctrl_debug_leds: debugledsgrp {
            fsl,pins = <
                IMX8QM_FLEXCAN2_TX_LSIO_GPIO4_IO02    0x21    /* SODIMM 13 */
                IMX8QM_MLB_SIG_LSIO_GPIO3_IO26        0x21    /* SODIMM 15 */
            >;
        };
        
        pinctrl_front_io: frontiogrp {
            fsl,pins = <
                IMX8QM_M40_GPIO0_00_LSIO_GPIO0_IO08   0x21    /* SODIMM 1 */
                IMX8QM_FLEXCAN2_RX_LSIO_GPIO4_IO01    0x21    /* SODIMM 11 */
                IMX8QM_GPT1_COMPARE_LSIO_GPIO0_IO19   0x21    /* SODIMM 2 */
                IMX8QM_SPI3_CS0_LSIO_GPIO2_IO20       0x21    /* SODIMM 37 */
            >;
        };

        /delete-node/ pinctrl_gpio34;
        
        pinctrl_rotary_encoder_button: rotaryencoderbuttongrp {
            fsl,pins = <
                IMX8QM_M40_GPIO0_01_LSIO_GPIO0_IO09   0x21    /* SODIMM 3 */
            >;
        };
        
        pinctrl_rotary_encoder: rotaryencodergrp {
            fsl,pins = <
                IMX8QM_M41_GPIO0_00_LSIO_GPIO0_IO12   0x0b0b0 /* SODIMM 5 */
                IMX8QM_M41_GPIO0_01_LSIO_GPIO0_IO13   0x0b0b0 /* SODIMM 7 */
            >;
        };
        
        pinctrl_flexcan1: flexcan0grp {
            fsl,pins = <
                IMX8QM_FLEXCAN0_RX_DMA_FLEXCAN0_RX    0x21    /* SODIMM 12 */
                IMX8QM_FLEXCAN0_TX_DMA_FLEXCAN0_TX    0x21    /* SODIMM 14 */
            >;
        };
        
        pinctrl_flexcan2: flexcan1grp {
            fsl,pins = <
                IMX8QM_FLEXCAN1_RX_DMA_FLEXCAN1_RX    0x21    /* SODIMM 16 */
                IMX8QM_FLEXCAN1_TX_DMA_FLEXCAN1_TX    0x21    /* SODIMM 18 */
            >;
        };
    };
};

&ldb2_phy {
	status = "okay";
};

&ldb2 {
	status = "okay";

	lvds-channel@0 {
		fsl,data-mapping = "spwg";
		fsl,data-width = <18>;
		status = "okay";

		port@1 {
			reg = <1>;

			lvds1_out: endpoint {
				remote-endpoint = <&panel_lvds1_in>;
			};
		};
	};
};

&i2c2 {
	rtc@68 {
		compatible = "st,m41t81";
		reg = <0x68>;
	};
};

&usbh1 {
    maximum-speed = "high-speed";
};

&usbotg3 {
    status = "disabled";
};

&lsio_gpio2 {
    status = "disabled";
};

&usbotg1 {
    dr_mode = "host";
};

Do I understand correctly that this is a known issue to you at Toradex?
If so, do you happen to have an estimation on when you think this issue has been looked into?
Is there by any chance a known work-around at this point?

Thanks in advance.

Hello DemKev,

I kindly ask you to give us a little bit more time as we investigating this issue internally.

Best Regards,

Matthias Gohlke