jsln / pps-gen-gpio

Linux kernel PPS generator using GPIO pins
GNU General Public License v2.0
32 stars 25 forks source link

Testing gpio output with linuxptp #2

Closed davidcemin closed 7 years ago

davidcemin commented 7 years ago

Hi Juan,

This is more a question than an issue. Ive downloaded your code into kernel 4.4 and Ive compiled it and put it on the beaglebone black. Ive modprobed your driver and i see it coming up, which is good. [ 134.924519] random: nonblocking pool is initialized [ 204.818461] pps_gen_gpio: GPIO PPS signal generator [ 204.824485] pps_gen_gpio: found 1 GPIOS defined in DT [ 204.829789] pps_gen_gpio pps-generator: GPIO lookup for consumer pps-gen [ 204.829802] pps_gen_gpio pps-generator: using device tree for GPIO lookup [ 204.829834] of_get_named_gpiod_flags: parsed 'pps-gen-gpios' property of node '/pps-generator[0]' - status (0) [ 204.829950] no flags found for pps-gen [ 204.830096] pps_gen_gpio: port write takes 2381ns [ 256.003929] pps_gen_gpio: we are late this time 255.999972447 [ 779.003925] pps_gen_gpio: we are late this time 778.999970551 [ 792.003931] pps_gen_gpio: we are late this time 791.999972719 [ 1614.003930] pps_gen_gpio: we are late this time 1613.999972984

Now, ive connected an oscilloscope between GND and pin 16 (im using the same dts config as you) but im not seeing anything on the output.

I would like to have this signal synced to linuxptp as well.

Am i missing something? Should I be seeing anything on the output on this case?

Thanks

David

davidcemin commented 7 years ago

Reading your code I can see that you basically use a kernel timer to toggle the signal up and down. So you need to have a way of synchronizing the PHC (namely /dev/ptp0) and your linux clock. Do you use phc2sys for this purpose?

davidcemin commented 7 years ago

Ok, I think I got the pps output problem solved. the delay parameter was too low and my scope wasnt triggering.

davidcemin commented 7 years ago

and the phc2sys is the one to use ( i just got it working )

Thanks for your help.

Cheers

D