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

Dependents:   STM32F746_iothub_client_sample_mqtt DISCO-F746NG_Ethernet Nucleo_F746ZG_Ethernet thethingsiO-DISCO_F746NG-mqtt ... more

Committer:
DieterGraef
Date:
Thu Jun 23 09:04:23 2016 +0000
Revision:
1:28ba13dd96f7
Parent:
0:d26c1b55cfca
corrected MAC issue. The MAC is now 02:00:00:xx:xx:xx where xx is the sum over the unique device register

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:d26c1b55cfca 1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DieterGraef 0:d26c1b55cfca 2 // Copyright (c) Microsoft Corporation. All rights reserved.
DieterGraef 0:d26c1b55cfca 3 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DieterGraef 0:d26c1b55cfca 4
DieterGraef 0:d26c1b55cfca 5 #ifndef _DRIVERS_NETWORK_DEFINES_H_
DieterGraef 0:d26c1b55cfca 6 #define _DRIVERS_NETWORK_DEFINES_H_ 1
DieterGraef 0:d26c1b55cfca 7
DieterGraef 0:d26c1b55cfca 8 #define NETWORK_MAX_PACKETSIZE 1514
DieterGraef 0:d26c1b55cfca 9
DieterGraef 0:d26c1b55cfca 10 //--// The Number of packet buffer pools. Each packet buffer pool
DieterGraef 0:d26c1b55cfca 11 //--// contains one or more packet buffers of the same size.
DieterGraef 0:d26c1b55cfca 12
DieterGraef 0:d26c1b55cfca 13 #define NETWORK_MEMORY_POOL_SSL_SIZE__min ( 64*1024)
DieterGraef 0:d26c1b55cfca 14 #define NETWORK_MEMORY_POOL_SSL_SIZE__default (128*1024)
DieterGraef 0:d26c1b55cfca 15 #define NETWORK_MEMORY_POOL_SSL_SIZE__max (256*1024)
DieterGraef 0:d26c1b55cfca 16
DieterGraef 0:d26c1b55cfca 17 #if defined(NETWORK_MEMORY_POOL__INCLUDE_SSL)
DieterGraef 0:d26c1b55cfca 18 #define NETWORK_MEMORY_POOL_SSL_SIZE 1
DieterGraef 0:d26c1b55cfca 19 #else
DieterGraef 0:d26c1b55cfca 20 #define NETWORK_MEMORY_POOL_SSL_SIZE 0
DieterGraef 0:d26c1b55cfca 21 #endif
DieterGraef 0:d26c1b55cfca 22
DieterGraef 0:d26c1b55cfca 23 #define NETWORK_MEMORY_POOL__SIZE__min (( 32*1024) + (NETWORK_MEMORY_POOL_SSL_SIZE * NETWORK_MEMORY_POOL_SSL_SIZE__min))
DieterGraef 0:d26c1b55cfca 24 #define NETWORK_MEMORY_POOL__SIZE__default ((128*1024) + (NETWORK_MEMORY_POOL_SSL_SIZE * NETWORK_MEMORY_POOL_SSL_SIZE__default))
DieterGraef 0:d26c1b55cfca 25 #define NETWORK_MEMORY_POOL__SIZE__max ((256*1024) + (NETWORK_MEMORY_POOL_SSL_SIZE * NETWORK_MEMORY_POOL_SSL_SIZE__max))
DieterGraef 0:d26c1b55cfca 26
DieterGraef 0:d26c1b55cfca 27 #define NETWORK_PACKET_POOL_0__NUM_PACKETS__min 5
DieterGraef 0:d26c1b55cfca 28 #define NETWORK_PACKET_POOL_0__NUM_PACKETS__default 10
DieterGraef 0:d26c1b55cfca 29 #define NETWORK_PACKET_POOL_0__NUM_PACKETS__max 20
DieterGraef 0:d26c1b55cfca 30 #define NETWORK_PACKET_POOL_0__PACKET_SIZE 128
DieterGraef 0:d26c1b55cfca 31
DieterGraef 0:d26c1b55cfca 32 #define NETWORK_PACKET_POOL_1__NUM_PACKETS__min 5
DieterGraef 0:d26c1b55cfca 33 #define NETWORK_PACKET_POOL_1__NUM_PACKETS__default 20
DieterGraef 0:d26c1b55cfca 34 #define NETWORK_PACKET_POOL_1__NUM_PACKETS__max 30
DieterGraef 0:d26c1b55cfca 35 #define NETWORK_PACKET_POOL_1__PACKET_SIZE 256
DieterGraef 0:d26c1b55cfca 36
DieterGraef 0:d26c1b55cfca 37 #define NETWORK_PACKET_POOL_2__NUM_PACKETS__min 5
DieterGraef 0:d26c1b55cfca 38 #define NETWORK_PACKET_POOL_2__NUM_PACKETS__default 10
DieterGraef 0:d26c1b55cfca 39 #define NETWORK_PACKET_POOL_2__NUM_PACKETS__max 30
DieterGraef 0:d26c1b55cfca 40 #define NETWORK_PACKET_POOL_2__PACKET_SIZE 512
DieterGraef 0:d26c1b55cfca 41
DieterGraef 0:d26c1b55cfca 42 #define NETWORK_PACKET_POOL_3__NUM_PACKETS__min 4
DieterGraef 0:d26c1b55cfca 43 #define NETWORK_PACKET_POOL_3__NUM_PACKETS__default 18
DieterGraef 0:d26c1b55cfca 44 #define NETWORK_PACKET_POOL_3__NUM_PACKETS__max 30
DieterGraef 0:d26c1b55cfca 45 #define NETWORK_PACKET_POOL_3__PACKET_SIZE 1514
DieterGraef 0:d26c1b55cfca 46
DieterGraef 0:d26c1b55cfca 47 #define NETWORK_PACKET_POOL_4__NUM_PACKETS__min 4
DieterGraef 0:d26c1b55cfca 48 #define NETWORK_PACKET_POOL_4__NUM_PACKETS__default 15
DieterGraef 0:d26c1b55cfca 49 #define NETWORK_PACKET_POOL_4__NUM_PACKETS__max 40
DieterGraef 0:d26c1b55cfca 50 #define NETWORK_PACKET_POOL_4__PACKET_SIZE 1514
DieterGraef 0:d26c1b55cfca 51
DieterGraef 0:d26c1b55cfca 52 #define NETWORK_PACKET_POOL_5__NUM_PACKETS__min 0
DieterGraef 0:d26c1b55cfca 53 #define NETWORK_PACKET_POOL_5__NUM_PACKETS__default 0
DieterGraef 0:d26c1b55cfca 54 #define NETWORK_PACKET_POOL_5__NUM_PACKETS__max 40
DieterGraef 0:d26c1b55cfca 55 #define NETWORK_PACKET_POOL_5__PACKET_SIZE 0
DieterGraef 0:d26c1b55cfca 56
DieterGraef 0:d26c1b55cfca 57 //--//
DieterGraef 0:d26c1b55cfca 58
DieterGraef 0:d26c1b55cfca 59 #define NETWORK_NUM_IFACES__min 1
DieterGraef 0:d26c1b55cfca 60 #define NETWORK_NUM_IFACES__default 1 // loopback is added if NETWORK_USE_LOOPBACK is defined
DieterGraef 0:d26c1b55cfca 61 #define NETWORK_NUM_IFACES__max 4
DieterGraef 0:d26c1b55cfca 62
DieterGraef 0:d26c1b55cfca 63 #define NETWORK_NUM_DEVICES__min 2 // TODO: WHY ISNT THIS IN THE EBSNET SPREADSHEET?
DieterGraef 0:d26c1b55cfca 64 #define NETWORK_NUM_DEVICES__default 4
DieterGraef 0:d26c1b55cfca 65 #define NETWORK_NUM_DEVICES__max 10
DieterGraef 0:d26c1b55cfca 66
DieterGraef 0:d26c1b55cfca 67 #define NETWORK_MULTICAST_LIST_SIZE__min 2
DieterGraef 0:d26c1b55cfca 68 #define NETWORK_MULTICAST_LIST_SIZE__default 5
DieterGraef 0:d26c1b55cfca 69 #define NETWORK_MULTICAST_LIST_SIZE__max 20
DieterGraef 0:d26c1b55cfca 70
DieterGraef 0:d26c1b55cfca 71 #define NETWORK_ROUTINGTABLE_SIZE__min 5
DieterGraef 0:d26c1b55cfca 72 #define NETWORK_ROUTINGTABLE_SIZE__default 10
DieterGraef 0:d26c1b55cfca 73 #define NETWORK_ROUTINGTABLE_SIZE__max 50
DieterGraef 0:d26c1b55cfca 74
DieterGraef 0:d26c1b55cfca 75 #define NETWORK_ARP_NUM_TABLE_ENTRIES__min 3
DieterGraef 0:d26c1b55cfca 76 #define NETWORK_ARP_NUM_TABLE_ENTRIES__default 5 //CFG_ARPCLEN
DieterGraef 0:d26c1b55cfca 77 #define NETWORK_ARP_NUM_TABLE_ENTRIES__max 50
DieterGraef 0:d26c1b55cfca 78
DieterGraef 0:d26c1b55cfca 79 #define NETWORK_FRAG_TABLE_SIZE__min 2
DieterGraef 0:d26c1b55cfca 80 #define NETWORK_FRAG_TABLE_SIZE__default 6
DieterGraef 0:d26c1b55cfca 81 #define NETWORK_FRAG_TABLE_SIZE__max 10
DieterGraef 0:d26c1b55cfca 82
DieterGraef 0:d26c1b55cfca 83 #define NETWORK_NAT_NUM_ENTRIES__min 5
DieterGraef 0:d26c1b55cfca 84 #define NETWORK_NAT_NUM_ENTRIES__default 25
DieterGraef 0:d26c1b55cfca 85 #define NETWORK_NAT_NUM_ENTRIES__max 40
DieterGraef 0:d26c1b55cfca 86
DieterGraef 0:d26c1b55cfca 87 #define NETWORK_TCP_NUM_PORTS__SUPPORTED__min 16
DieterGraef 0:d26c1b55cfca 88 #define NETWORK_TCP_NUM_PORTS__SUPPORTED__default 64
DieterGraef 0:d26c1b55cfca 89 #define NETWORK_TCP_NUM_PORTS__SUPPORTED__max 128
DieterGraef 0:d26c1b55cfca 90
DieterGraef 0:d26c1b55cfca 91 #define NETWORK_UDP_NUM_PORTS__SUPPORTED__min 6
DieterGraef 0:d26c1b55cfca 92 #define NETWORK_UDP_NUM_PORTS__SUPPORTED__default 64
DieterGraef 0:d26c1b55cfca 93 #define NETWORK_UDP_NUM_PORTS__SUPPORTED__max 128
DieterGraef 0:d26c1b55cfca 94
DieterGraef 0:d26c1b55cfca 95
DieterGraef 0:d26c1b55cfca 96 //--// Configurable timeout parameters
DieterGraef 0:d26c1b55cfca 97
DieterGraef 0:d26c1b55cfca 98 #define NETWORK_DHCP_RETRIES__default 5
DieterGraef 0:d26c1b55cfca 99 #define NETWORK_DHCP_TIMEOUT__default 8
DieterGraef 0:d26c1b55cfca 100
DieterGraef 0:d26c1b55cfca 101 #define NETWORK_IGMPV1_MAX_DELAY__default 10
DieterGraef 0:d26c1b55cfca 102
DieterGraef 0:d26c1b55cfca 103 #define NETWORK_ARP_REQ_TIMEOUT__default 2
DieterGraef 0:d26c1b55cfca 104 #define NETWORK_ARP_MAX_RETRIES__default 4
DieterGraef 0:d26c1b55cfca 105 #define NETWORK_ARP_RES_TIMEOUT__default 600
DieterGraef 0:d26c1b55cfca 106
DieterGraef 0:d26c1b55cfca 107 #define NETWORK_DNS_MIN_DELAY__default 2
DieterGraef 0:d26c1b55cfca 108 #define NETWORK_DNS_MAX_DELAY__default 2
DieterGraef 0:d26c1b55cfca 109 #define NETWORK_DNS_RETRIES__default 2
DieterGraef 0:d26c1b55cfca 110
DieterGraef 0:d26c1b55cfca 111
DieterGraef 0:d26c1b55cfca 112 //--// RAM Profiles
DieterGraef 0:d26c1b55cfca 113
DieterGraef 0:d26c1b55cfca 114 #ifdef NETWORK_MEMORY_PROFILE__small
DieterGraef 0:d26c1b55cfca 115 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_0__NUM_PACKETS NETWORK_PACKET_POOL_0__NUM_PACKETS__min
DieterGraef 0:d26c1b55cfca 116 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_1__NUM_PACKETS NETWORK_PACKET_POOL_1__NUM_PACKETS__min
DieterGraef 0:d26c1b55cfca 117 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_2__NUM_PACKETS NETWORK_PACKET_POOL_2__NUM_PACKETS__min
DieterGraef 0:d26c1b55cfca 118 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_3__NUM_PACKETS NETWORK_PACKET_POOL_3__NUM_PACKETS__min
DieterGraef 0:d26c1b55cfca 119 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_4__NUM_PACKETS NETWORK_PACKET_POOL_4__NUM_PACKETS__min
DieterGraef 0:d26c1b55cfca 120 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_5__NUM_PACKETS NETWORK_PACKET_POOL_5__NUM_PACKETS__min
DieterGraef 0:d26c1b55cfca 121 #define PLATFORM_DEPENDENT__NETWORK_NUM_IFACES NETWORK_NUM_IFACES__min
DieterGraef 0:d26c1b55cfca 122 #define PLATFORM_DEPENDENT__NETWORK_NUM_DEVICES NETWORK_NUM_DEVICES__min
DieterGraef 0:d26c1b55cfca 123 #define PLATFORM_DEPENDENT__NETWORK_MULTICAST_LIST_SIZE NETWORK_MULTICAST_LIST_SIZE__min
DieterGraef 0:d26c1b55cfca 124 #define PLATFORM_DEPENDENT__NETWORK_ROUTINGTABLE_SIZE NETWORK_ROUTINGTABLE_SIZE__min
DieterGraef 0:d26c1b55cfca 125 #define PLATFORM_DEPENDENT__NETWORK_ARP_NUM_TABLE_ENTRIES NETWORK_ARP_NUM_TABLE_ENTRIES__min
DieterGraef 0:d26c1b55cfca 126 #define PLATFORM_DEPENDENT__NETWORK_FRAG_TABLE_SIZE NETWORK_FRAG_TABLE_SIZE__min
DieterGraef 0:d26c1b55cfca 127 #define PLATFORM_DEPENDENT__NETWORK_NAT_NUM_ENTRIES NETWORK_NAT_NUM_ENTRIES__min
DieterGraef 0:d26c1b55cfca 128 #define PLATFORM_DEPENDENT__NETWORK_TCP_NUM_PORTS__SUPPORTED NETWORK_TCP_NUM_PORTS__SUPPORTED__min
DieterGraef 0:d26c1b55cfca 129 #define PLATFORM_DEPENDENT__NETWORK_UDP_NUM_PORTS__SUPPORTED NETWORK_UDP_NUM_PORTS__SUPPORTED__min
DieterGraef 0:d26c1b55cfca 130 #define PLATFORM_DEPENDENT__NETWORK_MEMORY_POOL__SIZE NETWORK_MEMORY_POOL__SIZE__min
DieterGraef 0:d26c1b55cfca 131 #define PLATFORM_DEPENDENT__SOCKETS_MAX_COUNT (PLATFORM_DEPENDENT__NETWORK_TCP_NUM_PORTS__SUPPORTED + PLATFORM_DEPENDENT__NETWORK_UDP_NUM_PORTS__SUPPORTED)
DieterGraef 0:d26c1b55cfca 132 #endif
DieterGraef 0:d26c1b55cfca 133
DieterGraef 0:d26c1b55cfca 134 #ifdef NETWORK_MEMORY_PROFILE__medium
DieterGraef 0:d26c1b55cfca 135 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_0__NUM_PACKETS NETWORK_PACKET_POOL_0__NUM_PACKETS__default
DieterGraef 0:d26c1b55cfca 136 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_1__NUM_PACKETS NETWORK_PACKET_POOL_1__NUM_PACKETS__default
DieterGraef 0:d26c1b55cfca 137 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_2__NUM_PACKETS NETWORK_PACKET_POOL_2__NUM_PACKETS__default
DieterGraef 0:d26c1b55cfca 138 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_3__NUM_PACKETS NETWORK_PACKET_POOL_3__NUM_PACKETS__default
DieterGraef 0:d26c1b55cfca 139 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_4__NUM_PACKETS NETWORK_PACKET_POOL_4__NUM_PACKETS__default
DieterGraef 0:d26c1b55cfca 140 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_5__NUM_PACKETS NETWORK_PACKET_POOL_5__NUM_PACKETS__default
DieterGraef 0:d26c1b55cfca 141 #define PLATFORM_DEPENDENT__NETWORK_NUM_IFACES NETWORK_NUM_IFACES__default
DieterGraef 0:d26c1b55cfca 142 #define PLATFORM_DEPENDENT__NETWORK_NUM_DEVICES NETWORK_NUM_DEVICES__default
DieterGraef 0:d26c1b55cfca 143 #define PLATFORM_DEPENDENT__NETWORK_MULTICAST_LIST_SIZE NETWORK_MULTICAST_LIST_SIZE__default
DieterGraef 0:d26c1b55cfca 144 #define PLATFORM_DEPENDENT__NETWORK_ROUTINGTABLE_SIZE NETWORK_ROUTINGTABLE_SIZE__default
DieterGraef 0:d26c1b55cfca 145 #define PLATFORM_DEPENDENT__NETWORK_ARP_NUM_TABLE_ENTRIES NETWORK_ARP_NUM_TABLE_ENTRIES__default
DieterGraef 0:d26c1b55cfca 146 #define PLATFORM_DEPENDENT__NETWORK_FRAG_TABLE_SIZE NETWORK_FRAG_TABLE_SIZE__default
DieterGraef 0:d26c1b55cfca 147 #define PLATFORM_DEPENDENT__NETWORK_NAT_NUM_ENTRIES NETWORK_NAT_NUM_ENTRIES__default
DieterGraef 0:d26c1b55cfca 148 #define PLATFORM_DEPENDENT__NETWORK_TCP_NUM_PORTS__SUPPORTED NETWORK_TCP_NUM_PORTS__SUPPORTED__default
DieterGraef 0:d26c1b55cfca 149 #define PLATFORM_DEPENDENT__NETWORK_UDP_NUM_PORTS__SUPPORTED NETWORK_UDP_NUM_PORTS__SUPPORTED__default
DieterGraef 0:d26c1b55cfca 150 #define PLATFORM_DEPENDENT__NETWORK_MEMORY_POOL__SIZE NETWORK_MEMORY_POOL__SIZE__default
DieterGraef 0:d26c1b55cfca 151 #define PLATFORM_DEPENDENT__SOCKETS_MAX_COUNT (PLATFORM_DEPENDENT__NETWORK_TCP_NUM_PORTS__SUPPORTED + PLATFORM_DEPENDENT__NETWORK_UDP_NUM_PORTS__SUPPORTED)
DieterGraef 0:d26c1b55cfca 152 #endif
DieterGraef 0:d26c1b55cfca 153
DieterGraef 0:d26c1b55cfca 154 #ifdef NETWORK_MEMORY_PROFILE__large
DieterGraef 0:d26c1b55cfca 155 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_0__NUM_PACKETS NETWORK_PACKET_POOL_0__NUM_PACKETS__max
DieterGraef 0:d26c1b55cfca 156 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_1__NUM_PACKETS NETWORK_PACKET_POOL_1__NUM_PACKETS__max
DieterGraef 0:d26c1b55cfca 157 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_2__NUM_PACKETS NETWORK_PACKET_POOL_2__NUM_PACKETS__max
DieterGraef 0:d26c1b55cfca 158 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_3__NUM_PACKETS NETWORK_PACKET_POOL_3__NUM_PACKETS__max
DieterGraef 0:d26c1b55cfca 159 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_4__NUM_PACKETS NETWORK_PACKET_POOL_4__NUM_PACKETS__max
DieterGraef 0:d26c1b55cfca 160 #define PLATFORM_DEPENDENT__NETWORK_PACKET_POOL_5__NUM_PACKETS NETWORK_PACKET_POOL_5__NUM_PACKETS__max
DieterGraef 0:d26c1b55cfca 161 #define PLATFORM_DEPENDENT__NETWORK_NUM_IFACES NETWORK_NUM_IFACES__max
DieterGraef 0:d26c1b55cfca 162 #define PLATFORM_DEPENDENT__NETWORK_NUM_DEVICES NETWORK_NUM_DEVICES__max
DieterGraef 0:d26c1b55cfca 163 #define PLATFORM_DEPENDENT__NETWORK_MULTICAST_LIST_SIZE NETWORK_MULTICAST_LIST_SIZE__max
DieterGraef 0:d26c1b55cfca 164 #define PLATFORM_DEPENDENT__NETWORK_ROUTINGTABLE_SIZE NETWORK_ROUTINGTABLE_SIZE__max
DieterGraef 0:d26c1b55cfca 165 #define PLATFORM_DEPENDENT__NETWORK_ARP_NUM_TABLE_ENTRIES NETWORK_ARP_NUM_TABLE_ENTRIES__max
DieterGraef 0:d26c1b55cfca 166 #define PLATFORM_DEPENDENT__NETWORK_FRAG_TABLE_SIZE NETWORK_FRAG_TABLE_SIZE__max
DieterGraef 0:d26c1b55cfca 167 #define PLATFORM_DEPENDENT__NETWORK_NAT_NUM_ENTRIES NETWORK_NAT_NUM_ENTRIES__max
DieterGraef 0:d26c1b55cfca 168 #define PLATFORM_DEPENDENT__NETWORK_TCP_NUM_PORTS__SUPPORTED NETWORK_TCP_NUM_PORTS__SUPPORTED__max
DieterGraef 0:d26c1b55cfca 169 #define PLATFORM_DEPENDENT__NETWORK_UDP_NUM_PORTS__SUPPORTED NETWORK_UDP_NUM_PORTS__SUPPORTED__max
DieterGraef 0:d26c1b55cfca 170 #define PLATFORM_DEPENDENT__NETWORK_MEMORY_POOL__SIZE NETWORK_MEMORY_POOL__SIZE__max
DieterGraef 0:d26c1b55cfca 171 #define PLATFORM_DEPENDENT__SOCKETS_MAX_COUNT (PLATFORM_DEPENDENT__NETWORK_TCP_NUM_PORTS__SUPPORTED + PLATFORM_DEPENDENT__NETWORK_UDP_NUM_PORTS__SUPPORTED)
DieterGraef 0:d26c1b55cfca 172 #endif
DieterGraef 0:d26c1b55cfca 173
DieterGraef 0:d26c1b55cfca 174 #endif // _DRIVERS_NETWORK_DEFINES_H_
DieterGraef 0:d26c1b55cfca 175