Hi,
I want to know how to use GPIO2 and GPIO3 banks in beaglebone. gpioLEDblink.c only shows GPIO0 and GPIO1 activation. But for GPIO2,3, there is not clock configuration and pinmux routine. Where can I find any useful information?
Thank you.
SG
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.
Hi,
I want to know how to use GPIO2 and GPIO3 banks in beaglebone. gpioLEDblink.c only shows GPIO0 and GPIO1 activation. But for GPIO2,3, there is not clock configuration and pinmux routine. Where can I find any useful information?
Thank you.
SG
For GPIO2 and 3, you need to write similar functions as gpio1.
You can refet TRM and data sheet for more details.
Regards
Baskaran
Thank you for your answer.
Problem is... I'm not very familiar with the hardware things... So, here is another question. I, in fact, sneaked into evmskAM335x codes. There I found GPIO2 clock configuration routine. But it was significantly different from GPIO0 and 1. GPIO0 and 1 clock are shared by other functions whereas GPIO2 of evmsk seems to be dedicated. Where can I find such information like shared or dedicated clock system? Or, beaglebone's GPIO is exactly the same as svmsk and I can simply use them?
Thank you.
SG
Hello Sang,
Clock Configuration functions are generic
Firstly, I would like to say that the Clock Configuration functions and Pin Multiplexing functions are specific to the SoC and remains the same for all the EVMs of that SoC. Likewise, in StarterWare AM335x, the clock configuration and Pin Multiplexing functions for one EVM can be used for another.
Clock Configuration function for GPIO2
I assume you are referring to the StarterWare 02.00.00.07 release package. Unlike what you say, I could not find any Clock Configuration function for GPIO2 under "platform/evmskAM335x/gpio.c". It has to be freshly written.
I agree that the GPIO0 Clock Configuration function in “platform/beaglebone/gpio.c” has some function invocations that are uncalled for. These extra function calls creates an impression that the GPIO0 clocks are shared with the others. This is not the case. The purpose of a peripheral clock configuration function is to enable the functional clocks to the module, that is, the clocks driving that specific module. However, the GPIO1 Clock Configuration function present in the same file is ideal and does required operations only. Please refer to this function to configure functional clocks for GPIO2 instance.
References
The register to be programmed for enabling GPIO2 functional clocks is the CM_PER_GPIO2_CLKCTRL register in AM335x Technical Reference Manual (TRM). This falls under the chapter Power, Reset and Clock Management (PRCM).
Please revert for any queries.
Thanks and Regards.
Gurudutt.
Hello Gurudutt,
Thank you for your answer. That helped a lot. I think I understood what is going on. The TRM was also helpful in understanding how clocks are arranged in the device.
Thank you.