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.

TMDXEVM8148: GPIO Numbers for GPIO pins in J17 GPIO Connector

Dear Support Staff,

We are using TMDXEVM8148 evaluation board for our development.   We need to use GPIO pins in J17 GPIO Connector

(CSI interface).  To program this pin let us know what is the GPIO number to be used in gpio_request() function. 

In J17 connector we need to use:  Pin #4 & Pin #5 as GPIO signal out.  Let me know if this is possible and what are the

GPIO pin numbers to be used in gpio_request() function. 

Thanks & Regards,

Aravind S

Lead Engineer

Sasken Comm Tech Ltd

 

  • Hi Aravind,
     
    Do you mean J17 on the expansion board (RJ-45 connector)? If this is the one you mean pin 4 is GP0[29] and pin 5 is GP3[18].
  • Hi Staff,

    Thanks for the reply.

    Yes,  it is J17 on expansion board.  Please confirm if I can use the Pin4 & Pin5 as below.

    gpio_request(29)      /* for  pin#4 .i.e. GP0[29]  ==> gpio number = 29*/

    gpio_request(114)    /* for pin $5 .i.e.  GP3[18] ==> gpio number = 32*3+18 = 114 */

    Thanks & Regards,

    Aravind S

     

     

  • Hi Aravind,

    According to our GPIO driver user guide, you should pass two parameters to the gpio_request function:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_GPIO_Driver_User_Guide#Kernel_Level

    Allocate memory to GPIO line, can be achieved by doing gpio_request()
    err = gpio_request(30, "sample_name");

    Some examples from our TouchScreen Driver User Guide:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_TouchScreen_Driver_Guide

    ret = gpio_request(gpio, "lcd_power");

    error = gpio_request(GPIO_TSC, "ts_irq");

    Regards,
    Pavel


  • Hi Staff,

    To check GPIO connection J17 (pin #4 : GP0[29]  and pin #5:  GP3[18], the below

    was tried.  But the voltage at PIN#4 & PIN#5 are always at around 0.6 Volts. The

    value of 0/1 set for GP0[29] & GP3[18] using below process is not having any effect

    on the voltage level at the pin #4/ pin #5 of J17 GPIO connector.  Please provide your

    inputs to use the pins.

    /* PIN #4 */
    echo 29 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio29/direction
    echo 1 > /sys/class/gpio/gpio29/value
    echo 0 > /sys/class/gpio/gpio29/value


    /* Pin #5 */
    echo 114 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio114/direction
    echo 1 > /sys/class/gpio/gpio114/value
    echo 0 > /sys/class/gpio/gpio114/value

    Thanks & Regards,

    Aravind S

     

  • Hi Staff,

    To check GPIO connection J17 (pin #4 : GP0[29]  and pin #5:  GP3[18], the below

    was tried.  But the voltage at PIN#4 & PIN#5 are always at around 0.6 Volts. The

    value of 0/1 set for GP0[29] & GP3[18] using below process is not having any effect

    on the voltage level at the pin #4/ pin #5 of J17 GPIO connector.  Please provide your

    inputs to use the pins.

    /* PIN #4 */
    echo 29 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio29/direction
    echo 1 > /sys/class/gpio/gpio29/value
    echo 0 > /sys/class/gpio/gpio29/value


    /* Pin #5 */
    echo 114 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio114/direction
    echo 1 > /sys/class/gpio/gpio114/value
    echo 0 > /sys/class/gpio/gpio114/value

    Thanks & Regards,

    Aravind S

     

  • Hi Aravind,

    Can you provide me the value of the PINCNTL59 register, after you execute the two commands:

    echo 29 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio29/direction

    Can you provide me the value of the PINCNTL226 register, after you execute the two commands:

    echo 114 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio114/direction

    Regards,

    Pavel

  • Hi Staff,

    The values of PINCNTL59 and PINCNTL226 were checked in below scenarios and the

    result is mentioned below:

    echo 29 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio29/direction

    after this value of PINCNTL59 = 0x40001 

    echo 114 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio114/direction

    after this value of PINCNTL226 = 0x50004

    Please let know how to proceed futher to enable Pin #4/#5 of J17 to work as output GPIO's

    (GP0[29] & GP3[18]).

    Thanks & Regards,

    Aravind S

     

     

     

     

  • Hello,

    There is a note inside the http://processors.wiki.ti.com/index.php/TI81XX_PSP_GPIO_Driver_User_Guide :

    Note: GPIO's which are used already in the drivers can not be control from sysfs, unless until driver export that particular pin.

    I suspect this is causing the issue. You can try to set the GPIO pins from inside the linux kernel, check below how:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_User_Guide#TI814X.2FTI813X

    Regards,

    Pavel


  • Hi Staff,

    As per the description in  http://processors.wiki.ti.com/index.php/TI81XX_PSP_User_Guide#TI814X.2FTI813X,

    the below was done used as boot argurment :

    Try1:  omap_mux=OMAP_PIN_OUTPUT.gpio0_29=0,OMAP_PIN_OUTPUT.gpio3_18=0

    Try2:  omap_mux=OMAP_MUX_MODE1.gpio0_29=0,OMAP_MUX_MODE4.gpio3_18=0

    After the bootup,  in both cases, at Pin#4/Pin#5 for J17, the voltage level was not 0V.  With a Pullup resistor,  the voltage was 3.7 V.

    Please let me know further actions to use Pin#4/Pin#5 of J17 as GPIO output.

    Regards,

    Aravind S

     

     

     

  • Aravind,

    Make the following modifications in {EZSDK}/board-support/linux-2.6.37-psp04.04.00.01/arch/arm/mach-omap2/board-ti8148evm.c

    #ifdef CONFIG_OMAP_MUX
    static struct omap_board_mux board_mux[] __initdata = {
        TI814X_MUX(MLB_SIG, OMAP_MUX_MODE7),    
        TI814X_MUX(VOUT1_R_CR8, OMAP_MUX_MODE7),
        { .reg_offset = OMAP_MUX_TERMINATOR },
    };

    Then:

    1. Choose default kernel configuration for the platform.

    $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm ti8148_evm_defconfig

    2. To view configuration interactively:

    $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm menuconfig

    Enable GPIO sysfs support:

    Device Drivers  ---> GPIO Support  ---> /sys/class/gpio/... (sysfs interface)

    3. Initiate the build:

    $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage

    Use the newly generated uImage from linux-2.6.37-psp04.04.00.01/arch/arm/boot/uImage to boot the system.

    When boot up successfully, make:

    root@dm814x-evm:~# echo 29 > /sys/class/gpio/export
    PM: Adding info for No Bus:gpio29
    root@dm814x-evm:~# echo "out" > /sys/class/gpio/gpio29/direction
    root@dm814x-evm:~# echo 114 > /sys/class/gpio/export
    PM: Adding info for No Bus:gpio114
    root@dm814x-evm:~# echo "out" > /sys/class/gpio/gpio114/direction

    Then check the /sys/class/gpio folder, it should contain the gpio29 and gpio114:

    root@dm814x-evm:/sys/class/gpio# ls
    export       gpio128      gpio31       gpiochip128  gpiochip64   unexport
    gpio114      gpio29       gpiochip0    gpiochip32   gpiochip96

    Then check the output direction is set correctly:

    root@dm814x-evm:/sys/devices/virtual/gpio/gpio29# cat direction
    out

    root@dm814x-evm:/sys/devices/virtual/gpio/gpio114# cat direction
    out

    Does this work for you?

    Regards,

    The Staff