You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
7.4 KiB

2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * File Name : lwipopts.h
  5. * Description : This file overrides LwIP stack default configuration
  6. * done in opt.h file.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2023 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Define to prevent recursive inclusion --------------------------------------*/
  21. #ifndef __LWIPOPTS__H__
  22. #define __LWIPOPTS__H__
  23. #include "main.h"
  24. /*-----------------------------------------------------------------------------*/
  25. /* Current version of LwIP supported by CubeMx: 2.1.2 -*/
  26. /*-----------------------------------------------------------------------------*/
  27. /* Within 'USER CODE' section, code will be kept by default at each generation */
  28. /* USER CODE BEGIN 0 */
  29. /* USER CODE END 0 */
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /* STM32CubeMX Specific Parameters (not defined in opt.h) ---------------------*/
  34. /* Parameters set in STM32CubeMX LwIP Configuration GUI -*/
  35. /*----- WITH_RTOS enabled (Since FREERTOS is set) -----*/
  36. #define WITH_RTOS 1
  37. /* Temporary workaround to avoid conflict on errno defined in STM32CubeIDE and lwip sys_arch.c errno */
  38. #undef LWIP_PROVIDE_ERRNO
  39. /*----- CHECKSUM_BY_HARDWARE enabled -----*/
  40. #define CHECKSUM_BY_HARDWARE 1
  41. /*-----------------------------------------------------------------------------*/
  42. /* LwIP Stack Parameters (modified compared to initialization value in opt.h) -*/
  43. /* Parameters set in STM32CubeMX LwIP Configuration GUI -*/
  44. /*----- Value in opt.h for LWIP_DHCP: 0 -----*/
  45. #define LWIP_DHCP 1
  46. /*----- Value in opt.h for LWIP_TCP: 1 -----*/
  47. #define LWIP_TCP 0
  48. /*----- Value in opt.h for MEM_ALIGNMENT: 1 -----*/
  49. #define MEM_ALIGNMENT 4
  50. /*----- Default Value for MEM_SIZE: 1600 ---*/
  51. #define MEM_SIZE 3200
  52. /*----- Value in opt.h for MEMP_NUM_SYS_TIMEOUT: (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (PPP_SUPPORT*6*MEMP_NUM_PPP_PCB) + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0)) -*/
  53. #define MEMP_NUM_SYS_TIMEOUT 5
  54. /*----- Value in opt.h for LWIP_ETHERNET: LWIP_ARP || PPPOE_SUPPORT -*/
  55. #define LWIP_ETHERNET 1
  56. /*----- Default Value for LWIP_AUTOIP: 0 ---*/
  57. #define LWIP_AUTOIP 1
  58. /*----- Default Value for LWIP_DHCP_AUTOIP_COOP: 0 ---*/
  59. #define LWIP_DHCP_AUTOIP_COOP 1
  60. /*----- Default Value for LWIP_DHCP_AUTOIP_COOP_TRIES: 9 ---*/
  61. #define LWIP_DHCP_AUTOIP_COOP_TRIES 0
  62. /*----- Value in opt.h for LWIP_DNS_SECURE: (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) -*/
  63. #define LWIP_DNS_SECURE 7
  64. /*----- Value in opt.h for TCP_SND_QUEUELEN: (4*TCP_SND_BUF + (TCP_MSS - 1))/TCP_MSS -----*/
  65. #define TCP_SND_QUEUELEN 9
  66. /*----- Value in opt.h for TCP_SNDLOWAT: LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) -*/
  67. #define TCP_SNDLOWAT 1071
  68. /*----- Value in opt.h for TCP_SNDQUEUELOWAT: LWIP_MAX(TCP_SND_QUEUELEN)/2, 5) -*/
  69. #define TCP_SNDQUEUELOWAT 5
  70. /*----- Value in opt.h for TCP_WND_UPDATE_THRESHOLD: LWIP_MIN(TCP_WND/4, TCP_MSS*4) -----*/
  71. #define TCP_WND_UPDATE_THRESHOLD 536
  72. /*----- Default Value for LWIP_NETIF_HOSTNAME: 0 ---*/
  73. #define LWIP_NETIF_HOSTNAME 1
  74. /*----- Default Value for LWIP_NETIF_STATUS_CALLBACK: 0 ---*/
  75. #define LWIP_NETIF_STATUS_CALLBACK 1
  76. /*----- Default Value for LWIP_NETIF_EXT_STATUS_CALLBACK: 0 ---*/
  77. #define LWIP_NETIF_EXT_STATUS_CALLBACK 1
  78. /*----- Value in opt.h for LWIP_NETIF_LINK_CALLBACK: 0 -----*/
  79. #define LWIP_NETIF_LINK_CALLBACK 1
  80. /*----- Value in opt.h for TCPIP_THREAD_STACKSIZE: 0 -----*/
  81. #define TCPIP_THREAD_STACKSIZE 1024
  82. /*----- Value in opt.h for TCPIP_THREAD_PRIO: 1 -----*/
  83. #define TCPIP_THREAD_PRIO osPriorityNormal
  84. /*----- Value in opt.h for TCPIP_MBOX_SIZE: 0 -----*/
  85. #define TCPIP_MBOX_SIZE 6
  86. /*----- Value in opt.h for SLIPIF_THREAD_STACKSIZE: 0 -----*/
  87. #define SLIPIF_THREAD_STACKSIZE 1024
  88. /*----- Value in opt.h for SLIPIF_THREAD_PRIO: 1 -----*/
  89. #define SLIPIF_THREAD_PRIO 3
  90. /*----- Value in opt.h for DEFAULT_THREAD_STACKSIZE: 0 -----*/
  91. #define DEFAULT_THREAD_STACKSIZE 1024
  92. /*----- Value in opt.h for DEFAULT_THREAD_PRIO: 1 -----*/
  93. #define DEFAULT_THREAD_PRIO 3
  94. /*----- Value in opt.h for DEFAULT_UDP_RECVMBOX_SIZE: 0 -----*/
  95. #define DEFAULT_UDP_RECVMBOX_SIZE 6
  96. /*----- Value in opt.h for DEFAULT_ACCEPTMBOX_SIZE: 0 -----*/
  97. #define DEFAULT_ACCEPTMBOX_SIZE 6
  98. /*----- Default Value for LWIP_SO_SNDTIMEO: 0 ---*/
  99. #define LWIP_SO_SNDTIMEO 1
  100. /*----- Default Value for LWIP_SO_RCVTIMEO: 0 ---*/
  101. #define LWIP_SO_RCVTIMEO 1
  102. /*----- Value in opt.h for RECV_BUFSIZE_DEFAULT: INT_MAX -----*/
  103. #define RECV_BUFSIZE_DEFAULT 2000000000
  104. /*----- Value in opt.h for LWIP_STATS: 1 -----*/
  105. #define LWIP_STATS 0
  106. /*----- Value in opt.h for CHECKSUM_GEN_IP: 1 -----*/
  107. #define CHECKSUM_GEN_IP 0
  108. /*----- Value in opt.h for CHECKSUM_GEN_UDP: 1 -----*/
  109. #define CHECKSUM_GEN_UDP 0
  110. /*----- Value in opt.h for CHECKSUM_GEN_TCP: 1 -----*/
  111. #define CHECKSUM_GEN_TCP 0
  112. /*----- Value in opt.h for CHECKSUM_GEN_ICMP: 1 -----*/
  113. #define CHECKSUM_GEN_ICMP 0
  114. /*----- Value in opt.h for CHECKSUM_GEN_ICMP6: 1 -----*/
  115. #define CHECKSUM_GEN_ICMP6 0
  116. /*----- Value in opt.h for CHECKSUM_CHECK_IP: 1 -----*/
  117. #define CHECKSUM_CHECK_IP 0
  118. /*----- Value in opt.h for CHECKSUM_CHECK_UDP: 1 -----*/
  119. #define CHECKSUM_CHECK_UDP 0
  120. /*----- Value in opt.h for CHECKSUM_CHECK_TCP: 1 -----*/
  121. #define CHECKSUM_CHECK_TCP 0
  122. /*----- Value in opt.h for CHECKSUM_CHECK_ICMP: 1 -----*/
  123. #define CHECKSUM_CHECK_ICMP 0
  124. /*----- Value in opt.h for CHECKSUM_CHECK_ICMP6: 1 -----*/
  125. #define CHECKSUM_CHECK_ICMP6 0
  126. /*-----------------------------------------------------------------------------*/
  127. /* USER CODE BEGIN 1 */
  128. // #define LWIP_DEBUG
  129. #define LWIP_IPV6_SCOPES_DEBUG LWIP_DBG_ON
  130. #define ETHARP_DEBUG LWIP_DBG_ON
  131. #define NETIF_DEBUG LWIP_DBG_ON
  132. #define PBUF_DEBUG LWIP_DBG_ON
  133. #define API_LIB_DEBUG LWIP_DBG_ON
  134. #define API_MSG_DEBUG LWIP_DBG_ON
  135. #define SOCKETS_DEBUG LWIP_DBG_ON
  136. #define ICMP_DEBUG LWIP_DBG_ON
  137. #define IGMP_DEBUG LWIP_DBG_ON
  138. #define INET_DEBUG LWIP_DBG_ON
  139. #define IP_DEBUG LWIP_DBG_ON
  140. #define IP_REASS_DEBUG LWIP_DBG_ON
  141. #define RAW_DEBUG LWIP_DBG_ON
  142. #define MEM_DEBUG LWIP_DBG_ON
  143. #define MEMP_DEBUG LWIP_DBG_ON
  144. #define SYS_DEBUG LWIP_DBG_ON
  145. #define TIMERS_DEBUG LWIP_DBG_ON
  146. #define TCP_DEBUG LWIP_DBG_ON
  147. #define TCP_INPUT_DEBUG LWIP_DBG_ON
  148. #define TCP_FR_DEBUG LWIP_DBG_ON
  149. #define TCP_RTO_DEBUG LWIP_DBG_ON
  150. #define TCP_CWND_DEBUG LWIP_DBG_ON
  151. #define TCP_WND_DEBUG LWIP_DBG_ON
  152. #define TCP_OUTPUT_DEBUG LWIP_DBG_ON
  153. #define TCP_RST_DEBUG LWIP_DBG_ON
  154. #define TCP_QLEN_DEBUG LWIP_DBG_ON
  155. #define UDP_DEBUG LWIP_DBG_ON
  156. #define TCPIP_DEBUG LWIP_DBG_ON
  157. #define SLIP_DEBUG LWIP_DBG_ON
  158. #define DHCP_DEBUG LWIP_DBG_ON
  159. #define AUTOIP_DEBUG LWIP_DBG_ON
  160. #define DNS_DEBUG LWIP_DBG_ON
  161. #define IP6_DEBUG LWIP_DBG_ON
  162. #define DHCP6_DEBUG LWIP_DBG_ON
  163. /* USER CODE END 1 */
  164. #ifdef __cplusplus
  165. }
  166. #endif
  167. #endif /*__LWIPOPTS__H__ */