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.

PHYTC-3P-PHYBOARD-AM335X: Request for Assistance with AM335x GPIO Pin Muxing Issue

Part Number: PHYTC-3P-PHYBOARD-AM335X

Dear Team,

I am writing to seek assistance regarding an issue I encountered with the pinmuxing of the AM335x GPIOs. Despite following the prescribed syntax for pinmuxing and compiling it successfully, I am facing difficulties when attempting to manipulate the voltage of the pinmuxed GPIO pins. Regardless of my efforts to set the voltage to either high or low, the pins seem to retain their default voltage.

Below, I have provided relevant details pertaining to the setup:

  • Kernel Version: 5.15.82
  • Yocto Version: 4.0.9 (Kirkstone)

Syntax Used:


/* GPIOs */
&am33xx_pinmux {
    pinctrl-names = "default";
    pinctrl-0 = <&user_gpios_pins>;

    user_gpios_pins: pinmux-user-gpios {
        pinctrl-single,pins = <
            AM33XX_PADCONF(AM335X_PIN_GPMC_AD10, PIN_OUTPUT, MUX_MODE7)       /* gpmc_ad10.lcd_data21.gpio0_26 */
        >;
    };
};

I kindly request your assistance in reviewing the provided syntax and identifying any potential mistakes or discrepancies. Additionally, if there are any recommendations or corrections regarding the GPIO pinmuxing format, I would greatly appreciate your guidance.

Thank you for your attention to this matter. I eagerly await your response.

Testing Process 1:

gpioinfo gpiochip0
gpioset gpiochip0 26=1
gpioget gpiochip0 26

Testing Process 2:

echo 26 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio26/direction
echo 1 > /sys/class/gpio/gpio26/value
echo 0 > /sys/class/gpio/gpio26/value

Please let me know if you need any further information or assistance.

Note: After performing the above tests, the voltage measured on the GPIO pin was consistently around 0.2 volts.

Thanks & Regards

Lokesh A

  • Hi Lokesh A,

    I do not see any noticeable mistakes with the PinMux syntax in the device tree that you provided.

    Does this pin have any conflicting signals? You can refer to the datasheet for this information: https://www.ti.com/lit/ds/symlink/am3358.pdf


    Thanks,

    Anshu

  • Hi Anshu,

    There are no conflicting signals affecting the GPIO pin ,and we followed the Same Datasheet and reference manual.

    Best regards,
    Lokesh A

  • Hi Lokesh,

    Can you confirm that in the config file that "CONFIG_GPIO_SYSFS=y" exists? This enables the SYSFS interface for GPIOs.

    You could try moving the reference parameters to outside &am33xx_pinmux and into its own reference node. It shouldn't matter but its worth a try.

    Thanks,
    Anshu

  • Hi Anshu,


    Enabled the SYSFS interface for GPIOs in the configuration file: CONFIG_GPIO_SYSFS=y

    Thanks & Regards
    Lokesh A

  • Hi Lokesh,

    Since the measured voltage is about 0.2V, it makes me think that the pin is not initialized.

    I was reviewing the Hardware Schematics (Linked Here: https://www.phytec.de/fileadmin/legacy/downloads/Manuals/L-836e_1.pdf) It looks like LCD_DATA21 is being used which may not allow GPIO0_26 to be used.

    Can you share the output of 'gpioinfo 0'?

    Did you add the .h file for the macros?

    I'll try to apply the syntax on my end to see if I notice anything.

    Thanks,
    Anshu

  • Hi Anshu,

    This is the output of gpioinfo 0

    root@phyboard-wega-am335x-3:~# gpioinfo 0
    gpiochip0 - 32 lines:
    line 0: unnamed unused input active-high
    line 1: unnamed unused input active-high
    line 2: unnamed unused input active-high
    line 3: unnamed unused input active-high
    line 4: unnamed unused input active-high
    line 5: unnamed unused input active-high
    line 6: unnamed unused input active-high
    line 7: unnamed unused input active-high
    line 8: unnamed unused input active-high
    line 9: unnamed unused input active-high
    line 10: unnamed unused input active-high
    line 11: unnamed unused input active-high
    line 12: unnamed unused input active-high
    line 13: unnamed unused input active-high
    line 14: unnamed unused input active-high
    line 15: unnamed unused input active-high
    line 16: unnamed unused input active-high
    line 17: unnamed unused input active-high
    line 18: unnamed unused input active-high
    line 19: unnamed unused input active-high
    line 20: unnamed unused input active-high
    line 21: unnamed unused input active-high
    line 22: unnamed unused input active-high
    line 23: unnamed unused input active-high
    line 24: unnamed unused input active-high
    line 25: unnamed unused input active-high
    line 26: unnamed unused input active-high
    line 27: unnamed unused input active-high
    line 28: unnamed unused input active-high
    line 29: unnamed unused input active-high
    line 30: unnamed unused input active-high
    line 31: unnamed unused input active-high
    root@phyboard-wega-am335x-3:~#

    Please mention which .h file need to be change for the macros.

    Thanks
    Lokesh A

  • Hi Lokesh,

    I was mistaken about the .h file. Instead of the PADCONF, can you try this?

    AM33XX_IOPAD(0x828, PIN_OUTPUT | MUX_MODE7) /* (T12) gpmc_ad10.gpio0[26] */

    This is to check if IOPAD is supported.

    Thanks,

    Anshu

  • Hi Anshu,

    I regret to inform you that I am still encountering the same issue despite previous attempts to resolve it.

    Regarding the line:

    AM33XX_IOPAD(0x828, PIN_OUTPUT | MUX_MODE7) /* (T12) gpmc_ad10.gpio0[26] */

    It appears that the default voltage setting persists.

    Thank you for your attention to this matter.

    Thanks &  Regards,
    Lokesh A

  • Hi Lokesh,

    I can't really think of any other possible sources of the issue. If the voltage is around .2V, that means the pin is not defined. That really points either the pinmux syntax has an error or incorrect DTB is being used.

    For a sanity check, de-compile the dtb you are using and the GPIO pinmux should be there. Let me know what the result of that is.

    I was able to validate "AM33XX_IOPAD(0x828, PIN_OUTPUT | MUX_MODE7)" on my end.

    Thanks,
    Anshu