Hi all,
I can't seem to control the GPIO pins on header J30 using the sysfs control following the Linux PSP GPIO Driver Guide.
I'm trying to control pin 5 on header J30, which is according to the schematics connected to LED D12 on the board.
following the documentation:
- - J30-5 is connected to L23 on the AM437x MPU via signal "AM437X_STATUS_LED0" ( Am437x_gp_evm_3k0006_schematic_rev1_4a.pdf - sheet 23 & 24).
- - L23 has the signal name "mcasp0_aclkr" within the datasheet "AM437x Sitara Processors (Rev. B)" (table 4-11).
- - mcasp0_aclkr has an offset of 0x9A0 ( 0x800 + 0x1A0 )according to "AM437x ARM Cortex-A9 Processors (Rev. D)" (table 7-11).
Looking at the DTS file "am437x-gp-evm.dts" for the offset of 0x1A0 I found this.
unused_pins: unused_pins { pinctrl-single,pins = < 0x54 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x58 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x60 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x6C (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x80 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn1.mmc1_clk */ 0x84 (PIN_INPUT | PULL_DISABLE | MUX_MODE7) /* gpmc_csn2.mmc1_cmd */ 0x150 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x190 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x194 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x198 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x19C (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x1A0 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* j30-5 0x23C (PIN_INPUT | PULL_DISABLE | MUX_MODE7) 0x240 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* j30-31 0x244 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x248 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x24C (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x250 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x254 (PIN_INPUT | PULL_DISABLE | MUX_MODE7) 0x258 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x260 (PIN_INPUT | PULL_DISABLE | MUX_MODE7) 0x268 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x270 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x278 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x27C (PIN_INPUT | PULL_DISABLE) 0x2C8 (PIN_INPUT_PULLDOWN) 0x2D4 (PIN_INPUT_PULLDOWN) 0x2D8 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2DC (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2E0 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2E4 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2E8 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2EC (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2F0 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2F4 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2F8 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x2FC (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x300 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x304 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x308 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x30C (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x310 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x314 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x318 (PIN_INPUT_PULLDOWN | MUX_MODE7) >; };
I assume that pin L23 is in mode 7, which should give me that it is used as GPIO3_18 ( gpio0_18 = mode 9).
linux pin number should then be 3*32 + 18 = 114
executing following commands:
$ echo 114 > /sys/class/gpio/export
$ cat /sys/class/gpio/gpio114/direction
in
$ cat /sys/class/gpio/gpio114/value
0
$ echo "out" > /sys/class/gpio/gpio114/direction
$ echo 1 > /sys/class/gpio/gpio114/value
Nothing on pin J30-3 or the LED, no voltage, no light, no dmesg entry.
I tried the same thing with gpio0_18 (mode 9), but nothing.
This goes for all the pins that I can export, I cant seem to export anything above pin 159
$ echo 160 > /sys/class/gpio/export /* gpio5_0 */
export_store: invalid GPIO 160
$ echo 170 > /sys/class/gpio/export /* gpio5_10 pin J30-31 connected to LED D9 */
export_store: invalid GPIO 170
I know i'm new to TI and linux but I'm at a loss any help or direction would be greatly appreciated.
Khasyk