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.

PWM Device Driver

Hi,

How to enable PWM support in linux kernel?

so that i can control PWM through /sys/class/pwm.

when i type "make menuconfig" command, in "Device Drivers", i cant find "PWM support" , where to enable PWM support?

my linux kernel version is : linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk

Thanks & Regards

Keldy

  • moving this to linux forum, so that it gets the attention of right folks.

  • Hi Keldy,

    Can you try using latest kernel release. PWM support is not available at 04.06.00.02 release.

    Details related to new release available at

    http://processors.wiki.ti.com/index.php/AM335x-PSP_04.06.00.07_Release_Notes

    Details related to PWM driver can found at

    http://processors.wiki.ti.com/index.php/AM335x_PWM_Driver%27s_Guide

    Thanks

    Avinash

  • Hi Avinash,

    After download the package, how to update the PSP sdk?

    Thanks & Regards

    Keldy

  • Hi,

    After download, how i update to my sd-card? since my beaglebone board use the mmc to boot.

    or i just install the downloaded package on my linux PC, then compile the kernel and copy the "arch/arm/boot/uImage" to sd-card ?

    Thanks & Regards

    Keldy

  • Hi folks! Replied to this rather than starting anew as it's closely related. So far, I have not been able to use either the eHRPWM or eCAP of the BeagleBone from within Arago (Linux 3.2.0):  my /sys/class/pwm/ is simply empty; similarly, I can't find the TSC folder for ainX either (analogue in). 

    I am using the latest Sitara AM335x Linux SDK (Kernel 3.2, PSP 04.06.00.07) and CCSv5.2 GA. The appropriate drivers are built into the kernel (not modules). The odd thing is, with a slightly newer kernel (Ångström, Kernel 3.2.5+), things work as expected with the right setup; the PWM device has nodes and attributes under those nodes as expected. As far as setup goes, in Ångström all I have to do is:

    1. Enable to clocks by mmap'ing /dev/mem (without thorough investigation of what OMAP_RESET_CLOCKS=n does, I am a little hesitant to just throw in the kernel config) ; and:
    2. Push out the mux mode (Output, No pullups, 4) to the pin (debugfs) via .../omap_mux/gpmc_a2 (for instance)
    Back in   land, the usual attribute sets and BAM! I can see things on the scope (you wouldn't know how many hours staring at a flat line I spent before I realized I was on the wrong side of the BeagleBone Ha ha ha (P8 v P9) as I mounted it upside down on my desk by accident).

    I am not sure why so far, I've only gotten it to work on Ångström, not Arago. Kernel version perhaps (3.2.0 v 3.2.5+/10+)? Hummm... the other thing I am in process of trying is rebuild u-boot with default pin muxing exposing the eHRPWM and eCAP to the BB cape connectors (based on guess that Arago may check at boot time, not later via omap_mux which I tried to no avail)

    Soon (my workstation's primary SSD pair took a dive and restoring right now *sigh*), soon...  and if that fails, it's JTAG-ging time!

    Anyway, whatever suggestions or [non NIL] pointers you may have will certainly be welcome... or even, "No can't be done until kernel x" (diffing more than 2 patchrevs of Linux kernel is a weekend burning affair at the very least)

    Oh, it also works (hacked up, but functional for test) under StarterWare.

    Thanks!  :)

  • Attached is a patch to get ehrpwm enabled on a Beaglebone running the linux-3.2.0-psp04.06.00.08 kernel (supplied with  ti-sdk-am335x-evm-05.05.00.00). I have tested this on a Beaglebone rev A3 with a scope. The kernel should be compiled with PWM support enabled as described in the AM335X PWM Driver's Guide. With this patch the  ehrpwm entries will appear under /sys/class/pwm and the pins will be muxed for PWM.

    1447.ehrpwm.diff

  • Dear Sir,

    I am trying to generate PWM output on beaglebone white. It is with ti-sdk-am335x-evm-06.00.00.00 TI sdk package and linux-3.2.0-psp04.06.00.11 package is available in the same TI sdk package. Default file system with this TI sdk package is Arago Project.

    I have check the kernel configuration for arm architecture in which PWM options for ehrpwm and ecap are enabled as static as per AM335x PWM user guide.

    But, when i log in beaglebone and check /sys/class/pwm folder, there are no files found for pwm such as ehrpwm.1. The folder is completely empty.

    For using ehrpwm0, i have removed the options of graphics library form kernel make menuconfig as per http://processors.wiki.ti.com/index.php/AM335x_PWM_Driver%27s_Guide  and cross compiled and downloaded the uImage but still same issue persists.


    Please suggest what can be the reason for the issue?

  • Please apply the patch given above and recompile.

  • Dear Sir,

    Thanks for the patch. I am able to get pwm entries in sys/class/pwm. 

    My issue of pwm is resolved.

  • Dear Sir,

    I am using beaglebone A6. I have istalled TI sdk prebuilt binaries and using Ti Arago Project filesystem.

    I want to install ntp and gpsd packages for my application.

    I am using opkg install ntp but it is showing error

    unknown package ntp.

    opkg install cmd: Cannot install package ntp.

    I also tried opkg update, but there was not any update. 

    I have tried pinging google ip address and it was showing the ping address is available.

    Please suggest for opkg and ntp issue.

    Regards,

    Ajay