Re: [Linuxptp-users] Read ptp clock from a C code ..
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2016-07-19 16:15:56
|
On Tue, Jul 19, 2016 at 10:42:20AM +0200, Baya Oussena wrote: > I tried to compile the testptp.c but failed. Is there any one from you who > has a code I could adapt to my need or is it as sample as just opening and > reading /dev/ptp0 driver. The testptp.c program is the example for the PHC API. It should compile without any trouble. Here is how I would do it, taking the beagle bone as an example: export ARCH=arm export CROSS_COMPILE=/opt/x-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- export KBUILD_OUTPUT=/home/richard/kernel/beagle # compile the kernel make # install the headers under ${KBUILD_OUTPUT} make headers_install # compile the test program make -C Documentation/ptp -f testptp.mk Easy, right? Thanks, Richard |