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.

Linux/AM5728: GPIO does not toggle

Part Number: AM5728

Tool/software: Linux

Hi,

I am trying to control GPIO7_1 through /sys/class/gpio/gpio193.

root@am57xx-evm:/sys/class/gpio/gpio193# cat direction
out

root@am57xx-evm:/sys/class/gpio/gpio193# cat value
0

When I use a osciloscope to measure the voltage, it shows that it is 3.3 V even though I set it to 0.

I took additionally steps and replaced the mux mode settings for mux_data.h

I replaced the old entry for MMC3_DAT2 with {MMC3_DAT2, (M14 | PIN_OUTPUT_PULLUP)}. Please see attached mux_data.h file.

1777.mux_data.h

Also, within kernel space I set gpio193 (GPIO7_1) to 0:

gpio_request(193, "gpio7_1");
gpio_direction_output(193, 0);
gpio_export(193, true);

See the debug output:

root@am57xx-evm:/sys/class/gpio/gpio193# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/4ae10000.gpio, gpio:

gpiochip1: GPIOs 32-63, parent: platform/48055000.gpio, gpio:
gpio-37 ( |enable ) out lo
gpio-40 ( |? ) out lo
gpio-52 ( |Home ) in hi IRQ
gpio-55 ( |Up ) in hi IRQ
gpio-56 ( |Right ) in hi IRQ
gpio-57 ( |Down ) in hi IRQ
gpio-60 ( |Left ) in hi IRQ

gpiochip2: GPIOs 64-95, parent: platform/48057000.gpio, gpio:

gpiochip3: GPIOs 96-127, parent: platform/48059000.gpio, gpio:
gpio-97 ( |sfp0dis ) out lo
gpio-103 ( |sfp1dis ) out lo
gpio-113 ( |phyadd2 ) out lo
gpio-114 ( |phyadd3 ) out lo
gpio-115 ( |phyadd4 ) out lo
gpio-117 ( |vbus ) in lo IRQ

gpiochip4: GPIOs 128-159, parent: platform/4805b000.gpio, gpio:
gpio-136 ( |vmmcwl_fixed ) out lo
gpio-142 ( |phyresetn ) out hi

gpiochip5: GPIOs 160-191, parent: platform/4805d000.gpio, gpio:
gpio-187 ( |cd ) in lo IRQ

gpiochip6: GPIOs 192-223, parent: platform/48051000.gpio, gpio:
gpio-193 ( |gpio7_1 ) out lo
gpio-200 ( |? ) out hi
gpio-201 ( |? ) out lo
gpio-206 ( |? ) out lo
gpio-207 ( |? ) out lo

gpiochip7: GPIOs 224-255, parent: platform/48053000.gpio, gpio:
gpio-224 ( |nMR1553 ) out hi

gpiochip8: GPIOs 504-511, parent: platform/48070000.i2c:tps659038@58:tps659038_gpio, 48070000.i2c:tps659038@58:tps659038_gpio, can sl
eep:
gpio-506 ( |GPIO fan control ) out lo

Please let me know how I can enable control of this gpio pin through userspace.

Thanks,
Eeshan