ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# ls -l /system/bin
ls -l /system/bin
-rwxr-xr-x system system 191 2010-07-30 05:44 am
-rwxr-xr-x system system 77300 2010-07-30 05:44 dd
-rwxr-xr-x system system 77300 2010-07-30 05:44 df
-rwxr-xr-x system system 77300 2010-07-30 05:44 hd
-rwxr-xr-x system system 77300 2010-07-30 05:44 id
-rwxr-xr-x system system 77300 2010-07-30 05:44 ln
-rwxr-xr-x system system 77300 2010-07-30 05:44 ls
-rwxr-xr-x system system 77300 2010-07-30 05:44 mv
-rwxr-xr-x system system 191 2010-07-30 05:44 pm
-rwxr-xr-x system system 77300 2010-07-30 05:44 ps
-rwxr-xr-x system system 77300 2010-07-30 05:44 rm
-rwxr-xr-x system system 91064 2010-07-30 05:44 sh
-rwxr-xr-x system system 77300 2010-07-30 05:44 getprop
-rwxr-xr-x system system 76224 2010-07-30 05:44 ash
-rwxr-xr-x system system 77300 2010-07-30 05:44 cat
-rwxr-xr-x system system 77300 2010-07-30 05:44 cmp
-rwxr-xr-x system system 5492 2010-07-30 05:44 dvz
-rwxr-xr-x system system 194 2010-07-30 05:44 ime
-rwxr-xr-x system system 77300 2010-07-30 05:44 log
-rwxr-xr-x system system 77300 2010-07-30 05:44 smd
-rwxr-xr-x system system 192 2010-07-30 05:44 svc
-rwxr-xr-x system system 77300 2010-07-30 05:44 top
-rwxr-xr-x system system 77300 2010-07-30 05:44 setprop
-rwxr-xr-x system system 5180 2010-07-30 05:44 bluetoothd
-rwxr-xr-x system system 199 2010-07-30 05:44 bmgr
-rwxr-xr-x system system 18128 2010-07-30 05:44 chat
-rwxr-xr-x system system 77300 2010-07-30 05:44 date
-rwxr-xr-x system system 27060 2010-07-30 05:44 dund
-rwxr-xr-x system system 26892 2010-07-30 05:44 hidd
-rwxr-xr-x system system 5528 2010-07-30 05:44 gzip
-rwxr-xr-x system system 77300 2010-07-30 05:44 kill
-rwxr-xr-x system system 18244 2010-07-30 05:44 mtpd
-rwxr-xr-x system system 26940 2010-07-30 05:44 pand
-rwxr-xr-x system system 26648 2010-07-30 05:44 ping
-rwxr-xr-x system system 151760 2010-07-30 05:44 pppd
-rwxr-xr-x system system 5592 2010-07-30 05:44 rild
-rwxr-xr-x system system 77300 2010-07-30 05:44 stop
-rwxr-xr-x system system 77300 2010-07-30 05:44 sync
-rwxr-xr-x system system 47316 2010-07-30 05:44 vold
-rwxr-xr-x system system 77300 2010-07-30 05:44 wipe
-rwxr-xr-x system system 77300 2010-07-30 05:44 netstat
-rwxr-xr-x system system 9820 2010-07-30 05:44 dumpsys
-rwxr-xr-x system system 77300 2010-07-30 05:44 watchprops
-rwxr-xr-x system system 22160 2010-07-30 05:44 debuggerd
-rwxr-xr-x system system 77300 2010-07-30 05:44 toolbox
-rwxr-xr-x system system 5516 2010-07-30 05:44 dalvikvm
-rwxr-xr-x system system 5424 2010-07-30 05:44 radiooptions
-rwxr-xr-x system system 104960 2010-07-30 05:44 iptables
-rwxr-xr-x system system 77300 2010-07-30 05:44 insmod
-rwxr-xr-x system system 5468 2010-07-30 05:44 faketsd
-rwxr-xr-x system system 80740 2010-07-30 05:44 dbus-daemon
-rwxr-xr-x system system 205 2010-07-30 05:44 spp_test
-rwxr-xr-x system system 77300 2010-07-30 05:44 schedtop
-rwxr-xr-x system system 64244 2010-07-30 05:44 linker
-rwxr-xr-x system system 22572 2010-07-30 05:44 fsck_msdos
-rwxr-xr-x system system 9704 2010-07-30 05:44 logwrapper
-rwxr-xr-x system system 9764 2010-07-30 05:44 logcat
-rwxr-xr-x system system 23124 2010-07-30 05:44 bootanimation
-rwxr-xr-x system system 205 2010-07-30 05:44 monkey
-rwxr-xr-x system system 9684 2010-07-30 05:44 flash_image
-rwxr-xr-x system system 5648 2010-07-30 05:44 netcfg
-rwxr-xr-x system system 35288 2010-07-30 05:44 alsa_amixer
-rwxr-xr-x system system 77300 2010-07-30 05:44 newfs_msdos
-rwxr-xr-x system system 151868 2010-07-30 05:44 gdbserver
-rwxr-xr-x system system 10724 2010-07-30 05:44 showlease
-rwxr-xr-x system system 5404 2010-07-30 05:44 schedtest
-rwxr-xr-x system system 77300 2010-07-30 05:44 notify
-rwxr-xr-x system system 5516 2010-07-30 05:44 qemu-props
-rwxr-xr-x system system 210560 2010-07-30 05:44 applypatch_static
-rwxr-xr-x system system 77300 2010-07-30 05:44 ifconfig
-rwxr-xr-x system system 23204 2010-07-30 05:44 hciattach
-rwxr-xr-x system system 77300 2010-07-30 05:44 chmod
-rwxr-xr-x system system 77300 2010-07-30 05:44 chown
-rwxr-xr-x system system 77300 2010-07-30 05:44 dmesg
-rwxr-xr-x system system 5680 2010-07-30 05:44 app_process
-rwxr-xr-x system system 77300 2010-07-30 05:44 setconsole
-rwxr-xr-x system system 77300 2010-07-30 05:44 iftop
-rwxr-xr-x system system 163144 2010-07-30 05:44 racoon
-rwxr-xr-x system system 77300 2010-07-30 05:44 ioctl
-rw-r--r-- system system 201 2010-07-30 05:44 input
-rwxr-xr-x system system 5456 2010-07-30 05:44 mediaserver
-rwxr-xr-x system system 77300 2010-07-30 05:44 lsmod
-rwxr-xr-x system system 77300 2010-07-30 05:44 mkdir
-rwxr-xr-x system system 77300 2010-07-30 05:44 reboot
-rwxr-xr-x system system 77300 2010-07-30 05:44 mount
-rwxr-xr-x system system 77300 2010-07-30 05:44 renice
-rwxr-xr-x system system 5436 2010-07-30 05:44 system_server
-rwxr-xr-x system system 9868 2010-07-30 05:44 servicemanager
-rwxr-xr-x system system 13764 2010-07-30 05:44 qemud
-rwxr-xr-x system system 77300 2010-07-30 05:44 rmdir
-rwxr-xr-x system system 77300 2010-07-30 05:44 rmmod
-rwxr-xr-x system system 77300 2010-07-30 05:44 route
-rwxr-xr-x system system 77300 2010-07-30 05:44 sleep
-rwxr-xr-x system system 77300 2010-07-30 05:44 start
-rwxr-xr-x system system 60036 2010-07-30 05:44 alsa_ctl
-rwxr-xr-x system system 77300 2010-07-30 05:44 sendevent
-rwxr-xr-x system system 5556 2010-07-30 05:44 sdutil
-rwxr-xr-x system system 62664 2010-07-30 05:44 check_prereq
-rwxr-xr-x system system 251836 2010-07-30 05:44 updater
-rwxr-xr-x system system 6524 2010-07-30 05:44 keystore_cli
-rwxr-xr-x system system 39496 2010-07-30 05:44 alsa_aplay
-rwxr-xr-x system system 77300 2010-07-30 05:44 umount
-rwxr-xr-x system system 301592 2010-07-30 05:44 recovery
-rwxr-xr-x system system 14292 2010-07-30 05:44 dumpcrash
-rwxr-xr-x system system 77300 2010-07-30 05:44 vmstat
-rwxr-xr-x system system 9744 2010-07-30 05:44 dexopt
-rwxr-xr-x system system 44552 2010-07-30 05:44 dhcpcd
-rwxr-xr-x system system 10028 2010-07-30 05:44 keystore
-rwxr-xr-x system system 14292 2010-07-30 05:44 dumpstate
-rwxr-xr-x system system 5508 2010-07-30 05:44 bugreport
-rwxr-xr-x system system 77300 2010-07-30 05:44 printenv
-rwxr-xr-x system system 90920 2010-07-30 05:44 applypatch
-rwxr-xr-x system system 50616 2010-07-30 05:44 sdptool
-rwxr-xr-x system system 77300 2010-07-30 05:44 getevent
-rwxr-xr-x system system 14052 2010-07-30 05:44 installd
-rwxr-xr-x system system 5448 2010-07-30 05:44 surfaceflinger
-rwxr-xr-x system system 9864 2010-07-30 05:44 service
Just did some house cleaning on the header files,
Even after I masked the hrtimer.h or timer.h everything seem to compile perfectly, able to load, but PWM still at 21.74KHz.
I found that interrupt.h contains hrtimer.h
How are you running these tests? What is that code?
Also, just to get a feel for your code layout: which functions are your init_module() and cleanup_module() functions?
It seems that adb() echos the command call and then the standard output. Hence the ...
Code:
# /system/bin/lsmod
/system/bin/lsmod
#
I don't know the probability that this could be the case, but I suppose that could mean there are no loadable modules loaded to your kernel.
You could test it by running modprobe...
And see if the random module you loaded appears.
Post the process here...
If the random module does appear then I would guess that the reason your lsmod() was empty was because there were no loadable modules running, and consequently that means the module you are writing was not loaded and so your tests do not reflect any changes potentially made by the unloaded module.
Last edited by cin_; 03-04-2012 at 07:56 PM.
Reason: gramm`err
How are you running these tests? What is that code?
Also, just to get a feel for your code layout: which functions are your init_module() and cleanup_module() functions?
It seems that adb() echos the command call and then the standard output. Hence the ...
Code:
# /system/bin/lsmod
/system/bin/lsmod
#
I don't know the probability that this could be the case, but I suppose that could mean there are no loadable modules loaded to your kernel.
You could test it by running modprobe...
And see if the random module you loaded appears.
Post the process here...
If the random module does appear then I would guess that the reason your lsmod() was empty was because there were no loadable modules running, and consequently that means the module you are writing was not loaded and so your tests do not reflect any changes potentially made by the unloaded module.
Hi cin,
I can find my device driver under $ls /dev/ .
To test if my module able to communicate with me I use echo or cat. (Yea, I didn't post everything there kinda big files other part is not related to the timer interrupt. But I believe the one I posted should be able to works.)
There is a testgpio_write function for me to echo it from adb shell.
Which will trigger the timer interrupt to lunch.
my_hrtimer_callback with printk will print out the timing on the terminal in the same time I have a scope to read the GPIO toggling Frequency.
On this debugging environment I am not doing dynamically insmod device driver it.
The best help would be to clearly state what it is you want and to what end?
How do you want to change the output? It seems to me that you want the pulse width to have a resolution in a user submitted range, ie. 1ns, 10ns, 100ns...
Why do you want to change the output? To learn more about PWM control? If so, then you will have to read through some of these below and rewrite them in a constructive way. For power control purposes then you could just poach one of these libraries that would work for you in your module.
Worth noting that increasing the PWM switching frequency will reduce the PWM resolution.
I am trying out the gptimer method, with this I can get higher Hz.
I face some kernel problem on higher frequency at 50KHz -200KHz of PWM pulses.
above 200KHz: Lost the ability to communication via adb terminal. kernel stop display any warning Abvious freeze. GPIO still keep pulsing PWM.
50KHz: Kernel show a lot warning like the following , still able to talk via adb terminal. GPIO still keep pulsing PWM.
in a normal driver, from my current understanding seem like it is not recommended to generate pulses that above 50Khz?
If so what is the recommended speed?
I did something wrong in my code using gptimer?(attached below after the kernel warnings)
<kernel warning>
Code:
alarm_release: clear alarm, pending 0
binder: release 1031:1107 transaction 3878 in, still active
binder: send failed reply for transaction 3878 to 1094:1121
binder: release 1031:1110 transaction 3591 in, still active
binder: send failed reply for transaction 3591 to 1082:1082
binder: release 1031:1111 transaction 3875 in, still active
binder: send failed reply for transaction 3875 to 1094:1094
binder: release 1031:1112 transaction 3704 in, still active
binder: send failed reply for transaction 3704 to 1087:1119
binder: release proc 1031, transaction 3662, not freed
binder: release proc 1031, transaction 3665, not freed
binder: release proc 1031, transaction 3398, not freed
binder: release proc 1031, transaction 3670, not freed
binder: release proc 1031, transaction 3846, not freed
binder: release proc 1031, transaction 3870, not freed
binder: release proc 1031, transaction 3871, not freed
binder: release proc 1031, transaction 3858, not freed
binder: release proc 1031, transaction 3866, not freed
binder: release proc 1031, transaction 3867, not freed
binder: release proc 1031, transaction 3868, not freed
binder: release proc 1031, transaction 3869, not freed
binder: 1094:1094 transaction failed 29189, size 76-0
init: untracked pid 1018 exited
init: untracked pid 1087 exited
init: untracked pid 1082 exited
init: untracked pid 1094 exited
init: untracked pid 1124 exited
init: untracked pid 1132 exited
init: untracked pid 1138 exited
init: untracked pid 1144 exited
init: untracked pid 1162 exited
init: untracked pid 1168 exited
Did you ever find the functionality you were looking for?
If so, how did you do it?
Hi cin_,
thanks for helping me in the past
The whole idea of generating PWM is to identify if the driver system able to interrupts at very tight/high freq. So PWM actually serve as indicator to my scope to see if the system able to(in short I am trying to benchmark the linux driver capabilities with my ARMs). initial my newbie plan is if driver able to capture the that high freq(nanosec) interrupts, I can do with large memory dump at high freq rates.
Bitbang, and capturing interrupts from waveform signal generator(KHz->MHz) to my driver test shows that my initial idea is a bad idea. So in the end, move to hardware solution.
PS: Correct me if I am wrong, Linux kernel's PWM driver also depends on if the CPU have build in PWM hardware support, right?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.