Kconfig.projbuild 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. #
  2. # For a description of the syntax of this configuration file,
  3. # see the file kconfig-language.txt in the NuttX tools repository.
  4. #
  5. menu "PTP Daemon Configuration"
  6. config NETUTILS_PTPD
  7. bool "PTPD client/server"
  8. default y
  9. #depends on NET_IPv4
  10. #depends on NET_IGMP
  11. #depends on NET_UDP
  12. help
  13. Build a minimal implementation of IEEE-1588 precision time protocol.
  14. Uses system gettimeofday() and adjtime() calls to synchronize clock
  15. with a master clock through network, or to provide a master clock to
  16. other systems.
  17. if NETUTILS_PTPD
  18. config NETUTILS_PTPD_DEBUG
  19. bool "Enable PTP debug messages"
  20. default n
  21. depends on DEBUG_INFO
  22. help
  23. Enable PTP debug messages even if CONFIG_DEBUG_NET_INFO is not enabled.
  24. config NETUTILS_PTPD_CLIENT
  25. bool "Enable client support"
  26. default y
  27. help
  28. Act as a PTP client, synchronizing the NuttX clock to a remote master
  29. clock.
  30. config NETUTILS_PTPD_SERVER
  31. bool "Enable server support"
  32. default n
  33. help
  34. Act as a PTP server, providing NuttX clock time to other systems.
  35. Both server and client can be simultaneously enabled. NuttX will then
  36. synchronize to a higher priority master clock, or act as a master
  37. clock itself if it has the highest priority.
  38. Refer to Best Master Clock algorithm in IEEE-1588 for details.
  39. config NETUTILS_PTPD_STACKSIZE
  40. int "PTP daemon stack stack size"
  41. default 4096 # DEFAULT_TASK_STACKSIZE
  42. config NETUTILS_PTPD_SERVERPRIO
  43. int "PTP daemon priority"
  44. default 100
  45. config NETUTILS_PTPD_DOMAIN
  46. int "PTP domain selection"
  47. default 0
  48. range 0 127
  49. help
  50. Set PTP domain to participate in. Default domain is 0, other domains
  51. can be used to isolate reference clocks from each other.
  52. if NETUTILS_PTPD_SERVER
  53. config NETUTILS_PTPD_PRIORITY1
  54. int "PTP server priority1"
  55. default 128
  56. range 0 255
  57. help
  58. Set clock priority to announce when acting as a PTP server.
  59. Lower value is higher priority.
  60. A higher priority1 clock will be selected without regard to announced
  61. clock quality fields.
  62. Refer to Best Master Clock algorithm in IEEE-1588 for details.
  63. config NETUTILS_PTPD_PRIORITY2
  64. int "PTP server priority2"
  65. default 128
  66. range 0 255
  67. help
  68. Set clock subpriority to announce when acting as a PTP server.
  69. This will distinguish between two clocks that are equivalent in
  70. priority1, class and accuracy values.
  71. Lower value is higher priority.
  72. config NETUTILS_PTPD_CLASS
  73. int "PTP server class"
  74. default 248
  75. range 0 255
  76. help
  77. Set master clock class to announce when acting as a PTP server.
  78. Lower value means higher quality clock source.
  79. 248 is the default for unknown class.
  80. config NETUTILS_PTPD_ACCURACY
  81. int "PTP server accuracy"
  82. default 254
  83. range 0 255
  84. help
  85. Set master clock accuracy to announce when acting as a PTP server.
  86. Logarithmic scale is defined in IEEE-1588:
  87. 32: +- 25 ns
  88. 33: +- 100 ns
  89. 34: +- 250 ns
  90. 35: +- 1 us
  91. 36: +- 2.5 us
  92. 37: +- 10 us
  93. 38: +- 25 us
  94. 39: +- 100 us
  95. 40: +- 250 us
  96. 41: +- 1 ms
  97. 42: +- 2.5 ms
  98. 43: +- 10 ms
  99. 44: +- 25 ms
  100. 45: +- 100 ms
  101. 46: +- 250 ms
  102. 47: +- 1 s
  103. 48: +- 10 s
  104. 49: +- more than 10 s
  105. 254: Unknown
  106. config NETUTILS_PTPD_CLOCKSOURCE
  107. int "PTP server clock source type"
  108. default 160
  109. range 0 255
  110. help
  111. Set clock source type to announce when acting as a PTP server.
  112. Common values:
  113. 32: GPS
  114. 64: PTP
  115. 80: NTP
  116. 144: Other
  117. 160: Internal oscillator
  118. config NETUTILS_PTPD_SYNC_INTERVAL_MSEC
  119. int "PTP server sync transmit interval (ms)"
  120. default 1000
  121. help
  122. How often to transmit sync packets in server mode.
  123. config NETUTILS_PTPD_ANNOUNCE_INTERVAL_MSEC
  124. int "PTP server announce transmit interval (ms)"
  125. default 10000
  126. help
  127. How often to transmit announce packets in server mode.
  128. config NETUTILS_PTPD_TWOSTEP_SYNC
  129. bool "PTP server sends two-step synchronization packets"
  130. default y
  131. help
  132. If enabled, sends a follow-up packet after every sync packet.
  133. This helps compensate for the time taken to initiate the transmission.
  134. config NETUTILS_PTPD_DELAYRESP_INTERVAL
  135. int "PTP server suggested interval of delay requests"
  136. range 0 255
  137. default 4
  138. help
  139. When responding to a delay request, the server can inform the client
  140. how often it should test path delay. This is done using header field
  141. logMessageInterval. The delay will be 2^N seconds.
  142. Default value 4 results in 16 second interval.
  143. endif # NETUTILS_PTPD_SERVER
  144. if NETUTILS_PTPD_CLIENT
  145. config NETUTILS_PTPD_TIMEOUT_MS
  146. int "PTP client timeout for changing clock source (ms)"
  147. default 60000
  148. help
  149. If no packets are being received from currently chosen clock source,
  150. fall back to next best clock source after this many seconds.
  151. config NETUTILS_PTPD_SETTIME_THRESHOLD_MS
  152. int "PTP client threshold for changing system time (ms)"
  153. default 1000
  154. help
  155. If difference between local and remote clock exceeds this threshold,
  156. time is reset with settimeofday() instead of changing the rate with
  157. adjtime().
  158. # Commented options not used by ESP_PTP
  159. #config NETUTILS_PTPD_MULTICAST_TIMEOUT_MS
  160. # int "PTP client timeout to rejoin multicast group (ms)"
  161. # default 30000 #esp32
  162. # default 0
  163. # help
  164. # If no PTP multicast packets are being received, attempt to rejoin the
  165. # multicast group. This can be necessary if network topology changes, or
  166. # depending on hardware, after some error recovery events.
  167. # Set to 0 to disable.
  168. #config NETUTILS_PTPD_DRIFT_AVERAGE_S
  169. # int "PTP client clock drift rate averaging time (s)"
  170. # default 600
  171. # range 10 86400
  172. # help
  173. # Clock drift rate is averaged over this time pediod. Larger value
  174. # gives more stable estimate but reacts slower to crystal oscillator speed
  175. # changes (such as caused by temperature changes).
  176. config NETUTILS_PTPD_SEND_DELAYREQ
  177. bool "PTP client enable delay requests"
  178. default n
  179. help
  180. If enabled, sends delay request messages to measure the network delay
  181. to server. If disabled, assumes zero delay.
  182. if NETUTILS_PTPD_SEND_DELAYREQ
  183. config NETUTILS_PTPD_MAX_PATH_DELAY_NS
  184. int "PTP client maximum path delay (ns)"
  185. default 100000
  186. range 1 1000000000
  187. help
  188. Measured path delay longer than this is ignored. Delay requests are
  189. also not transmitted until clock synchronization is better than this.
  190. config NETUTILS_PTPD_DELAYREQ_AVGCOUNT
  191. int "PTP client path delay averaging count"
  192. default 100
  193. help
  194. Measured path delay is averaged over this many samples.
  195. config NETUTILS_PTPD_PATH_DELAY_STABILITY_NS
  196. int "PTP client send delay request when clock stability (ns)"
  197. default 250
  198. help
  199. Sends path delay request only once the internal clock is stable and skews only
  200. in defined interval.
  201. endif # NETUTILS_PTPD_SEND_DELAYREQ
  202. endif # NETUTILS_PTPD_CLIENT
  203. endif # NETUTILS_PTPD
  204. endmenu # PTP Daemon Configuration