Sandra Jobst wrote:
> There are different possibilities to handle a gpio access.
> 1. you can map the addresses into userspace as shown here:
> http://docwiki.gumstix.com/index.php/Sample_Code/C/LED, but i think this
> is a rather risky way, because you could easily overwright important
> things in kernelspace, without noticing.
> 2. you can wright a userspace driver: http://lwn.net/Articles/232575/,
> it seems to be a good possibility for not time critical issues
> 3. you can write a kernel module, as for example
> "gumstix-oe\com.gumstix.collection\packages\gpio-event". It is the
> safest possibility, and when you need such high resolution timings, the
> only way i think.....
Thanks for the detailed response. I believe that the code I am using
for GPIO maps the addresses into userspace. I understand that this is
risky, but if someone that knew what they were doing wrote the code, it
could be perfectly safe, correct? I obviously would not write it, but
perhaps someone already has some code with pwm mapped where you can easily
set the duty cycle. That would be the easiest for me, because then I don't
have to rebuild the kernel.
As for kernel modules, I still have a few questions. Also, I still can
not get your code to compile. Could you could send me your bitbake recipe?
What is the procedure for adding a kernel module? Right now I have your
code in com.gumstix.collection/packages/pwm/files/pwm.c I tried "bitbake
pwm" to make sure I had the recipe correct, but I get the error "No such
file or directory" on the included header files. I also added
"module_autoload_proc_gpio = 'pwm' " to gumstix-custom-basix.conf
From what I gather, I believe I need to issue the following commands:
bitbake -c rebuild gumstix-kernel
bitbake -c rebuild gumstix-basic-image
then install the image on the gumstix, as decribed in
Is that it? Well, I did all of this, and I don't think it worked. How
exactly do I know if it did? I checked /sbin and /usr/sbin, but "pwm" does
not exist. If I type "PWM_PWDUTY0 = 1000 & PWM_DCR_MASK", I get:
-sh: PWM_PWDUTY0: not found
-sh: PWM_DCR_MASK: not found
 + Done(127) PWM_PWDUTY0 = 1000
But there is no square wave on the scope. Do you know what I did wrong?
View this message in context: http://www.nabble.com/PWM-H-Bridge-servo----basix--breakout-gs-tp23491954p23788237.html
Sent from the Gumstix mailing list archive at Nabble.com.