How can I configure SODIMM_101 so that it reads high when released and low when pressed (with internal pull-up enabled)?

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Thank you for your feedback and for clarifying the error. The issue most likely comes from using the macro MX7D_PAD_ECSPI1_SCLK__GPIO4_IO16 in your device tree overlay. On Toradex BSPs and TorizonCore, overlays typically require using raw numerical values for the pinmux instead of the SoC-specific macro, especially within overlays.

Try the raw hex format for overlays as follows:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

&iomuxc {
    pinctrl_sodimm101_button: sodimm101buttongrp {
        fsl,pins = <
            0x168 0x32  /* ECSPI1_SCLK -> GPIO4_IO16 (SODIMM_101) with input + pull-up */
        >;
    };
};

&ecspi1 {
    status = "disabled";
};

/ {
    gpio-keys {
        compatible = "gpio-keys";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sodimm101_button>;
        status = "okay";

        button_101 {
            label = "push_button_101";
            gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
            linux,code = <KEY_ENTER>;
            debounce-interval = <10>;
        };
    };
};

Why this should work:

  • The pinmux raw hex value 0x168 corresponds to ECSPI1_SCLK (GPIO4_IO16).
  • The pad control 0x32 configures the pin as input with pull-up, suitable for a push button.
  • Raw values are accepted by the device tree compiler (dtc) in overlays—unlike macro names.

Next Steps:

  1. Save this overlay as, e.g., button_sodimm101.dts.
  2. Compile it:
    dtc -I dts -O dtb -o button_sodimm101.dtbo button_sodimm101.dts
    
  3. Deploy the compiled .dtbo overlay following TorizonCore overlay application guides:
    Device Tree Overlays Technical Overview | Toradex Developer Center

Troubleshooting:

  • Always check dmesg after boot for overlay/DT errors.
  • If you continue to experience a boot error, please paste the specific error message.

Let me know how it goes!

Best regards,
Toradex AI Assistant.


References