Ethernet for Nucleo and Disco board STM32F746 works with gcc and arm. IAC is untested

Fork of F7_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sun Jun 19 16:23:40 2016 +0000
Revision:
0:d26c1b55cfca
Ethernet Library for Nucleo stm32f746ZG and Disco stm32f746NG  works under arm and gcc environment

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:d26c1b55cfca 1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DieterGraef 0:d26c1b55cfca 2 // For STM32F746
DieterGraef 0:d26c1b55cfca 3 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DieterGraef 0:d26c1b55cfca 4 #ifndef __LWIPOPTS_H__
DieterGraef 0:d26c1b55cfca 5 #define __LWIPOPTS_H__
DieterGraef 0:d26c1b55cfca 6
DieterGraef 0:d26c1b55cfca 7 #include <limits.h>
DieterGraef 0:d26c1b55cfca 8 #include "stdlib.h"
DieterGraef 0:d26c1b55cfca 9 #include "cmsis_os.h"
DieterGraef 0:d26c1b55cfca 10 #include "stm32f7xx_hal.h"
DieterGraef 0:d26c1b55cfca 11
DieterGraef 0:d26c1b55cfca 12
DieterGraef 0:d26c1b55cfca 13 //Debug Options
DieterGraef 0:d26c1b55cfca 14 #define LWIP_DEBUG
DieterGraef 0:d26c1b55cfca 15 #define SYS_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 16 #define SYSARCH_DEBUG LWIP_DBG_ON
DieterGraef 0:d26c1b55cfca 17 #define NETIF_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 18 #define PPP_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 19 #define IP_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 20 #define MEM_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 21 #define MEMP_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 22 #define PBUF_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 23 #define API_LIB_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 24 #define API_MSG_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 25 #define TCPIP_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 26 #define SOCKETS_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 27 #define TCP_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 28 #define TCP_INPUT_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 29 #define TCP_FR_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 30 #define TCP_RTO_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 31 #define TCP_CWND_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 32 #define TCP_WND_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 33 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 34 #define TCP_RST_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 35 #define TCP_QLEN_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 36 #define ETHARP_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 37 #define DHCP_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 38 #define SNMP_MSG_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 39 #define SNMP_MIB_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 40 #define DNS_DEBUG LWIP_DBG_OFF
DieterGraef 0:d26c1b55cfca 41
DieterGraef 0:d26c1b55cfca 42 #define SYS_LIGHTWEIGHT_PROT 1
DieterGraef 0:d26c1b55cfca 43 #define ETHARP_TRUST_IP_MAC 0
DieterGraef 0:d26c1b55cfca 44 #define IP_REASSEMBLY 0
DieterGraef 0:d26c1b55cfca 45 #define IP_FRAG 0
DieterGraef 0:d26c1b55cfca 46 #define ARP_QUEUEING 0
DieterGraef 0:d26c1b55cfca 47 #define ETH_PAD_SIZE 0
DieterGraef 0:d26c1b55cfca 48
DieterGraef 0:d26c1b55cfca 49 #define MTU 1500 // Maximum transfer unit
DieterGraef 0:d26c1b55cfca 50 #define TCPIP_MBOX_SIZE 8
DieterGraef 0:d26c1b55cfca 51 #define DEFAULT_TCP_RECVMBOX_SIZE 8
DieterGraef 0:d26c1b55cfca 52 #define DEFAULT_UDP_RECVMBOX_SIZE 8
DieterGraef 0:d26c1b55cfca 53 #define DEFAULT_RAW_RECVMBOX_SIZE 8
DieterGraef 0:d26c1b55cfca 54 #define DEFAULT_ACCEPTMBOX_SIZE 8
DieterGraef 0:d26c1b55cfca 55 #define LOCK_RX_THREAD
DieterGraef 0:d26c1b55cfca 56 #define LWIP_TCPIP_CORE_LOCKING 0
DieterGraef 0:d26c1b55cfca 57 #define LWIP_TCPIP_CORE_LOCKING_INPUT 0
DieterGraef 0:d26c1b55cfca 58 #define LWIP_CHECKSUM_ON_COPY 1
DieterGraef 0:d26c1b55cfca 59 #define EMAC_RECIVE_THREAD_STACKSIZE 1536
DieterGraef 0:d26c1b55cfca 60 #define DEFAULT_THREAD_STACKSIZE 512
DieterGraef 0:d26c1b55cfca 61 #define TCPIP_THREAD_STACKSIZE 1536
DieterGraef 0:d26c1b55cfca 62 #define TCPIP_THREAD_PRIO (osPriorityNormal)
DieterGraef 0:d26c1b55cfca 63
DieterGraef 0:d26c1b55cfca 64 #define LWIP_EVENT_API 0
DieterGraef 0:d26c1b55cfca 65 #define LWIP_CALLBACK_API 1
DieterGraef 0:d26c1b55cfca 66
DieterGraef 0:d26c1b55cfca 67 #define ERRNO 1
DieterGraef 0:d26c1b55cfca 68 #define NO_SYS 0
DieterGraef 0:d26c1b55cfca 69 #define MEM_ALIGNMENT 4
DieterGraef 0:d26c1b55cfca 70
DieterGraef 0:d26c1b55cfca 71 #define PBUF_POOL_BUFSIZE 1524
DieterGraef 0:d26c1b55cfca 72
DieterGraef 0:d26c1b55cfca 73
DieterGraef 0:d26c1b55cfca 74 #define MEM_SIZE (24*1024)
DieterGraef 0:d26c1b55cfca 75 #define MEMP_NUM_PBUF 50
DieterGraef 0:d26c1b55cfca 76 #define MEMP_NUM_UDP_PCB 10
DieterGraef 0:d26c1b55cfca 77 #define MEMP_NUM_TCP_PCB 20
DieterGraef 0:d26c1b55cfca 78 #define MEMP_NUM_TCP_PCB_LISTEN 20
DieterGraef 0:d26c1b55cfca 79 #define MEMP_NUM_TCP_SEG 12
DieterGraef 0:d26c1b55cfca 80 #define MEMP_NUM_SYS_TIMEOUT 10
DieterGraef 0:d26c1b55cfca 81 #define MEMP_NUM_NETBUF 4
DieterGraef 0:d26c1b55cfca 82 #define MEMP_NUM_NETCONN 10
DieterGraef 0:d26c1b55cfca 83 #define PBUF_POOL_SIZE 10
DieterGraef 0:d26c1b55cfca 84
DieterGraef 0:d26c1b55cfca 85
DieterGraef 0:d26c1b55cfca 86
DieterGraef 0:d26c1b55cfca 87 #define TCP_TTL 255
DieterGraef 0:d26c1b55cfca 88 #define TCP_QUEUE_OOSEQ 0
DieterGraef 0:d26c1b55cfca 89 #define TCP_MIN_SEGLEN (MTU - 40)
DieterGraef 0:d26c1b55cfca 90 #define TCP_MSS (MTU - 40)
DieterGraef 0:d26c1b55cfca 91 #define TCP_SND_BUF (4*TCP_MSS)
DieterGraef 0:d26c1b55cfca 92 #define TCP_SND_QUEUELEN (2*TCP_SND_BUF/TCP_MSS)
DieterGraef 0:d26c1b55cfca 93 #define TCP_WND (2 * TCP_MSS)
DieterGraef 0:d26c1b55cfca 94 #define TCP_SNDLOWAT (TCP_SND_BUF/2)
DieterGraef 0:d26c1b55cfca 95
DieterGraef 0:d26c1b55cfca 96
DieterGraef 0:d26c1b55cfca 97 #define LWIP_RAW 0
DieterGraef 0:d26c1b55cfca 98 #define TCPIP_LWIP 1
DieterGraef 0:d26c1b55cfca 99 #define LWIP_NETIF_API 1
DieterGraef 0:d26c1b55cfca 100 #define LWIP_DHCP 1
DieterGraef 0:d26c1b55cfca 101 #define LWIP_TCP 1
DieterGraef 0:d26c1b55cfca 102 #define LWIP_UDP 1
DieterGraef 0:d26c1b55cfca 103 #define LWIP_DNS 1
DieterGraef 0:d26c1b55cfca 104 #define LWIP_ICMP 1
DieterGraef 0:d26c1b55cfca 105 #define LWIP_IGMP 1
DieterGraef 0:d26c1b55cfca 106 #define LWIP_ARP 1
DieterGraef 0:d26c1b55cfca 107 #define LWIP_AUTOIP 0
DieterGraef 0:d26c1b55cfca 108 #define LWIP_SNMP 0
DieterGraef 0:d26c1b55cfca 109 #define LWIP_NETBIOS 1
DieterGraef 0:d26c1b55cfca 110 #define NETBIOS_LWIP_NAME ("STM32F746")
DieterGraef 0:d26c1b55cfca 111 #define LWIP_NETIF_HOSTNAME 1
DieterGraef 0:d26c1b55cfca 112 #define NETIF_HOSTNAME ("STM32F746")
DieterGraef 0:d26c1b55cfca 113 #define LWIP_NETIF_LOOPBACK 1
DieterGraef 0:d26c1b55cfca 114 #define LWIP_HAVE_LOOPIF 1
DieterGraef 0:d26c1b55cfca 115
DieterGraef 0:d26c1b55cfca 116 #define LWIP_NETIF_LINK_CALLBACK 1
DieterGraef 0:d26c1b55cfca 117 #define LWIP_NETIF_STATUS_CALLBACK 1
DieterGraef 0:d26c1b55cfca 118
DieterGraef 0:d26c1b55cfca 119 #define LWIP_SO_RCVBUF 0
DieterGraef 0:d26c1b55cfca 120
DieterGraef 0:d26c1b55cfca 121 #define LWIP_RAND rand
DieterGraef 0:d26c1b55cfca 122
DieterGraef 0:d26c1b55cfca 123 #ifdef DEBUG
DieterGraef 0:d26c1b55cfca 124 #define DHCP_CREATE_RAND_XID 0
DieterGraef 0:d26c1b55cfca 125 #endif
DieterGraef 0:d26c1b55cfca 126
DieterGraef 0:d26c1b55cfca 127 // Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing
DieterGraef 0:d26c1b55cfca 128 #define TCP_KEEPIDLE_DEFAULT 10000UL // Default KEEPALIVE timer in milliseconds
DieterGraef 0:d26c1b55cfca 129 #define TCP_KEEPINTVL_DEFAULT 2000UL // Default Time between KEEPALIVE probes in milliseconds
DieterGraef 0:d26c1b55cfca 130 #define TCP_KEEPCNT_DEFAULT 9U // Default Counter for KEEPALIVE probes
DieterGraef 0:d26c1b55cfca 131
DieterGraef 0:d26c1b55cfca 132 #define CHECKSUM_BY_HARDWARE
DieterGraef 0:d26c1b55cfca 133 #ifdef CHECKSUM_BY_HARDWARE
DieterGraef 0:d26c1b55cfca 134 /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/
DieterGraef 0:d26c1b55cfca 135 #define CHECKSUM_GEN_IP 0
DieterGraef 0:d26c1b55cfca 136 /* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/
DieterGraef 0:d26c1b55cfca 137 #define CHECKSUM_GEN_UDP 0
DieterGraef 0:d26c1b55cfca 138 /* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/
DieterGraef 0:d26c1b55cfca 139 #define CHECKSUM_GEN_TCP 0
DieterGraef 0:d26c1b55cfca 140 /* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/
DieterGraef 0:d26c1b55cfca 141 #define CHECKSUM_CHECK_IP 0
DieterGraef 0:d26c1b55cfca 142 /* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/
DieterGraef 0:d26c1b55cfca 143 #define CHECKSUM_CHECK_UDP 0
DieterGraef 0:d26c1b55cfca 144 /* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/
DieterGraef 0:d26c1b55cfca 145 #define CHECKSUM_CHECK_TCP 0
DieterGraef 0:d26c1b55cfca 146 /* CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.*/
DieterGraef 0:d26c1b55cfca 147 #define CHECKSUM_GEN_ICMP 0
DieterGraef 0:d26c1b55cfca 148 #else
DieterGraef 0:d26c1b55cfca 149 /* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/
DieterGraef 0:d26c1b55cfca 150 #define CHECKSUM_GEN_IP 1
DieterGraef 0:d26c1b55cfca 151 /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/
DieterGraef 0:d26c1b55cfca 152 #define CHECKSUM_GEN_UDP 1
DieterGraef 0:d26c1b55cfca 153 /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/
DieterGraef 0:d26c1b55cfca 154 #define CHECKSUM_GEN_TCP 1
DieterGraef 0:d26c1b55cfca 155 /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/
DieterGraef 0:d26c1b55cfca 156 #define CHECKSUM_CHECK_IP 1
DieterGraef 0:d26c1b55cfca 157 /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/
DieterGraef 0:d26c1b55cfca 158 #define CHECKSUM_CHECK_UDP 1
DieterGraef 0:d26c1b55cfca 159 /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/
DieterGraef 0:d26c1b55cfca 160 #define CHECKSUM_CHECK_TCP 1
DieterGraef 0:d26c1b55cfca 161 /* CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.*/
DieterGraef 0:d26c1b55cfca 162 #define CHECKSUM_GEN_ICMP 1
DieterGraef 0:d26c1b55cfca 163 #endif
DieterGraef 0:d26c1b55cfca 164
DieterGraef 0:d26c1b55cfca 165
DieterGraef 0:d26c1b55cfca 166
DieterGraef 0:d26c1b55cfca 167 #endif /* __LWIPOPTS_H__ */