![]() |
flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
|
The library can be built in IDE managed mode or using the built-in CMake support. Using CMake is highly recommended. More on that Compiling the library.
FLEXPTP_HWPORT
CMake variable, or populate the FLEXPTP_HWPORT_SRC
with the list of custom hardware port files. Bundled hardware ports can be automatically tailored to some compatible devices by specifying the MCU type (e.g. the STM32F407 port works with the STM32F439 device as well, so that setting FLEXPTP_HWPORT
to F439_{LWIP|ETHERLIB}}
makes flexPTP using the former port files).FLEXPTP_NSD
to the Network Stack Driver files and the FLEXPTP_NETWORK_STACK
to the name of the network library or pick from the predefined set (LWIP, ETHERLIB). In the latter case, do not populate FLEXPTP_NETWORK_STACK
.FLEXPTP_SERVO
variable. If a custom servo is used, and the developer wants the servo to get compiled into the flexPTP library, then populate the FLEXPTP_SERVO_SRC
variable with the list of custom servo files. Leaving both FLEXPTP_SERVO
and FLEXPTP_SERVO_SRC
variables empty results in a warning message during CMake configuration, however it does not necessarily results in a faulty operation. If servo functions are set correctly in the flexptp_options.h
configuration file, then the linker will connect flexPTP and the custom servo.flexptp_options.h
onto a location that is accessible for the flexPTP module. Set the FLEXPTP_INCLUDES
CMake variable so that the former requirement is satisfied.FLEXPTP_CPU_PARAMS
and FLEXPTP_COMPILE_DEFS
to pass target CPU parameters and C definitions.Building this way results in a static library (libflexptp
) that is managed by CMake. This library must be linked to the project's output. Optionally, the name of the output can be suffixed by a tag for reasons by setting the FLEXPTP_TARGET_TAG
.
For more information about flexPTP's CMake variables, see CMakeLists.txt
.
The following configuration instructs the flexPTP to:
lwipcore
library)The CMake configuration output will be the following:
*.c
and *.h
files in the root folder as source file. Do NOT include the hw_port
directory!ptp_port_XXXX.c/h
files from the hw_port
port directory to the buildset. Repeat the former method for the Network Stack Driver, the network stack library and for the Clock Servo.flexptp_options.h
onto a location that is accessible for the compiler through the include path.This way the compilation target is determined by the build system. The build system's settings determine whether a static library is built or the flexPTP will be included into the project's output executable directly.
It is possible to build flexPTP separately as well. This way only header files and a precompiled library must be added to the project.