48k -> 20k RAM

This commit is contained in:
2025-11-09 13:00:16 +06:00
parent 5445c27271
commit a0ca17e68f
2 changed files with 33 additions and 42 deletions

View File

@@ -13,7 +13,7 @@
#define IFNAME0 'e'
#define IFNAME1 'n'
#define ETH_RX_BUF_COUNT 4
#define ETH_RX_BUF_COUNT 2
#define ETH_TX_BUF_COUNT 2
/* buf size should be at least ETH_MAX_PACKET_SIZE */
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE

View File

@@ -11,59 +11,50 @@
// #define ETHARP_DEBUG LWIP_DBG_ON
#define NO_SYS 1
// Core locking
#define SYS_LIGHTWEIGHT_PROT 0
// Memory options
#define MEM_ALIGNMENT 4
#define MEM_SIZE (10 * 1024) // 4KB of RAM for lwIP heap
// Pbuf options
#define PBUF_POOL_SIZE 24 // Enough for bursts
#define PBUF_POOL_BUFSIZE 600 // ~500 byte typical packet + header
// TCP options
#define LWIP_TCP 1
#define TCP_MSS 1460
#define TCP_SND_BUF (2 * TCP_MSS)
// UDP options
#define LWIP_UDP 1
// ICMP options
#define LWIP_ICMP 1
// DHCP options
#define LWIP_DHCP 1
// Checksum options
// #define CHECKSUM_GEN_IP 0
// #define CHECKSUM_GEN_UDP 0
// #define CHECKSUM_GEN_TCP 0
// #define CHECKSUM_CHECK_IP 0
#define CHECKSUM_CHECK_UDP 0
// #define CHECKSUM_CHECK_TCP 0
// #define LWIP_CHECKSUM_ON_COPY 1
#define LWIP_NETCONN 0
#define LWIP_SOCKET 0
// Statistics
#define LWIP_STATS 1
#define LINK_STATS 1
// #define MIB2_STATS 1
// Memory options
#define MEM_ALIGNMENT 4
#define MEM_SIZE (4 * 1024)
// Pbuf options
#define PBUF_POOL_SIZE 4
#define PBUF_POOL_BUFSIZE 1524
#define MEMP_NUM_PBUF 8 // default 16
// TCP options
#define LWIP_TCP 1
#define TCP_MSS 536
#define TCP_SND_BUF (2 * TCP_MSS)
#define TCP_WND (2 * TCP_MSS)
#define TCP_QUEUE_OOSEQ 0
#define LWIP_UDP 1
#define MEMP_NUM_UDP_PCB 2 // # of concurrent UDP "connections"
#define LWIP_ICMP 1
#define LWIP_DHCP 1
#define LWIP_HTTPD 1
// Use a read-only filesystem populated by makefsdata
// #define HTTPD_FSDATA_FILE "fsdata_custom.c"
#define LWIP_HTTPD_FS_SUPPORT 1
#define HTTPD_USE_CUSTOM_FSDATA 1
#define LWIP_NETIF_HOSTNAME 1
#define LWIP_NETIF_LINK_CALLBACK 1
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_SUPPORT_CUSTOM_PBUF 1 // for zero-copy
#define LWIP_SUPPORT_CUSTOM_PBUF 1
#define CHECKSUM_GEN_IP 1
#define CHECKSUM_GEN_UDP 1
#define CHECKSUM_GEN_TCP 1
#define CHECKSUM_CHECK_IP 1
#define CHECKSUM_CHECK_UDP 1
#define CHECKSUM_CHECK_TCP 1
#define LWIP_CHECKSUM_ON_COPY 0
#define LWIP_STATS 1
#define LINK_STATS 1
#endif /* __LWIPOPTS_H__ */