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.

Toggelin a GPIO

Other Parts Discussed in Thread: AM3517

Hello,

My main question is what are the registers involve to toggle  a GPIO in AM3517 ARM processor.  I am basically interested to toggle the GPIO-140.  One quick sample or a reference would be very useful.  I also like to know how I can do this in U-Boot please.

Thanks,

Ali.

  • Hi Ali,

    check in u-boot ;

    board/ti/beagle/beagle.c file.

    you may get some idea!!!!!!!!!!!!!!!

    Regards,

    santosh vastrad

  • Dear Santosh,

    Thank you for your suggestion.  Please let me know if this is the correct path to the file that you suggested,

    http://gitorious.org/beagleboard-validation/u-boot/blobs/xm/board/ti/beagle/beagle.c

    I am trying to set a GPIO let's say GPIO-140 to high and low.  I already tried the following command,

    cd /sys/class/gpio/

    echo 140>export

    cd gpio140

    echo out > direction

    echo 0 > value

    echo 1 > value

    By entering the above command I did not see the GPIO_140 toggles.  I found out I may need to set the MUXMODE as well.   Basically would you know how I can enter the following command in as suggested  in

    http://elinux.org/BeagleBoardPinMux#OMAP3 please,

    MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M4)) /*GPIO_140*/\

    Thanks again,

    Ali.

  • Hi Ali,

    Refer to the below list of functions present in:  "cpu/arm_cortexa8/omap3/gpio.c"

    omap_request_gpio

    omap_set_gpio_direction

    omap_set_gpio_dataout

    Regards,

    N.S.SriHarsha

  • Dear Ali,

    You can refer to function "setup_net_chip" inside "board/ti/evm/evm.c" which actually toggles Eth reset gpio pin.

    The evm.c code is located under <u-boot home directory>/board/logicpd/am3517/am3517evm.c OR if its older u-boot version then check <u-boot home directory>/board/ti/am3517/am3517evm.c

    Let me know if this helps.