Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 318b092

Browse files
committed
Merge branch 'feature/update_lwip_component_from_idf' into 'master'
Feature/update lcomponent from idf See merge request sdk/ESP8266_RTOS_SDK!1227
2 parents 03ed8ad + b89d8a7 commit 318b092

File tree

408 files changed

+5247
-128246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+5247
-128246
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
[submodule "components/mbedtls/mbedtls"]
66
path = components/mbedtls/mbedtls
77
url = ../../espressif/mbedtls.git
8+
9+
[submodule "components/lwip/lwip"]
10+
path = components/lwip/lwip
11+
url = ../../espressif/esp-lwip.git

components/coap/port/coap_io_socket.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ coap_free_endpoint(coap_endpoint_t *ep) {
217217
/* define struct in6_pktinfo and struct in_pktinfo if not available
218218
FIXME: check with configure
219219
*/
220+
#if 0 //update lwip and have conflict. Later will update COAP.
220221
struct in6_pktinfo {
221222
struct in6_addr ipi6_addr; /* src/dst IPv6 address */
222223
unsigned int ipi6_ifindex; /* send/recv interface index */
@@ -228,6 +229,7 @@ struct in_pktinfo {
228229
struct in_addr ipi_addr;
229230
};
230231
#endif
232+
#endif
231233

232234
#if defined(WITH_POSIX) && !defined(SOL_IP)
233235
/* Solaris expects level IPPROTO_IP for ancillary data. */

components/coap/port/include/coap_config_posix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define HAVE_MALLOC
2727
#define HAVE_ARPA_INET_H
2828

29-
#define IP_PKTINFO IP_MULTICAST_IF
29+
//#define IP_PKTINFO IP_MULTICAST_IF
3030
#define IPV6_PKTINFO IPV6_V6ONLY
3131

3232
#define PACKAGE_NAME "libcoap-posix"

components/esp8266/source/startup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ extern int wifi_nvs_init(void);
4949
extern esp_err_t esp_pthread_init(void);
5050
extern void phy_get_bb_evm(void);
5151
extern void uart_div_modify(uint8_t uart_no, uint16_t DivLatchValue);
52+
/*Only for calling esp_wifi_set_ps can compile successfully */
53+
uint32_t LwipTimOutLim = 0;
5254

5355
static inline int should_load(uint32_t load_addr)
5456
{

components/esp_common/include/esp_task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5)
4141
#define ESP_TASKD_EVENT_STACK (CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)
4242
#define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7)
43-
#define ESP_TASK_TCPIP_STACK (CONFIG_LWIP_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)
43+
#define ESP_TASK_TCPIP_STACK (CONFIG_LWIP_TCPIP_TASK_STACK_SIZE)
4444
#define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1)
4545
#define ESP_TASK_MAIN_STACK (CONFIG_ESP_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)
4646

components/freertos/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ config FREERTOS_ENABLE_REENT
2222

2323
The configuration will enable newlib.
2424

25+
config FREERTOS_NO_AFFINITY
26+
hex
27+
default 0x7FFFFFFF
28+
2529
config FREERTOS_HZ
2630
int "Tick rate (Hz)"
2731
range 1 1000

components/lwip/CMakeLists.txt

Lines changed: 152 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,163 @@
1-
set(COMPONENT_ADD_INCLUDEDIRS
2-
"include/lwip"
3-
"include/lwip/apps"
4-
"lwip/src/include"
5-
"lwip/src/include/posix"
6-
"port/esp8266/include"
7-
"port/esp8266/include/port"
1+
idf_build_get_property(target IDF_TARGET)
2+
set(include_dirs
3+
include/apps
4+
include/apps/sntp
5+
lwip/src/include
6+
port/${target}/include
7+
port/${target}/include/arch
88
)
99

10-
set(COMPONENT_SRCDIRS
11-
"apps/dhcpserver"
12-
"apps/multi-threads"
13-
"apps/ping"
14-
"lwip/src/api"
15-
"lwip/src/apps/sntp"
16-
"lwip/src/core"
17-
"lwip/src/core/ipv4"
18-
"lwip/src/core/ipv6"
19-
"lwip/src/netif"
20-
"port/esp8266/freertos"
21-
"port/esp8266/netif"
22-
)
10+
set(srcs
11+
"apps/dhcpserver/dhcpserver.c"
12+
"apps/multi-threads/sockets_mt.c"
13+
"apps/ping/esp_ping.c"
14+
"apps/ping/ping.c"
15+
"apps/ping/ping_sock.c"
16+
"apps/sntp/sntp.c"
17+
"lwip/src/api/api_lib.c"
18+
"lwip/src/api/api_msg.c"
19+
"lwip/src/api/err.c"
20+
"lwip/src/api/if_api.c"
21+
"lwip/src/api/netbuf.c"
22+
"lwip/src/api/netdb.c"
23+
"lwip/src/api/netifapi.c"
24+
"lwip/src/api/sockets.c"
25+
"lwip/src/api/tcpip.c"
26+
"lwip/src/apps/sntp/sntp.c"
27+
"lwip/src/apps/netbiosns/netbiosns.c"
28+
"lwip/src/core/def.c"
29+
"lwip/src/core/dns.c"
30+
"lwip/src/core/inet_chksum.c"
31+
"lwip/src/core/init.c"
32+
"lwip/src/core/ip.c"
33+
"lwip/src/core/mem.c"
34+
"lwip/src/core/memp.c"
35+
"lwip/src/core/netif.c"
36+
"lwip/src/core/pbuf.c"
37+
"lwip/src/core/raw.c"
38+
"lwip/src/core/stats.c"
39+
"lwip/src/core/sys.c"
40+
"lwip/src/core/tcp.c"
41+
"lwip/src/core/tcp_in.c"
42+
"lwip/src/core/tcp_out.c"
43+
"lwip/src/core/timeouts.c"
44+
"lwip/src/core/udp.c"
45+
"lwip/src/core/ipv4/autoip.c"
46+
"lwip/src/core/ipv4/dhcp.c"
47+
"lwip/src/core/ipv4/etharp.c"
48+
"lwip/src/core/ipv4/icmp.c"
49+
"lwip/src/core/ipv4/igmp.c"
50+
"lwip/src/core/ipv4/ip4.c"
51+
"lwip/src/core/ipv4/ip4_addr.c"
52+
"lwip/src/core/ipv4/ip4_frag.c"
53+
"lwip/src/core/ipv6/dhcp6.c"
54+
"lwip/src/core/ipv6/ethip6.c"
55+
"lwip/src/core/ipv6/icmp6.c"
56+
"lwip/src/core/ipv6/inet6.c"
57+
"lwip/src/core/ipv6/ip6.c"
58+
"lwip/src/core/ipv6/ip6_addr.c"
59+
"lwip/src/core/ipv6/ip6_frag.c"
60+
"lwip/src/core/ipv6/mld6.c"
61+
"lwip/src/core/ipv6/nd6.c"
62+
"lwip/src/netif/ethernet.c"
63+
"lwip/src/netif/lowpan6.c"
64+
"lwip/src/netif/slipif.c"
65+
"lwip/src/netif/ppp/auth.c"
66+
"lwip/src/netif/ppp/ccp.c"
67+
"lwip/src/netif/ppp/chap-md5.c"
68+
"lwip/src/netif/ppp/chap-new.c"
69+
"lwip/src/netif/ppp/chap_ms.c"
70+
"lwip/src/netif/ppp/demand.c"
71+
"lwip/src/netif/ppp/eap.c"
72+
"lwip/src/netif/ppp/ecp.c"
73+
"lwip/src/netif/ppp/eui64.c"
74+
"lwip/src/netif/ppp/fsm.c"
75+
"lwip/src/netif/ppp/ipcp.c"
76+
"lwip/src/netif/ppp/ipv6cp.c"
77+
"lwip/src/netif/ppp/lcp.c"
78+
"lwip/src/netif/ppp/magic.c"
79+
"lwip/src/netif/ppp/mppe.c"
80+
"lwip/src/netif/ppp/multilink.c"
81+
"lwip/src/netif/ppp/ppp.c"
82+
"lwip/src/netif/ppp/pppapi.c"
83+
"lwip/src/netif/ppp/pppcrypt.c"
84+
"lwip/src/netif/ppp/pppoe.c"
85+
"lwip/src/netif/ppp/pppol2tp.c"
86+
"lwip/src/netif/ppp/pppos.c"
87+
"lwip/src/netif/ppp/upap.c"
88+
"lwip/src/netif/ppp/utils.c"
89+
"lwip/src/netif/ppp/vj.c"
90+
"port/${target}/vfs_lwip.c"
91+
"port/${target}/debug/lwip_debug.c"
92+
"port/${target}/freertos/sys_arch.c"
93+
"port/${target}/netif/dhcp_state.c"
94+
"port/${target}/netif/wlanif.c")
2395

24-
if(CONFIG_LWIP_SOCKET_MULTITHREAD)
25-
set(COMPONENT_OBJEXCLUDE lwip/src/api/sockets.c)
96+
if(CONFIG_IDF_TARGET_ESP32)
97+
list(APPEND srcs
98+
"port/${target}/netif/nettestif.c")
2699
endif()
27100

28-
if(CONFIG_USING_ESP_VFS)
29-
set(COMPONENT_SRCDIRS ${COMPONENT_SRCDIRS} "port")
101+
if(CONFIG_LWIP_PPP_SUPPORT)
102+
list(APPEND srcs
103+
"lwip/src/netif/ppp/auth.c"
104+
"lwip/src/netif/ppp/ccp.c"
105+
"lwip/src/netif/ppp/chap-md5.c"
106+
"lwip/src/netif/ppp/chap-new.c"
107+
"lwip/src/netif/ppp/chap_ms.c"
108+
"lwip/src/netif/ppp/demand.c"
109+
"lwip/src/netif/ppp/eap.c"
110+
"lwip/src/netif/ppp/ecp.c"
111+
"lwip/src/netif/ppp/eui64.c"
112+
"lwip/src/netif/ppp/fsm.c"
113+
"lwip/src/netif/ppp/ipcp.c"
114+
"lwip/src/netif/ppp/ipv6cp.c"
115+
"lwip/src/netif/ppp/lcp.c"
116+
"lwip/src/netif/ppp/magic.c"
117+
"lwip/src/netif/ppp/mppe.c"
118+
"lwip/src/netif/ppp/multilink.c"
119+
"lwip/src/netif/ppp/ppp.c"
120+
"lwip/src/netif/ppp/pppapi.c"
121+
"lwip/src/netif/ppp/pppcrypt.c"
122+
"lwip/src/netif/ppp/pppoe.c"
123+
"lwip/src/netif/ppp/pppol2tp.c"
124+
"lwip/src/netif/ppp/pppos.c"
125+
"lwip/src/netif/ppp/upap.c"
126+
"lwip/src/netif/ppp/utils.c"
127+
"lwip/src/netif/ppp/vj.c"
128+
"lwip/src/netif/ppp/polarssl/arc4.c"
129+
"lwip/src/netif/ppp/polarssl/des.c"
130+
"lwip/src/netif/ppp/polarssl/md4.c"
131+
"lwip/src/netif/ppp/polarssl/md5.c"
132+
"lwip/src/netif/ppp/polarssl/sha1.c")
30133
endif()
31134

32-
set(COMPONENT_REQUIRES vfs)
33-
set(COMPONENT_PRIV_REQUIRES tcpip_adapter)
135+
if(CONFIG_ETH_ENABLED)
136+
list(APPEND srcs "port/esp32/netif/ethernetif.c")
137+
endif()
34138

35-
set(COMPONENT_ADD_LDFRAGMENTS "linker.lf")
139+
if(CONFIG_LWIP_SOCKET_MULTITHREAD)
140+
set(COMPONENT_OBJEXCLUDE lwip/src/api/sockets.c)
141+
endif()
36142

37-
register_component()
143+
idf_component_register(SRCS "${srcs}"
144+
INCLUDE_DIRS "${include_dirs}"
145+
LDFRAGMENTS linker.lf
146+
REQUIRES vfs
147+
PRIV_REQUIRES ${priv_requires} tcpip_adapter nvs_flash)
38148

39-
component_compile_options(-Wno-address)
149+
# lots of LWIP source files evaluate macros that check address of stack variables
150+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-address)
40151

41-
# patch around warnings in third-party files
42-
set_source_files_properties(lwip/src/apps/sntp/sntp.c lwip/src/core/ipv4/ip4.c
43-
PROPERTIES COMPILE_FLAGS
44-
-Wno-implicit-function-declaration
45-
)
152+
if(GCC_NOT_5_2_0)
153+
set_source_files_properties(
154+
lwip/src/netif/ppp/ppp.c
155+
PROPERTIES COMPILE_FLAGS
156+
-Wno-uninitialized
157+
)
158+
set_source_files_properties(
159+
lwip/src/netif/ppp/pppos.c
160+
PROPERTIES COMPILE_FLAGS
161+
-Wno-implicit-fallthrough
162+
)
163+
endif()

0 commit comments

Comments
 (0)