160 lines
6.3 KiB
C
160 lines
6.3 KiB
C
|
|
/**
|
|
******************************************************************************
|
|
* File Name : lwipopts.h
|
|
* Description : This file overrides LwIP stack default configuration
|
|
* done in opt.h file.
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
|
* All rights reserved.</center></h2>
|
|
*
|
|
* This software component is licensed by ST under Ultimate Liberty license
|
|
* SLA0044, the "License"; You may not use this file except in compliance with
|
|
* the License. You may obtain a copy of the License at:
|
|
* www.st.com/SLA0044
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
|
|
/* Define to prevent recursive inclusion --------------------------------------*/
|
|
#ifndef __LWIPOPTS__H__
|
|
#define __LWIPOPTS__H__
|
|
|
|
#include "main.h"
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
/* Current version of LwIP supported by CubeMx: 2.0.3 -*/
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/* Within 'USER CODE' section, code will be kept by default at each generation */
|
|
/* USER CODE BEGIN 0 */
|
|
|
|
/* USER CODE END 0 */
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* STM32CubeMX Specific Parameters (not defined in opt.h) ---------------------*/
|
|
/* Parameters set in STM32CubeMX LwIP Configuration GUI -*/
|
|
/*----- WITH_RTOS enabled (Since FREERTOS is set) -----*/
|
|
#define WITH_RTOS 1
|
|
/*----- CHECKSUM_BY_HARDWARE disabled -----*/
|
|
#define CHECKSUM_BY_HARDWARE 1 //_USE_RVL_ 启用硬件校验
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/* LwIP Stack Parameters (modified compared to initialization value in opt.h) -*/
|
|
/* Parameters set in STM32CubeMX LwIP Configuration GUI -*/
|
|
/*----- Value in opt.h for MEM_ALIGNMENT: 1 -----*/
|
|
#define MEM_ALIGNMENT 4
|
|
/*----- Value in opt.h for LWIP_ETHERNET: LWIP_ARP || PPPOE_SUPPORT -*/
|
|
#define LWIP_ETHERNET 1
|
|
/*----- 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) -*/
|
|
#define LWIP_DNS_SECURE 7
|
|
/*----- Value in opt.h for TCP_SND_QUEUELEN: (4*TCP_SND_BUF + (TCP_MSS - 1))/TCP_MSS -----*/
|
|
#define TCP_SND_QUEUELEN 9//MEMP_NUM_TCP_SEG 9 --- 5
|
|
/*----- Value in opt.h for TCP_SNDLOWAT: LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) -*/
|
|
#define TCP_SNDLOWAT 1071
|
|
/*----- Value in opt.h for TCP_SNDQUEUELOWAT: LWIP_MAX(TCP_SND_QUEUELEN)/2, 5) -*/
|
|
#define TCP_SNDQUEUELOWAT 5
|
|
/*----- Value in opt.h for TCP_WND_UPDATE_THRESHOLD: LWIP_MIN(TCP_WND/4, TCP_MSS*4) -----*/
|
|
#define TCP_WND_UPDATE_THRESHOLD 536
|
|
/*----- Value in opt.h for TCPIP_THREAD_STACKSIZE: 0 -----*/
|
|
#define TCPIP_THREAD_STACKSIZE 1024
|
|
/*----- Value in opt.h for TCPIP_THREAD_PRIO: 1 -----*/
|
|
#define TCPIP_THREAD_PRIO 3
|
|
/*----- Value in opt.h for TCPIP_MBOX_SIZE: 0 -----*/
|
|
#define TCPIP_MBOX_SIZE 6
|
|
/*----- Value in opt.h for SLIPIF_THREAD_STACKSIZE: 0 -----*/
|
|
#define SLIPIF_THREAD_STACKSIZE 1024
|
|
/*----- Value in opt.h for SLIPIF_THREAD_PRIO: 1 -----*/
|
|
#define SLIPIF_THREAD_PRIO 3
|
|
/*----- Value in opt.h for DEFAULT_THREAD_STACKSIZE: 0 -----*/
|
|
#define DEFAULT_THREAD_STACKSIZE 1024
|
|
/*----- Value in opt.h for DEFAULT_THREAD_PRIO: 1 -----*/
|
|
#define DEFAULT_THREAD_PRIO 3
|
|
/*----- Value in opt.h for DEFAULT_UDP_RECVMBOX_SIZE: 0 -----*/
|
|
#define DEFAULT_UDP_RECVMBOX_SIZE 6
|
|
/*----- Value in opt.h for DEFAULT_TCP_RECVMBOX_SIZE: 0 -----*/
|
|
#define DEFAULT_TCP_RECVMBOX_SIZE 6
|
|
/*----- Value in opt.h for DEFAULT_ACCEPTMBOX_SIZE: 0 -----*/
|
|
#define DEFAULT_ACCEPTMBOX_SIZE 6
|
|
/*----- Value in opt.h for RECV_BUFSIZE_DEFAULT: INT_MAX -----*/
|
|
#define RECV_BUFSIZE_DEFAULT 2000000000
|
|
/*----- Value in opt.h for LWIP_STATS: 1 -----*/
|
|
#define LWIP_STATS 1
|
|
/*----- Value in opt.h for CHECKSUM_GEN_IP: 1 -----*/
|
|
#define CHECKSUM_GEN_IP 1
|
|
/*----- Value in opt.h for CHECKSUM_GEN_UDP: 1 -----*/
|
|
#define CHECKSUM_GEN_UDP 1
|
|
/*----- Value in opt.h for CHECKSUM_GEN_TCP: 1 -----*/
|
|
#define CHECKSUM_GEN_TCP 1
|
|
/*----- Value in opt.h for CHECKSUM_GEN_ICMP: 1 -----*/
|
|
#define CHECKSUM_GEN_ICMP 0
|
|
/*----- Value in opt.h for CHECKSUM_GEN_ICMP6: 1 -----*/
|
|
#define CHECKSUM_GEN_ICMP6 0
|
|
/*----- Value in opt.h for CHECKSUM_CHECK_IP: 1 -----*/
|
|
#define CHECKSUM_CHECK_IP 1
|
|
/*----- Value in opt.h for CHECKSUM_CHECK_UDP: 1 -----*/
|
|
#define CHECKSUM_CHECK_UDP 1
|
|
/*----- Value in opt.h for CHECKSUM_CHECK_TCP: 1 -----*/
|
|
#define CHECKSUM_CHECK_TCP 1
|
|
/*----- Value in opt.h for CHECKSUM_CHECK_ICMP: 1 -----*/
|
|
#define CHECKSUM_CHECK_ICMP 0
|
|
/*----- Value in opt.h for CHECKSUM_CHECK_ICMP6: 1 -----*/
|
|
#define CHECKSUM_CHECK_ICMP6 0
|
|
/*-----------------------------------------------------------------------------*/
|
|
/* USER CODE BEGIN 1 */
|
|
|
|
/* TCP Maximum segment size. */
|
|
#define TCP_MSS (1500 - 40) /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */
|
|
|
|
/* MEM_SIZE: the size of the heap memory. If the application will send
|
|
a lot of data that needs to be copied, this should be set high. */
|
|
#define MEM_SIZE (5*1024)
|
|
|
|
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
|
|
sends a lot of data out of ROM (or other static memory), this
|
|
should be set high. */
|
|
#define MEMP_NUM_PBUF 100
|
|
|
|
/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
|
|
per active UDP "connection". */
|
|
#define MEMP_NUM_UDP_PCB 6
|
|
|
|
/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
|
|
connections. */
|
|
#define MEMP_NUM_TCP_PCB 50
|
|
|
|
#define MEMP_NUM_TCP_PCB_LISTEN 50
|
|
/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
|
|
segments. */
|
|
|
|
/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
|
|
segments. */
|
|
|
|
#define MEMP_NUM_TCP_SEG 20 //MEMP_NUM_TCP_SEG 20 测试现改为10
|
|
|
|
/* ---------- DHCP options ---------- */
|
|
/* Define LWIP_DHCP to 1 if you want DHCP configuration of
|
|
interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
|
|
turning this on does currently not work. */
|
|
#define LWIP_DHCP 1
|
|
|
|
/* ---------- Statistics options ---------- */
|
|
#define LWIP_SNMP 1
|
|
#define SNMP_PRIVATE_MIB 1
|
|
|
|
|
|
|
|
/* USER CODE END 1 */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /*__LWIPOPTS__H__ */
|
|
|
|
/************************* (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|