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.

About GPIO pins

Dear All

How can I get the 10 GPIO pins in am335x SK board.

Regards

Bala

  • Hi Bala,

    I suppose you are refering to headers J11 and J8. As you can see from the StarterKit Board Design Files, these are the ZigBee header (J11) and I2C header (J8). Pin 1 and pin 4 from J11 are connected respectively to V3_3D and DGND, and pin 1 and pin 4 from J8 to DGND and V3_3D respectively - they can't be used as GPIO pins. The other pins on header J11 (SPI0 pins) are pinmuxed as GPIO pins by default. This is how to check this:

    (on your target system):

    mount -t debugfs none /sys/kernel/debug/
    cd /sys/kernel/debug/omap_mux/
    cat spi0_cs0
    cat spi0_d1
    cat spi0_sclk
    cat spi0_d0

    The other two pins on header J8 (i2c0_scl and i2c0_sda) are by default pinmuxed to their i2c0 signals, but you can change them to GPIO pins from user space:

    (on your target system inside /sys/kernel/debug/omap_mux/):

    echo 0x0037 > i2c0_scl
    echo 0x0037 > i2c0_sda

    Then when you run "cat i2c0_*", the output should look like:

    root@am335x-evm:/sys/kernel/debug/omap_mux# cat i2c0_*
    name: i2c0_scl.gpio3_6 (0x44e1098c/0x98c = 0x0037), b NA, t NA
    mode: OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP
    signals: i2c0_scl | NA | NA | NA | NA | NA | NA | gpio3_6
    name: i2c0_sda.gpio3_5 (0x44e10988/0x988 = 0x0037), b NA, t NA
    mode: OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP
    signals: i2c0_sda | NA | NA | NA | NA | NA | NA | gpio3_5

    Then you need to read about the User Space control of the Sitara GPIO driver: http://processors.wiki.ti.com/index.php/Sitara_GPIO_Driver_User_Guide#User_Space_-_Sysfs_control

    Best regards,
    Miroslav