From 117d6d1f2f7d91756d08d972162d410c56da9f26 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Sat, 14 Dec 2019 10:39:14 +0100 Subject: [PATCH 1/2] pkg/lwip: make TCPIP_THREAD_STACKSIZE overridable --- pkg/lwip/include/lwipopts.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/lwip/include/lwipopts.h b/pkg/lwip/include/lwipopts.h index abfd68a03b..20a1e5193b 100644 --- a/pkg/lwip/include/lwipopts.h +++ b/pkg/lwip/include/lwipopts.h @@ -141,7 +141,9 @@ extern "C" { #define MEMP_MEM_MALLOC (1) #define NETIF_MAX_HWADDR_LEN (GNRC_NETIF_HDR_L2ADDR_MAX_LEN) +#ifndef TCPIP_THREAD_STACKSIZE #define TCPIP_THREAD_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#endif #if defined(CPU_ESP32) && !defined(DOXYGEN) /** From aa3f1329bf9947d41732120c2034ea4bf0837d56 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Sun, 15 Dec 2019 23:50:35 +0100 Subject: [PATCH 2/2] pkg/lwip: remove TCPIP_THREAD_PRIO for ESP32 This definition is platform dependent and should be therefore done with CFLAGS in ESP332's Makefile. --- cpu/esp32/Makefile.include | 6 ++++++ pkg/lwip/include/lwipopts.h | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 91c3b44ad1..bef6be9770 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -129,6 +129,12 @@ ifneq (,$(filter esp_wifi_any esp_eth,$(USEMODULE))) CFLAGS += -DSCHED_PRIO_LEVELS=32 endif +ifneq (,$(filter lwip,$(USEMODULE))) + # The thread for handling the WiFi hardware has the priority. The priority + # of the lwIP TCP/IP thread should be lower than this priority. + CFLAGS += -DTCPIP_THREAD_PRIO=2 +endif + CFLAGS += -DSDK_NOT_USED -DCONFIG_FREERTOS_UNICORE=1 -DESP_PLATFORM CFLAGS += -DLOG_TAG_IN_BRACKETS CFLAGS += -Wno-unused-parameter -Wformat=0 diff --git a/pkg/lwip/include/lwipopts.h b/pkg/lwip/include/lwipopts.h index 20a1e5193b..7b42705f9d 100644 --- a/pkg/lwip/include/lwipopts.h +++ b/pkg/lwip/include/lwipopts.h @@ -145,15 +145,6 @@ extern "C" { #define TCPIP_THREAD_STACKSIZE (THREAD_STACKSIZE_DEFAULT) #endif -#if defined(CPU_ESP32) && !defined(DOXYGEN) -/** - * In ESP32, the thread that is dealing with hardware interrupts of the WiFi - * interface has a priority of 1. This thread should have a higher priority - * than lwIP's TCP/IP thread. - */ -#define TCPIP_THREAD_PRIO (2) -#endif - #define MEM_ALIGNMENT (4) #ifndef MEM_SIZE /* packet buffer size of GNRC + stack for TCP/IP */