Skip to content

Commit

Permalink
[NXP][zephyr] Updates to NXP Zephyr platform enablement
Browse files Browse the repository at this point in the history
* Fix duplicate definition of recvmsg on latest zephyr tree
* Remove redundant config flags
* Configure event queue size to 64
* Remove recovery mechanism in wifi implementation
* Always enable CHIP_FACTORY_RESET_ERASE_NVS
* Update net configuration for wifi

Signed-off-by: Axel Le Bourhis <[email protected]>
  • Loading branch information
axelnxp committed Feb 13, 2024
1 parent db09a64 commit 04ee497
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 170 deletions.
2 changes: 1 addition & 1 deletion config/nxp/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ endif #CHIP_FACTORY_DATA_BUILD
# See config/zephyr/Kconfig for full definition
config CHIP_FACTORY_RESET_ERASE_NVS
bool
default y if CHIP_FACTORY_DATA || CHIP_FACTORY_DATA_CUSTOM_BACKEND
default y

endif

Expand Down
44 changes: 37 additions & 7 deletions config/nxp/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ config PTHREAD_IPC

config POSIX_MAX_FDS
int
default 16
default 8

# Application stack size
config MAIN_STACK_SIZE
Expand All @@ -99,12 +99,21 @@ config INIT_STACKS
config NET_MGMT_EVENT_STACK_SIZE
default 2048

config NET_MGMT_EVENT_QUEUE_SIZE
default 20

config NET_IPV6_MLD
default y

config NET_IF_MCAST_IPV6_ADDR_COUNT
default 14

config NET_IF_MAX_IPV4_COUNT
default 2

config NET_IF_MAX_IPV6_COUNT
default 2

config NET_TC_TX_COUNT
default 1

Expand All @@ -129,10 +138,10 @@ config NET_TC_RX_THREAD_BASE_PRIO

# Network buffers
config NET_PKT_RX_COUNT
default 16
default 60

config NET_PKT_TX_COUNT
default 16
default 40

config NET_BUF_RX_COUNT
default 60
Expand All @@ -141,7 +150,7 @@ config NET_BUF_TX_COUNT
default 80

config NET_BUF_DATA_SIZE
default 1700
default 1744

# Bluetooth Low Energy configs

Expand Down Expand Up @@ -233,11 +242,14 @@ choice WPA_SUPP_LOG_LEVEL_CHOICE
endchoice

config WPA_SUPP_THREAD_STACK_SIZE
default 6144
default 12288

config SYSTEM_WORKQUEUE_STACK_SIZE
default 2048

config NET_TCP_WORKQ_STACK_SIZE
default 2048

# align these numbers to match the OpenThread config
config NET_IF_UNICAST_IPV6_ADDR_COUNT
default 6
Expand All @@ -246,7 +258,25 @@ config NET_IF_MCAST_IPV6_ADDR_COUNT
default 8

config NET_SOCKETS_POLL_MAX
default 4
default 8

config NET_IPV4_FRAGMENT_MAX_COUNT
default 3

config NET_IPV4_FRAGMENT_MAX_PKT
default 7

config NET_IPV4_FRAGMENT_TIMEOUT
default 3

config NET_IPV6_FRAGMENT_MAX_COUNT
default 3

config NET_IPV6_FRAGMENT_MAX_PKT
default 7

config NET_IPV6_FRAGMENT_TIMEOUT
default 3

# options managed by IP4/IP6 simultaneous support
# aligned here to match OpenThread config
Expand All @@ -260,7 +290,7 @@ config SHELL_STACK_SIZE
default 2616

config HEAP_MEM_POOL_SIZE
default 65536
default 122880

config CHIP_MALLOC_SYS_HEAP_SIZE
default 28672 # 28 kB
Expand Down
75 changes: 15 additions & 60 deletions src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,74 +27,31 @@

// ==================== Platform Adaptations ====================

#ifndef CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER CONFIG_CHIP_DEVICE_SERIAL_NUMBER
#endif

#ifndef CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE
#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE
#endif

#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_CHIP_DEVICE_HARDWARE_VERSION
#endif

#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE
#endif

#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR CONFIG_CHIP_DEVICE_DISCRIMINATOR
#endif

#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING
#endif

#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT
#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT CONFIG_CHIP_DEVICE_SPAKE2_IT
#endif

#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT
#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT CONFIG_CHIP_DEVICE_SPAKE2_SALT
#endif

#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER
#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID CONFIG_CHIP_DEVICE_VENDOR_ID
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_CHIP_DEVICE_PRODUCT_ID
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME CONFIG_CHIP_DEVICE_VENDOR_NAME
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_CHIP_DEVICE_PRODUCT_ID
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME CONFIG_CHIP_DEVICE_PRODUCT_NAME
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_CHIP_DEVICE_HARDWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION CONFIG_CHIP_DEVICE_SOFTWARE_VERSION
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING
#endif
#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER CONFIG_CHIP_DEVICE_SERIAL_NUMBER
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR CONFIG_CHIP_DEVICE_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT CONFIG_CHIP_DEVICE_SPAKE2_IT
#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT CONFIG_CHIP_DEVICE_SPAKE2_SALT
#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER

#ifdef CONFIG_NET_L2_OPENTHREAD
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_NET_L2_OPENTHREAD
#else
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0
#endif

#ifdef CONFIG_WIFI_NXP
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_WIFI_NXP
#ifdef CONFIG_CHIP_WIFI
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_CHIP_WIFI
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
#else
Expand Down Expand Up @@ -155,6 +112,8 @@
#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 8192
#endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE

#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 64

#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY 0
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY 0
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0
Expand Down Expand Up @@ -197,10 +156,6 @@
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1
#endif // CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE

#ifdef CONFIG_CHIP_DEVICE_TYPE
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE
#endif // CONFIG_CHIP_DEVICE_TYPE

#ifdef CONFIG_CHIP_EXTENDED_DISCOVERY
#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1
#endif // CONFIG_CHIP_EXTENDED_DISCOVERY
Expand Down
2 changes: 2 additions & 0 deletions src/platform/nxp/zephyr/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@
#pragma once

#include <platform/Zephyr/SystemPlatformConfig.h>

#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 0
4 changes: 0 additions & 4 deletions src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ CHIP_ERROR NxpWifiDriver::CommitConfiguration()

CHIP_ERROR NxpWifiDriver::RevertConfiguration()
{
// Abort Connection Recovery if it is in progress during reverting configuration.
// This is needed to stop recovery process after failsafe timer expiring.
WiFiManager::Instance().AbortConnectionRecovery();

LoadFromStorage();

if (WiFiManager::StationStatus::CONNECTING <= WiFiManager::Instance().GetStationStatus())
Expand Down
Loading

0 comments on commit 04ee497

Please sign in to comment.