Skip to content

Commit

Permalink
Revert "[nxp fromtree][NXP][zephyr] Updates to NXP Zephyr platform en…
Browse files Browse the repository at this point in the history
…ablement (project-chip#31823)"

This reverts commit 0b201e5.

Signed-off-by: Dina Benamar <[email protected]>
  • Loading branch information
dinabenamar committed Feb 26, 2024
1 parent 0a2cd4a commit 7b9a824
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 86 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
default y if CHIP_FACTORY_DATA || CHIP_FACTORY_DATA_CUSTOM_BACKEND

endif

Expand Down
44 changes: 7 additions & 37 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 8
default 16

# Application stack size
config MAIN_STACK_SIZE
Expand All @@ -99,21 +99,12 @@ 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 @@ -138,10 +129,10 @@ config NET_TC_RX_THREAD_BASE_PRIO

# Network buffers
config NET_PKT_RX_COUNT
default 60
default 16

config NET_PKT_TX_COUNT
default 40
default 16

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

config NET_BUF_DATA_SIZE
default 1744
default 1700

# Bluetooth Low Energy configs

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

config WPA_SUPP_THREAD_STACK_SIZE
default 12288
default 6144

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 @@ -258,25 +246,7 @@ config NET_IF_MCAST_IPV6_ADDR_COUNT
default 8

config NET_SOCKETS_POLL_MAX
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
default 4

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

config HEAP_MEM_POOL_SIZE
default 122880
default 65536

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

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

#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID CONFIG_CHIP_DEVICE_VENDOR_ID
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME CONFIG_CHIP_DEVICE_VENDOR_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
#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
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE
#ifndef CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
#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
#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_NAME CONFIG_CHIP_DEVICE_PRODUCT_NAME
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#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

#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_CHIP_WIFI
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_CHIP_WIFI
#ifdef CONFIG_WIFI_NXP
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_WIFI_NXP
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
#else
Expand Down Expand Up @@ -112,8 +155,6 @@
#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 @@ -156,6 +197,10 @@
#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: 0 additions & 2 deletions src/platform/nxp/zephyr/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@
#pragma once

#include <platform/Zephyr/SystemPlatformConfig.h>

#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 0
4 changes: 4 additions & 0 deletions src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ 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 7b9a824

Please sign in to comment.