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.

BeagleBone CLKOUT2

Hello,

I've been trying to use CLKOUT2 on the BeagleBone.  After it boots up I type:

root@beaglebone:~#  cat /sys/kernel/debug/omap_mux/xdma_event_intr1

name: xdma_event_intr1.clkout2 (0x44e109b4/0x9b4 = 0x0003), b NA, t NA
mode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE3

root@beaglebone:~# cat /sys/kernel/debug/clock/summary
clock-name                     parent-name                    rate       use-count
...
clkout2_ck                     sysclkout_pre_ck               32768      0
...

Does this mean that CLKOUT2 is selected and set to 32.768 kHz?  Right now I'm not seeing anything on the oscilloscope on P9 pin 41.

Is there any extra configuration needed to get a clock on CLKOUT2?

Thank you!

  • Hi Geoffrey,

    Yes, the clkout2_ck is 32.768 kHz. Please take a look at section 8.1.6.12 CLKOUT Signals of the AM335x TRM. You can see there that the default CLKOUT2 source is the 32K RTC. The default divider is 0 (1/1).

    Please also take a look at section 8.1.12.5.1 CM_CLKOUT_CTRL Register of the AM335x TRM. There is an enable bit, so you may want to check if this clock is enabled in the kernel. The function that does the enabling is omap2_dflt_clk_enable() inside <linux_dir>/arch/arm/mach-omap2/clock.c. A higher level function, where you may enable the debug prints and check for the name of your clock is omap2_clk_enable() inside this same file.

    To enable the debug prints simply put a #define DEBUG at the top of the file, where you want them enabled.

    Best regards,
    Miroslav

  • Hi Miroslav,

    From what I can tell so far the clock must not be enabled.  Is there a way to turn it on from user mode (i.e. without recompiling the kernel)?

    I just need to get a clock running so I can test to see if my design is going to work.

    Geoffrey

    P.S. - I just realized that CLKOUT2 is only sourced from the 32kHz clock and can't route the high-speed clock.  As a result, I'm considering using CLKOUT1 instead.

  • Make sure you read the Output Clock Characteristics note in the data sheet before designing a product that uses CLKOUT1 or CLKOUT2.

    Regards,
    Paul

  • Hi Paul,

    I did read that caution from the data sheet.  As a result, I'm going to eliminate using CLKOUT1 or CLKOUT2 in my design.  (It's a shame that those signals aren't reliable.)  Right now though my current prototype still needs a clock from the Sitara.

    I just finished rewiring the BeagleBone to send CLOCKOUT1 to P9 instead of CLOCKOUT2.  (I removed R218 and jumped a wire from R183 to P9.)    I'm getting a pretty good 24 MHz clock now.  I'm able to enable it from user mode using:

    echo 1b > /sys/kernel/debug/omap_mux/xdma_event_intr0

    I'd still like to know if it's possible to enable CLKOUT2 from user mode (without recompiling the kernel or rewiring the BeagleBone).  I've searched around and couldn't find anything.  If someone knows how to do it, it would be a good thing to post here.

    Thanks!

    Geoffrey