From c84cbd5e65f5ab55831ac91e43cf04ccb7c61ca1 Mon Sep 17 00:00:00 2001 From: xiaqilin Date: Fri, 7 Jul 2023 19:25:14 +0800 Subject: [PATCH] feat(openthread): disable lwip nd6 in openthread sleepy device --- components/lwip/Kconfig | 8 ++++++++ components/lwip/lwip | 2 +- components/lwip/port/include/lwipopts.h | 9 +++++++++ examples/openthread/ot_sleepy_device/sdkconfig.defaults | 6 +++++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index 843cb90289..0f3a534a44 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -80,6 +80,14 @@ menu "LWIP" This feature will reduce the power consumption for applications which do not use IGMP and MLD6. + config LWIP_ND6 + bool "LWIP NDP6 Enable/Disable" + default y + depends on LWIP_IPV6 + help + This option is used to disable the Network Discovery Protocol (NDP) if it is not required. + Please use this option with caution, as the NDP is essential for IPv6 functionality within a local network. + config LWIP_MAX_SOCKETS int "Max number of open sockets" range 1 16 diff --git a/components/lwip/lwip b/components/lwip/lwip index 8dad8d3ee6..7896c6cad0 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit 8dad8d3ee66840deee4acfc1601de4e396c594be +Subproject commit 7896c6cad020d17a986f7e850f603e084e319328 diff --git a/components/lwip/port/include/lwipopts.h b/components/lwip/port/include/lwipopts.h index 552314fe8f..283cd3fae5 100644 --- a/components/lwip/port/include/lwipopts.h +++ b/components/lwip/port/include/lwipopts.h @@ -1126,6 +1126,15 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) #define LWIP_IPV6 0 #endif +/** + * LWIP_ND6==1: Enable ND6 protocol in IPv6 + */ +#ifdef CONFIG_LWIP_ND6 +#define LWIP_ND6 1 +#else +#define LWIP_ND6 0 +#endif + /** * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. */ diff --git a/examples/openthread/ot_sleepy_device/sdkconfig.defaults b/examples/openthread/ot_sleepy_device/sdkconfig.defaults index 2279111544..82257cfd34 100644 --- a/examples/openthread/ot_sleepy_device/sdkconfig.defaults +++ b/examples/openthread/ot_sleepy_device/sdkconfig.defaults @@ -32,7 +32,8 @@ CONFIG_OPENTHREAD_DNS64_CLIENT=y # CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096 CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 -CONFIG_LWIP_MULTICAST_PING=y +CONFIG_LWIP_IPV4=n +CONFIG_LWIP_ND6=n # end of lwIP # @@ -48,4 +49,7 @@ CONFIG_PM_ENABLE=y CONFIG_FREERTOS_USE_TICKLESS_IDLE=y CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y CONFIG_IEEE802154_SLEEP_ENABLE=y +# Use 1000Hz freertos tick to lower sleep time threshold +CONFIG_FREERTOS_HZ=1000 +CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y # end of light sleep