diff --git a/matter/efr32/efr32mg24/BRD2601B/autogen/sl_component_catalog.h b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_component_catalog.h index 46683e8206..9559258cfa 100644 --- a/matter/efr32/efr32mg24/BRD2601B/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_component_catalog.h @@ -31,15 +31,19 @@ #define SL_CATALOG_IOSTREAM_PRESENT #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg24/BRD2601B/autogen/sl_event_handler.c b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_event_handler.c index e313a27728..13594dfffc 100644 --- a/matter/efr32/efr32mg24/BRD2601B/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_event_handler.c @@ -11,9 +11,12 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -21,6 +24,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -71,6 +75,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -82,15 +87,18 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + sl_ot_sys_init(); } void sl_internal_app_init(void) { + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_init.c b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_init.h b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2601B/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD2601B/config/sl_gp_interface_config.h b/matter/efr32/efr32mg24/BRD2601B/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2601B/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD2601B/config/sl_openthread_features_config.h b/matter/efr32/efr32mg24/BRD2601B/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2601B/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD2601B/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg24/BRD2601B/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2601B/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD2601B/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg24/BRD2601B/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..3357199a0a --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2601B/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD2703A/autogen/sl_component_catalog.h b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_component_catalog.h index 26e5a7a321..d21a264ac7 100644 --- a/matter/efr32/efr32mg24/BRD2703A/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_component_catalog.h @@ -31,12 +31,16 @@ #define SL_CATALOG_IOSTREAM_PRESENT #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg24/BRD2703A/autogen/sl_event_handler.c b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_event_handler.c index 5fb9720854..71afae022f 100644 --- a/matter/efr32/efr32mg24/BRD2703A/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_event_handler.c @@ -11,13 +11,17 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -67,6 +71,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -78,15 +83,18 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + sl_ot_sys_init(); } void sl_internal_app_init(void) { + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_init.c b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_init.h b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2703A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD2703A/config/sl_gp_interface_config.h b/matter/efr32/efr32mg24/BRD2703A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2703A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD2703A/config/sl_openthread_features_config.h b/matter/efr32/efr32mg24/BRD2703A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2703A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD2703A/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg24/BRD2703A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2703A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD2703A/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg24/BRD2703A/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..3357199a0a --- /dev/null +++ b/matter/efr32/efr32mg24/BRD2703A/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4186A/autogen/sl_component_catalog.h b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_component_catalog.h index 74ba9d159b..3339bda98a 100644 --- a/matter/efr32/efr32mg24/BRD4186A/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_component_catalog.h @@ -35,15 +35,19 @@ #endif #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg24/BRD4186A/autogen/sl_event_handler.c b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_event_handler.c index 064b0bf1d1..40815f0439 100644 --- a/matter/efr32/efr32mg24/BRD4186A/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_event_handler.c @@ -11,9 +11,12 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -21,6 +24,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -60,7 +64,7 @@ void sl_driver_init(void) GPIOINT_Init(); #if defined(USE_TEMP_SENSOR) sl_i2cspm_init_instances(); -#endif +#endif sl_simple_button_init_instances(); sl_simple_led_init_instances(); #if defined(CONFIG_ENABLE_UART) @@ -73,6 +77,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -84,15 +89,23 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_init.c b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_init.h b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4186A/config/sl_gp_interface_config.h b/matter/efr32/efr32mg24/BRD4186A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4186A/config/sl_openthread_features_config.h b/matter/efr32/efr32mg24/BRD4186A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4186A/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg24/BRD4186A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4186A/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg24/BRD4186A/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..3357199a0a --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186A/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4186C/autogen/sl_component_catalog.h b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_component_catalog.h index 09d8a38733..9b49226841 100644 --- a/matter/efr32/efr32mg24/BRD4186C/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_component_catalog.h @@ -35,15 +35,19 @@ #endif #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg24/BRD4186C/autogen/sl_event_handler.c b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_event_handler.c index d8ad57994a..bee8f78d8c 100644 --- a/matter/efr32/efr32mg24/BRD4186C/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_event_handler.c @@ -13,9 +13,12 @@ #include "sl_rail_util_power_manager_init.h" #endif #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -23,6 +26,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -85,6 +89,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -97,16 +102,24 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); #endif + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_init.c b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_init.h b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186C/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4186C/config/sl_debug_swo_config.h b/matter/efr32/efr32mg24/BRD4186C/config/sl_debug_swo_config.h deleted file mode 100644 index 34761be508..0000000000 --- a/matter/efr32/efr32mg24/BRD4186C/config/sl_debug_swo_config.h +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SWO configuration - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_DEBUG_SWO_CONFIG_H -#define SL_DEBUG_SWO_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu >>> - -// SWO Configuration - -// SWO Frequency -// Must be 875 kHz for communication with Silicon Labs debuggers -// Default: 875000 -#define SL_DEBUG_SWO_FREQ 875000 - -// Enable interrupt event trace -// Default: 0 -#define SL_DEBUG_SWO_SAMPLE_IRQ 0 - -// Enable Program Counter samples -// Default: 0 -#define SL_DEBUG_SWO_SAMPLE_PC 0 - -// SWO debug sample intervals -// <64=> 64 -// <128=> 128 -// <192=> 192 -// <256=> 256 -// <320=> 320 -// <384=> 384 -// <448=> 448 -// <512=> 512 -// <576=> 576 -// <640=> 640 -// <704=> 704 -// <768=> 768 -// <832=> 832 -// <896=> 896 -// <960=> 960 -// <1024=> 1024 -// <2048=> 2048 -// <3072=> 3072 -// <4096=> 4096 -// <5102=> 5102 -// <6144=> 6144 -// <7168=> 7168 -// <8192=> 8192 -// <9216=> 9216 -// <10240=> 10240 -// <11264=> 11264 -// <12288=> 12288 -// <13312=> 13312 -// <14336=> 14336 -// <15360=> 15360 -// Must be 64, 128, 192, [ n * 64 ], 1024, 2048, 3072, [ n * 1024 ] , 15360 -// Default: 15360 -#define SL_DEBUG_SWO_SAMPLE_INTERVAL 15360 -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_DEBUG -// $[GPIO_SL_DEBUG] -#define SL_DEBUG_PERIPHERAL GPIO - -#define SL_DEBUG_SWV_PORT gpioPortA -#define SL_DEBUG_SWV_PIN 3 -// [GPIO_SL_DEBUG]$ -// <<< sl:end pin_tool >>> - -#endif // SL_DEBUG_SWO_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4186C/config/sl_gp_interface_config.h b/matter/efr32/efr32mg24/BRD4186C/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186C/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4186C/config/sl_openthread_features_config.h b/matter/efr32/efr32mg24/BRD4186C/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186C/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4186C/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg24/BRD4186C/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186C/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4186C/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg24/BRD4186C/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..3357199a0a --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4186C/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4187A/autogen/sl_component_catalog.h b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_component_catalog.h index 09d8a38733..9b49226841 100644 --- a/matter/efr32/efr32mg24/BRD4187A/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_component_catalog.h @@ -35,15 +35,19 @@ #endif #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg24/BRD4187A/autogen/sl_event_handler.c b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_event_handler.c index 00e3f5f54b..3eef071bef 100644 --- a/matter/efr32/efr32mg24/BRD4187A/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_event_handler.c @@ -13,9 +13,12 @@ #include "sl_rail_util_power_manager_init.h" #endif #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -23,6 +26,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -86,6 +90,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -98,16 +103,24 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); #endif + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_init.c b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_init.h b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4187A/config/sl_gp_interface_config.h b/matter/efr32/efr32mg24/BRD4187A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4187A/config/sl_openthread_features_config.h b/matter/efr32/efr32mg24/BRD4187A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4187A/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg24/BRD4187A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4187A/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg24/BRD4187A/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..3357199a0a --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187A/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4187C/autogen/sl_component_catalog.h b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_component_catalog.h index 09d8a38733..9b49226841 100644 --- a/matter/efr32/efr32mg24/BRD4187C/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_component_catalog.h @@ -35,15 +35,19 @@ #endif #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg24/BRD4187C/autogen/sl_event_handler.c b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_event_handler.c index 3714b4a3f1..09042da18e 100644 --- a/matter/efr32/efr32mg24/BRD4187C/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_event_handler.c @@ -13,9 +13,12 @@ #include "sl_rail_util_power_manager_init.h" #endif // !RSI_BLE_ENABLE #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -23,6 +26,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -85,6 +89,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -97,16 +102,24 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); -#endif +#endif // !RSI_BLE_ENABLE + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_init.c b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_init.h b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187C/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg24/BRD4187C/config/sl_gp_interface_config.h b/matter/efr32/efr32mg24/BRD4187C/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187C/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4187C/config/sl_openthread_features_config.h b/matter/efr32/efr32mg24/BRD4187C/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..280491e3ca --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187C/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************/ /** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO +#define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD +#define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else +#define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg24/BRD4187C/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg24/BRD4187C/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..cc6ebf7dc6 --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187C/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK (1) + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK (1) + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg24/BRD4187C/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg24/BRD4187C/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..3357199a0a --- /dev/null +++ b/matter/efr32/efr32mg24/BRD4187C/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD2608A/autogen/sl_component_catalog.h b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_component_catalog.h index 1d31ccb7e9..7d54df5a32 100644 --- a/matter/efr32/efr32mg26/BRD2608A/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_component_catalog.h @@ -30,15 +30,19 @@ #define SL_CATALOG_IOSTREAM_PRESENT #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg26/BRD2608A/autogen/sl_event_handler.c b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_event_handler.c index d8ad57994a..bee8f78d8c 100644 --- a/matter/efr32/efr32mg26/BRD2608A/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_event_handler.c @@ -13,9 +13,12 @@ #include "sl_rail_util_power_manager_init.h" #endif #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -23,6 +26,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -85,6 +89,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -97,16 +102,24 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); #endif + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_init.c b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_init.h b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD2608A/config/circular_queue_config.h b/matter/efr32/efr32mg26/BRD2608A/config/circular_queue_config.h new file mode 100644 index 0000000000..81a7173d6a --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/circular_queue_config.h @@ -0,0 +1,23 @@ +/***************************************************************************//** + * @file circular_queue_config.h + * @brief Configuration file for circular queue. + * @copyright Copyright 2015 Silicon Laboratories, Inc. www.silabs.com + ******************************************************************************/ + +#ifndef __CIRCULAR_QUEUE_CONFIG_H__ +#define __CIRCULAR_QUEUE_CONFIG_H__ + +// <<< Use Configuration Wizard in Context Menu >>> +// Circular Queue Configuration + +// Max Queue Length +// <0-256:1> +// Default: 5 +#ifndef CIRCULAR_QUEUE_LEN_MAX +#define CIRCULAR_QUEUE_LEN_MAX 16 +#endif + +// +// <<< end of configuration section >>> + +#endif // __CIRCULAR_QUEUE_CONFIG_H__ diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_board_control_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_board_control_config.h new file mode 100644 index 0000000000..7cd6846899 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_board_control_config.h @@ -0,0 +1,106 @@ +/***************************************************************************//** + * @file + * @brief Board Control + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_BOARD_CONTROL_CONFIG_H +#define SL_BOARD_CONTROL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Enable Relative Humidity and Temperature sensor +// Default: 0 +#define SL_BOARD_ENABLE_SENSOR_RHT 0 + +// Enable Hall Effect sensor +// Default: 0 +#define SL_BOARD_ENABLE_SENSOR_HALL 0 + +// Enable Barometric Pressure sensor +// Default: 0 +#define SL_BOARD_ENABLE_SENSOR_PRESSURE 0 + +// Enable Light sensor +// Default: 0 +#define SL_BOARD_ENABLE_SENSOR_LIGHT 0 + +// Enable Inertial Measurement Unit +// Default: 0 +#define SL_BOARD_ENABLE_SENSOR_IMU 0 + +// Enable Microphone +// Default: 0 +#define SL_BOARD_ENABLE_SENSOR_MICROPHONE 0 + +// Disable SPI Flash +// Default: 1 +#define SL_BOARD_DISABLE_MEMORY_SPI 1 + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// SL_BOARD_ENABLE_SENSOR_RHT +// $[GPIO_SL_BOARD_ENABLE_SENSOR_RHT] +#define SL_BOARD_ENABLE_SENSOR_RHT_PORT gpioPortC +#define SL_BOARD_ENABLE_SENSOR_RHT_PIN 9 +// [GPIO_SL_BOARD_ENABLE_SENSOR_RHT]$ + +// SL_BOARD_ENABLE_SENSOR_HALL +// $[GPIO_SL_BOARD_ENABLE_SENSOR_HALL] +#define SL_BOARD_ENABLE_SENSOR_HALL_PORT gpioPortC +#define SL_BOARD_ENABLE_SENSOR_HALL_PIN 9 +// [GPIO_SL_BOARD_ENABLE_SENSOR_HALL]$ + +// SL_BOARD_ENABLE_SENSOR_PRESSURE +// $[GPIO_SL_BOARD_ENABLE_SENSOR_PRESSURE] +#define SL_BOARD_ENABLE_SENSOR_PRESSURE_PORT gpioPortC +#define SL_BOARD_ENABLE_SENSOR_PRESSURE_PIN 9 +// [GPIO_SL_BOARD_ENABLE_SENSOR_PRESSURE]$ + +// SL_BOARD_ENABLE_SENSOR_LIGHT +// $[GPIO_SL_BOARD_ENABLE_SENSOR_LIGHT] +#define SL_BOARD_ENABLE_SENSOR_LIGHT_PORT gpioPortC +#define SL_BOARD_ENABLE_SENSOR_LIGHT_PIN 9 +// [GPIO_SL_BOARD_ENABLE_SENSOR_LIGHT]$ + +// SL_BOARD_ENABLE_SENSOR_IMU +// $[GPIO_SL_BOARD_ENABLE_SENSOR_IMU] +#define SL_BOARD_ENABLE_SENSOR_IMU_PORT gpioPortA +#define SL_BOARD_ENABLE_SENSOR_IMU_PIN 10 +// [GPIO_SL_BOARD_ENABLE_SENSOR_IMU]$ + +// SL_BOARD_ENABLE_SENSOR_MICROPHONE +// $[GPIO_SL_BOARD_ENABLE_SENSOR_MICROPHONE] +#define SL_BOARD_ENABLE_SENSOR_MICROPHONE_PORT gpioPortC +#define SL_BOARD_ENABLE_SENSOR_MICROPHONE_PIN 8 +// [GPIO_SL_BOARD_ENABLE_SENSOR_MICROPHONE]$ + +// <<< sl:end pin_tool >>> + +#endif // SL_BOARD_CONTROL_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_clock_manager_oscillator_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_clock_manager_oscillator_config.h new file mode 100644 index 0000000000..cd39c270af --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_clock_manager_oscillator_config.h @@ -0,0 +1,321 @@ +/***************************************************************************//** + * @file + * @brief Clock Manager - Oscillators configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H +#define SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H + +// Oscillators Settings + +// HFXO Settings (if High Frequency crystal is used) +// Enable to configure HFXO +#ifndef SL_CLOCK_MANAGER_HFXO_EN +#define SL_CLOCK_MANAGER_HFXO_EN 1 +#endif + +// Mode +// +// XTAL +// EXTCLK +// EXTCLKPKDET +// HFXO_CFG_MODE_XTAL +#ifndef SL_CLOCK_MANAGER_HFXO_MODE +#define SL_CLOCK_MANAGER_HFXO_MODE HFXO_CFG_MODE_XTAL +#endif + +// Frequency <38000000-40000000> +// 39000000 +#ifndef SL_CLOCK_MANAGER_HFXO_FREQ +#define SL_CLOCK_MANAGER_HFXO_FREQ 39000000 +#endif + +// CTUNE <0-255> +// 140 +#ifndef SL_CLOCK_MANAGER_HFXO_CTUNE +#define SL_CLOCK_MANAGER_HFXO_CTUNE 140 +#endif + +// Precision <0-65535> +// 50 +#ifndef SL_CLOCK_MANAGER_HFXO_PRECISION +#define SL_CLOCK_MANAGER_HFXO_PRECISION 50 +#endif + +// HFXO crystal sharing feature +// Enable to configure HFXO crystal sharing leader or follower +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_EN 0 +#endif + +// Crystal sharing leader +// Enable to configure HFXO crystal sharing leader +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN 0 +#endif + +// Crystal sharing leader minimum startup delay +// If enabled, BUFOUT does not start until timeout set in +// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP expires. +// This prevents waste of power if BUFOUT is ready too early. +// 1 +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_MIN_STARTUP_DELAY_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_MIN_STARTUP_DELAY_EN 1 +#endif + +// Wait duration of oscillator startup sequence +// +// T42US +// T83US +// T108US +// T133US +// T158US +// T183US +// T208US +// T233US +// T258US +// T283US +// T333US +// T375US +// T417US +// T458US +// T500US +// T667US +// HFXO_BUFOUTCTRL_TIMEOUTSTARTUP_T208US +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP HFXO_BUFOUTCTRL_TIMEOUTSTARTUP_T208US +#endif +// +// + +// Crystal sharing follower +// Enable to configure HFXO crystal sharing follower +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN 0 +#endif +// + +// GPIO Port +// Bufout request GPIO port. If SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN +// is enabled, this port will be used to receive the BUFOUT request. If +// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN is enabled this port +// will be used to request BUFOUT from the crystal sharing leader. +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PORT +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PORT 0 +#endif + +// GPIO Pin +// Bufout request GPIO pin. If SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN +// is enabled, this pin will be used to receive the BUFOUT request. If +// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN is enabled this pin +// will be used to request BUFOUT from the crystal sharing leader. +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PIN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PIN 10 +#endif +// +// + +// LFXO Settings (if Low Frequency crystal is used) +// Enable to configure LFXO +#ifndef SL_CLOCK_MANAGER_LFXO_EN +#define SL_CLOCK_MANAGER_LFXO_EN 1 +#endif + +// Mode +// +// XTAL +// BUFEXTCLK +// DIGEXTCLK +// LFXO_CFG_MODE_XTAL +#ifndef SL_CLOCK_MANAGER_LFXO_MODE +#define SL_CLOCK_MANAGER_LFXO_MODE LFXO_CFG_MODE_XTAL +#endif + +// CTUNE <0-127> +// 63 +#ifndef SL_CLOCK_MANAGER_LFXO_CTUNE +#define SL_CLOCK_MANAGER_LFXO_CTUNE 63 +#endif + +// LFXO precision in PPM <0-65535> +// 50 +#ifndef SL_CLOCK_MANAGER_LFXO_PRECISION +#define SL_CLOCK_MANAGER_LFXO_PRECISION 50 +#endif + +// Startup Timeout Delay +// +// CYCLES2 +// CYCLES256 +// CYCLES1K +// CYCLES2K +// CYCLES4K +// CYCLES8K +// CYCLES16K +// CYCLES32K +// LFXO_CFG_TIMEOUT_CYCLES4K +#ifndef SL_CLOCK_MANAGER_LFXO_TIMEOUT +#define SL_CLOCK_MANAGER_LFXO_TIMEOUT LFXO_CFG_TIMEOUT_CYCLES4K +#endif +// + +// HFRCO and DPLL Settings +// Frequency Band +// RC Oscillator Frequency Band +// 1 MHz +// 2 MHz +// 4 MHz +// 7 MHz +// 13 MHz +// 16 MHz +// 19 MHz +// 26 MHz +// 32 MHz +// 38 MHz +// 48 MHz +// 56 MHz +// 64 MHz +// 80 MHz +// cmuHFRCODPLLFreq_80M0Hz +#ifndef SL_CLOCK_MANAGER_HFRCO_BAND +#define SL_CLOCK_MANAGER_HFRCO_BAND cmuHFRCODPLLFreq_80M0Hz +#endif + +// Use DPLL +// Enable to use the DPLL with HFRCO +#ifndef SL_CLOCK_MANAGER_HFRCO_DPLL_EN +#define SL_CLOCK_MANAGER_HFRCO_DPLL_EN 1 +#endif + +// Target Frequency <1000000-80000000> +// DPLL target frequency +// 78000000 +#ifndef SL_CLOCK_MANAGER_DPLL_FREQ +#define SL_CLOCK_MANAGER_DPLL_FREQ 78000000 +#endif + +// Numerator (N) <300-4095> +// Value of N for output frequency calculation fout = fref * (N+1) / (M+1) +// 3839 +#ifndef SL_CLOCK_MANAGER_DPLL_N +#define SL_CLOCK_MANAGER_DPLL_N 3839 +#endif + +// Denominator (M) <0-4095> +// Value of M for output frequency calculation fout = fref * (N+1) / (M+1) +// 1919 +#ifndef SL_CLOCK_MANAGER_DPLL_M +#define SL_CLOCK_MANAGER_DPLL_M 1919 +#endif + +// Reference Clock +// Reference clock source for DPLL +// DISABLED +// HFXO +// LFXO +// CMU_DPLLREFCLKCTRL_CLKSEL_HFXO +#ifndef SL_CLOCK_MANAGER_DPLL_REFCLK +#define SL_CLOCK_MANAGER_DPLL_REFCLK CMU_DPLLREFCLKCTRL_CLKSEL_HFXO +#endif + +// Reference Clock Edge Detect +// Edge detection for reference clock +// Falling Edge +// Rising Edge +// cmuDPLLEdgeSel_Fall +#ifndef SL_CLOCK_MANAGER_DPLL_EDGE +#define SL_CLOCK_MANAGER_DPLL_EDGE cmuDPLLEdgeSel_Fall +#endif + +// DPLL Lock Mode +// Lock mode +// Frequency-Lock Loop +// Phase-Lock Loop +// cmuDPLLLockMode_Freq +#ifndef SL_CLOCK_MANAGER_DPLL_LOCKMODE +#define SL_CLOCK_MANAGER_DPLL_LOCKMODE cmuDPLLLockMode_Phase +#endif + +// Automatic Lock Recovery +// 1 +#ifndef SL_CLOCK_MANAGER_DPLL_AUTORECOVER +#define SL_CLOCK_MANAGER_DPLL_AUTORECOVER 1 +#endif + +// Enable Dither +// 0 +#ifndef SL_CLOCK_MANAGER_DPLL_DITHER +#define SL_CLOCK_MANAGER_DPLL_DITHER 0 +#endif +// +// + +// HFRCOEM23 Settings +// Frequency Band +// RC Oscillator Frequency Band +// 1 MHz +// 2 MHz +// 4 MHz +// 13 MHz +// 16 MHz +// 19 MHz +// 26 MHz +// 32 MHz +// 40 MHz +// cmuHFRCOEM23Freq_19M0Hz +#ifndef SL_CLOCK_MANAGER_HFRCOEM23_BAND +#define SL_CLOCK_MANAGER_HFRCOEM23_BAND cmuHFRCOEM23Freq_19M0Hz +#endif +// + +// LFRCO Settings +// Precision Mode +// Precision mode uses hardware to automatically re-calibrate the LFRCO +// against a crystal driven by the HFXO. Hardware detects temperature +// changes and initiates a re-calibration of the LFRCO as needed when +// operating in EM0, EM1, or EM2. If a re-calibration is necessary and the +// HFXO is not active, the precision mode hardware will automatically +// enable HFXO for a short time to perform the calibration. EM4 operation is +// not allowed while precision mode is enabled. +// If high precision is selected on devices that do not support it, default +// precision will be used. +// Default precision +// High precision +// cmuPrecisionDefault +#ifndef SL_CLOCK_MANAGER_LFRCO_PRECISION +#define SL_CLOCK_MANAGER_LFRCO_PRECISION cmuPrecisionDefault +#endif +// + +// + +#endif /* SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H */ + +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_clock_manager_tree_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_clock_manager_tree_config.h new file mode 100644 index 0000000000..0dc99bc7b9 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_clock_manager_tree_config.h @@ -0,0 +1,293 @@ +/***************************************************************************//** + * @file + * @brief Clock Manager - Clock Tree configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_CLOCK_MANAGER_TREE_CONFIG_H +#define SL_CLOCK_MANAGER_TREE_CONFIG_H + +// Internal Defines: DO NOT MODIFY +// Those defines are used internally to help converting the DEFAULT_HF_CLOCK_SOURCE and DEFAULT_LF_CLOCK_SOURCE +// selection of each clock branch to the right HW register value. +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFRCODPLL 0xFF +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFXO 0xFE +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_FSRCO 0xFD +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFRCO 0xFC +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFXO 0xFB +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_ULFRCO 0xFA + +// Clock Tree Settings + +// Default Clock Source Selection for HF clock branches +// HFRCODPLL +// HFXO +// FSRCO +// Selection of the high frequency clock source. HF clock branches can select this value by chosing the DEFAULT_HF value. +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFRCODPLL +#ifndef SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFXO +#endif + +// Default Clock Source Selection for LF clock branches +// LFRCO +// LFXO +// ULFRCO +// Selection of the low frequency clock source. LF clock branches can select this value by chosing the DEFAULT_HF value. +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFRCO +#ifndef SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFXO +#endif + +// System Clock Branch Settings + +// Clock Source Selection for SYSCLK branch +// DEFAULT_HF +// FSRCO +// HFRCODPLL +// HFXO +// Selection of the Clock source for SYSCLK +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_SYSCLK_SOURCE +#define SL_CLOCK_MANAGER_SYSCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#endif + +// HCLK branch divider +// DIV1 +// DIV2 +// DIV4 +// DIV8 +// DIV16 +// HCLK branch is derived from SYSCLK. This clock drives the AHB bus interface. +// CMU_SYSCLKCTRL_HCLKPRESC_DIV1 +#ifndef SL_CLOCK_MANAGER_HCLK_DIVIDER +#define SL_CLOCK_MANAGER_HCLK_DIVIDER CMU_SYSCLKCTRL_HCLKPRESC_DIV1 +#endif + +// PCLK branch divider +// DIV1 +// DIV2 +// PCLK branch is derived from HCLK. This clock drives the APB bus interface. +// CMU_SYSCLKCTRL_PCLKPRESC_DIV2 +#ifndef SL_CLOCK_MANAGER_PCLK_DIVIDER +#define SL_CLOCK_MANAGER_PCLK_DIVIDER CMU_SYSCLKCTRL_PCLKPRESC_DIV2 +#endif + +// + +// Trace Clock Branches Settings +// Clock Source Selection for TRACECLK branch +// DISABLE +// SYSCLK +// HFRCOEM23 +// HFRCODPLLRT +// Selection of the Clock source for TRACECLK +// CMU_TRACECLKCTRL_CLKSEL_SYSCLK +#ifndef SL_CLOCK_MANAGER_TRACECLK_SOURCE +#define SL_CLOCK_MANAGER_TRACECLK_SOURCE CMU_TRACECLKCTRL_CLKSEL_SYSCLK +#endif + +// TRACECLK branch Divider +// DIV1 +// DIV2 +// DIV3 +// DIV4 +// Selection of the divider value for TRACECLK branch +// CMU_TRACECLKCTRL_PRESC_DIV1 +#ifndef SL_CLOCK_MANAGER_TRACECLK_DIVIDER +#define SL_CLOCK_MANAGER_TRACECLK_DIVIDER CMU_TRACECLKCTRL_PRESC_DIV1 +#endif + +// + +// High Frequency Clock Branches Settings +// Each HF Clock Tree branch can be customized, else the same clock source as for SYSCLK will be used when possible +// EM01GRPACLK clock the Timer peripherals +// Clock Source Selection for EM01GRPACLK branch +// DEFAULT_HF +// HFRCODPLL +// HFXO +// FSRCO +// HFRCOEM23 +// HFRCODPLLRT +// HFXORT +// Selection of the Clock source for EM01GRPACLK +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM01GRPACLK_SOURCE +#define SL_CLOCK_MANAGER_EM01GRPACLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#endif + +// Clock Source Selection for EM01GRPCCLK branch +// DEFAULT_HF +// HFRCODPLL +// HFXO +// FSRCO +// HFRCOEM23 +// HFRCODPLLRT +// HFXORT +// Selection of the Clock source for EM01GRPCCLK +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM01GRPCCLK_SOURCE +#define SL_CLOCK_MANAGER_EM01GRPCCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#endif + +// Clock Source Selection for IADCCLK branch +// EM01GRPACLK +// FSRCO +// HFRCOEM23 +// Selection of the Clock source for IADCCLK +// CMU_IADCCLKCTRL_CLKSEL_EM01GRPACLK +#ifndef SL_CLOCK_MANAGER_IADCCLK_SOURCE +#define SL_CLOCK_MANAGER_IADCCLK_SOURCE CMU_IADCCLKCTRL_CLKSEL_EM01GRPACLK +#endif + +// + +// Low Frequency Clock Branches Settings + +// Clock Source Selection for EM23GRPACLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for EM23GRPACLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM23GRPACLK_SOURCE +#define SL_CLOCK_MANAGER_EM23GRPACLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for EM4GRPACLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for EM4GRPACLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM4GRPACLK_SOURCE +#define SL_CLOCK_MANAGER_EM4GRPACLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for SYSRTCCLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for SYSRTCCLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_SYSRTCCLK_SOURCE +#define SL_CLOCK_MANAGER_SYSRTCCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for WDOG0CLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// HCLKDIV1024 +// Selection of the Clock source for WDOG0CLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_WDOG0CLK_SOURCE +#define SL_CLOCK_MANAGER_WDOG0CLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for WDOG1CLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// HCLKDIV1024 +// Selection of the Clock source for WDOG1CLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_WDOG1CLK_SOURCE +#define SL_CLOCK_MANAGER_WDOG1CLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for LCDCLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for LDCCLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_LCDCLK_SOURCE +#define SL_CLOCK_MANAGER_LCDCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for PCNT0CLK branch +// DISABLED +// EM23GRPACLK +// PCNTS0 +// Selection of the Clock source for PCNT0CLK +// CMU_PCNT0CLKCTRL_CLKSEL_EM23GRPACLK +#ifndef SL_CLOCK_MANAGER_PCNT0CLK_SOURCE +#define SL_CLOCK_MANAGER_PCNT0CLK_SOURCE CMU_PCNT0CLKCTRL_CLKSEL_EM23GRPACLK +#endif + +// + +// Mixed Frequency Clock Branch Settings +// Clock Source Selection for EUSART0CLK branch +// DISABLED +// EM01GRPCCLK +// HFRCOEM23 +// LFRCO +// LFXO +// Selection of the Clock source for EUSART0CLK +// CMU_EUSART0CLKCTRL_CLKSEL_EM01GRPCCLK +#ifndef SL_CLOCK_MANAGER_EUSART0CLK_SOURCE +#define SL_CLOCK_MANAGER_EUSART0CLK_SOURCE CMU_EUSART0CLKCTRL_CLKSEL_EM01GRPCCLK +#endif + +// Clock Source Selection for SYSTICKCLK branch +// <0=> HCLK +// <1=> EM23GRPACLK +// Selection of the Clock source for SYSTICKCLK +// 0 +#ifndef SL_CLOCK_MANAGER_SYSTICKCLK_SOURCE +#define SL_CLOCK_MANAGER_SYSTICKCLK_SOURCE 0 +#endif + +// Clock Source Selection for VDAC0CLK branch +// DISABLED +// EM01GRPACLK +// EM23GRPACLK +// FSRCO +// HFRCOEM23 +// Selection of the Clock source for VDAC0CLK +// CMU_VDAC0CLKCTRL_CLKSEL_EM01GRPACLK +#ifndef SL_CLOCK_MANAGER_VDAC0CLK_SOURCE +#define SL_CLOCK_MANAGER_VDAC0CLK_SOURCE CMU_VDAC0CLKCTRL_CLKSEL_EM01GRPACLK +#endif + +// +// + +#endif /* SL_CLOCK_MANAGER_TREE_CONFIG_H */ + +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_gp_interface_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_memory_manager_region_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_memory_manager_region_config.h index f940d40ec4..f34bb11775 100644 --- a/matter/efr32/efr32mg26/BRD2608A/config/sl_memory_manager_region_config.h +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_memory_manager_region_config.h @@ -40,7 +40,7 @@ // The stack size configured here will be used by the stack that the // application uses when coming out of a reset. #ifndef SL_STACK_SIZE -#define SL_STACK_SIZE 0 +#define SL_STACK_SIZE 4608 #endif // diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_openthread_features_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD2608A/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg26/BRD2608A/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..23f3739333 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD2608A/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD4116A/autogen/sl_component_catalog.h b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_component_catalog.h index fde042621e..52253d8468 100644 --- a/matter/efr32/efr32mg26/BRD4116A/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_component_catalog.h @@ -34,15 +34,19 @@ #endif #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg26/BRD4116A/autogen/sl_event_handler.c b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_event_handler.c index d8ad57994a..bee8f78d8c 100644 --- a/matter/efr32/efr32mg26/BRD4116A/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_event_handler.c @@ -13,9 +13,12 @@ #include "sl_rail_util_power_manager_init.h" #endif #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -23,6 +26,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -85,6 +89,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -97,16 +102,24 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); #endif + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_init.c b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_init.h b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4116A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD4116A/config/sl_gp_interface_config.h b/matter/efr32/efr32mg26/BRD4116A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4116A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4116A/config/sl_openthread_features_config.h b/matter/efr32/efr32mg26/BRD4116A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4116A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD4116A/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg26/BRD4116A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4116A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4116A/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg26/BRD4116A/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..23f3739333 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4116A/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD4117A/autogen/sl_component_catalog.h b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_component_catalog.h index fde042621e..52253d8468 100644 --- a/matter/efr32/efr32mg26/BRD4117A/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_component_catalog.h @@ -34,15 +34,19 @@ #endif #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg26/BRD4117A/autogen/sl_event_handler.c b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_event_handler.c index d8ad57994a..bee8f78d8c 100644 --- a/matter/efr32/efr32mg26/BRD4117A/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_event_handler.c @@ -13,9 +13,12 @@ #include "sl_rail_util_power_manager_init.h" #endif #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -23,6 +26,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -85,6 +89,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -97,16 +102,24 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); #endif + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_init.c b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_init.h b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD4117A/config/circular_queue_config.h b/matter/efr32/efr32mg26/BRD4117A/config/circular_queue_config.h new file mode 100644 index 0000000000..81a7173d6a --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/circular_queue_config.h @@ -0,0 +1,23 @@ +/***************************************************************************//** + * @file circular_queue_config.h + * @brief Configuration file for circular queue. + * @copyright Copyright 2015 Silicon Laboratories, Inc. www.silabs.com + ******************************************************************************/ + +#ifndef __CIRCULAR_QUEUE_CONFIG_H__ +#define __CIRCULAR_QUEUE_CONFIG_H__ + +// <<< Use Configuration Wizard in Context Menu >>> +// Circular Queue Configuration + +// Max Queue Length +// <0-256:1> +// Default: 5 +#ifndef CIRCULAR_QUEUE_LEN_MAX +#define CIRCULAR_QUEUE_LEN_MAX 16 +#endif + +// +// <<< end of configuration section >>> + +#endif // __CIRCULAR_QUEUE_CONFIG_H__ diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_board_control_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_board_control_config.h new file mode 100644 index 0000000000..e175eb54c9 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_board_control_config.h @@ -0,0 +1,76 @@ +/***************************************************************************//** + * @file + * @brief Board Control + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_BOARD_CONTROL_CONFIG_H +#define SL_BOARD_CONTROL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Enable Virtual COM UART +// Default: 0 +#define SL_BOARD_ENABLE_VCOM 0 + +// Enable Display +// Default: 0 +#define SL_BOARD_ENABLE_DISPLAY 0 + +// Enable Relative Humidity and Temperature sensor +// Default: 0 +#define SL_BOARD_ENABLE_SENSOR_RHT 0 + +// Disable SPI Flash +// Default: 1 +#define SL_BOARD_DISABLE_MEMORY_SPI 1 + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// SL_BOARD_ENABLE_VCOM +// $[GPIO_SL_BOARD_ENABLE_VCOM] +#define SL_BOARD_ENABLE_VCOM_PORT gpioPortB +#define SL_BOARD_ENABLE_VCOM_PIN 0 +// [GPIO_SL_BOARD_ENABLE_VCOM]$ + +// SL_BOARD_ENABLE_DISPLAY +// $[GPIO_SL_BOARD_ENABLE_DISPLAY] +#define SL_BOARD_ENABLE_DISPLAY_PORT gpioPortC +#define SL_BOARD_ENABLE_DISPLAY_PIN 9 +// [GPIO_SL_BOARD_ENABLE_DISPLAY]$ + +// SL_BOARD_ENABLE_SENSOR_RHT +// $[GPIO_SL_BOARD_ENABLE_SENSOR_RHT] +#define SL_BOARD_ENABLE_SENSOR_RHT_PORT gpioPortD +#define SL_BOARD_ENABLE_SENSOR_RHT_PIN 3 +// [GPIO_SL_BOARD_ENABLE_SENSOR_RHT]$ + +// <<< sl:end pin_tool >>> + +#endif // SL_BOARD_CONTROL_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_clock_manager_oscillator_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_clock_manager_oscillator_config.h new file mode 100644 index 0000000000..4c77e87374 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_clock_manager_oscillator_config.h @@ -0,0 +1,321 @@ +/***************************************************************************//** + * @file + * @brief Clock Manager - Oscillators configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H +#define SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H + +// Oscillators Settings + +// HFXO Settings (if High Frequency crystal is used) +// Enable to configure HFXO +#ifndef SL_CLOCK_MANAGER_HFXO_EN +#define SL_CLOCK_MANAGER_HFXO_EN 1 +#endif + +// Mode +// +// XTAL +// EXTCLK +// EXTCLKPKDET +// HFXO_CFG_MODE_XTAL +#ifndef SL_CLOCK_MANAGER_HFXO_MODE +#define SL_CLOCK_MANAGER_HFXO_MODE HFXO_CFG_MODE_XTAL +#endif + +// Frequency <38000000-40000000> +// 39000000 +#ifndef SL_CLOCK_MANAGER_HFXO_FREQ +#define SL_CLOCK_MANAGER_HFXO_FREQ 39000000 +#endif + +// CTUNE <0-255> +// 140 +#ifndef SL_CLOCK_MANAGER_HFXO_CTUNE +#define SL_CLOCK_MANAGER_HFXO_CTUNE 103 +#endif + +// Precision <0-65535> +// 50 +#ifndef SL_CLOCK_MANAGER_HFXO_PRECISION +#define SL_CLOCK_MANAGER_HFXO_PRECISION 50 +#endif + +// HFXO crystal sharing feature +// Enable to configure HFXO crystal sharing leader or follower +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_EN 0 +#endif + +// Crystal sharing leader +// Enable to configure HFXO crystal sharing leader +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN 0 +#endif + +// Crystal sharing leader minimum startup delay +// If enabled, BUFOUT does not start until timeout set in +// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP expires. +// This prevents waste of power if BUFOUT is ready too early. +// 1 +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_MIN_STARTUP_DELAY_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_MIN_STARTUP_DELAY_EN 1 +#endif + +// Wait duration of oscillator startup sequence +// +// T42US +// T83US +// T108US +// T133US +// T158US +// T183US +// T208US +// T233US +// T258US +// T283US +// T333US +// T375US +// T417US +// T458US +// T500US +// T667US +// HFXO_BUFOUTCTRL_TIMEOUTSTARTUP_T208US +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP HFXO_BUFOUTCTRL_TIMEOUTSTARTUP_T208US +#endif +// +// + +// Crystal sharing follower +// Enable to configure HFXO crystal sharing follower +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN 0 +#endif +// + +// GPIO Port +// Bufout request GPIO port. If SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN +// is enabled, this port will be used to receive the BUFOUT request. If +// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN is enabled this port +// will be used to request BUFOUT from the crystal sharing leader. +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PORT +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PORT 0 +#endif + +// GPIO Pin +// Bufout request GPIO pin. If SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN +// is enabled, this pin will be used to receive the BUFOUT request. If +// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN is enabled this pin +// will be used to request BUFOUT from the crystal sharing leader. +#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PIN +#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PIN 10 +#endif +// +// + +// LFXO Settings (if Low Frequency crystal is used) +// Enable to configure LFXO +#ifndef SL_CLOCK_MANAGER_LFXO_EN +#define SL_CLOCK_MANAGER_LFXO_EN 1 +#endif + +// Mode +// +// XTAL +// BUFEXTCLK +// DIGEXTCLK +// LFXO_CFG_MODE_XTAL +#ifndef SL_CLOCK_MANAGER_LFXO_MODE +#define SL_CLOCK_MANAGER_LFXO_MODE LFXO_CFG_MODE_XTAL +#endif + +// CTUNE <0-127> +// 63 +#ifndef SL_CLOCK_MANAGER_LFXO_CTUNE +#define SL_CLOCK_MANAGER_LFXO_CTUNE 37 +#endif + +// LFXO precision in PPM <0-65535> +// 50 +#ifndef SL_CLOCK_MANAGER_LFXO_PRECISION +#define SL_CLOCK_MANAGER_LFXO_PRECISION 50 +#endif + +// Startup Timeout Delay +// +// CYCLES2 +// CYCLES256 +// CYCLES1K +// CYCLES2K +// CYCLES4K +// CYCLES8K +// CYCLES16K +// CYCLES32K +// LFXO_CFG_TIMEOUT_CYCLES4K +#ifndef SL_CLOCK_MANAGER_LFXO_TIMEOUT +#define SL_CLOCK_MANAGER_LFXO_TIMEOUT LFXO_CFG_TIMEOUT_CYCLES4K +#endif +// + +// HFRCO and DPLL Settings +// Frequency Band +// RC Oscillator Frequency Band +// 1 MHz +// 2 MHz +// 4 MHz +// 7 MHz +// 13 MHz +// 16 MHz +// 19 MHz +// 26 MHz +// 32 MHz +// 38 MHz +// 48 MHz +// 56 MHz +// 64 MHz +// 80 MHz +// cmuHFRCODPLLFreq_80M0Hz +#ifndef SL_CLOCK_MANAGER_HFRCO_BAND +#define SL_CLOCK_MANAGER_HFRCO_BAND cmuHFRCODPLLFreq_80M0Hz +#endif + +// Use DPLL +// Enable to use the DPLL with HFRCO +#ifndef SL_CLOCK_MANAGER_HFRCO_DPLL_EN +#define SL_CLOCK_MANAGER_HFRCO_DPLL_EN 1 +#endif + +// Target Frequency <1000000-80000000> +// DPLL target frequency +// 78000000 +#ifndef SL_CLOCK_MANAGER_DPLL_FREQ +#define SL_CLOCK_MANAGER_DPLL_FREQ 78000000 +#endif + +// Numerator (N) <300-4095> +// Value of N for output frequency calculation fout = fref * (N+1) / (M+1) +// 3839 +#ifndef SL_CLOCK_MANAGER_DPLL_N +#define SL_CLOCK_MANAGER_DPLL_N 3839 +#endif + +// Denominator (M) <0-4095> +// Value of M for output frequency calculation fout = fref * (N+1) / (M+1) +// 1919 +#ifndef SL_CLOCK_MANAGER_DPLL_M +#define SL_CLOCK_MANAGER_DPLL_M 1919 +#endif + +// Reference Clock +// Reference clock source for DPLL +// DISABLED +// HFXO +// LFXO +// CMU_DPLLREFCLKCTRL_CLKSEL_HFXO +#ifndef SL_CLOCK_MANAGER_DPLL_REFCLK +#define SL_CLOCK_MANAGER_DPLL_REFCLK CMU_DPLLREFCLKCTRL_CLKSEL_HFXO +#endif + +// Reference Clock Edge Detect +// Edge detection for reference clock +// Falling Edge +// Rising Edge +// cmuDPLLEdgeSel_Fall +#ifndef SL_CLOCK_MANAGER_DPLL_EDGE +#define SL_CLOCK_MANAGER_DPLL_EDGE cmuDPLLEdgeSel_Fall +#endif + +// DPLL Lock Mode +// Lock mode +// Frequency-Lock Loop +// Phase-Lock Loop +// cmuDPLLLockMode_Freq +#ifndef SL_CLOCK_MANAGER_DPLL_LOCKMODE +#define SL_CLOCK_MANAGER_DPLL_LOCKMODE cmuDPLLLockMode_Phase +#endif + +// Automatic Lock Recovery +// 1 +#ifndef SL_CLOCK_MANAGER_DPLL_AUTORECOVER +#define SL_CLOCK_MANAGER_DPLL_AUTORECOVER 1 +#endif + +// Enable Dither +// 0 +#ifndef SL_CLOCK_MANAGER_DPLL_DITHER +#define SL_CLOCK_MANAGER_DPLL_DITHER 0 +#endif +// +// + +// HFRCOEM23 Settings +// Frequency Band +// RC Oscillator Frequency Band +// 1 MHz +// 2 MHz +// 4 MHz +// 13 MHz +// 16 MHz +// 19 MHz +// 26 MHz +// 32 MHz +// 40 MHz +// cmuHFRCOEM23Freq_19M0Hz +#ifndef SL_CLOCK_MANAGER_HFRCOEM23_BAND +#define SL_CLOCK_MANAGER_HFRCOEM23_BAND cmuHFRCOEM23Freq_19M0Hz +#endif +// + +// LFRCO Settings +// Precision Mode +// Precision mode uses hardware to automatically re-calibrate the LFRCO +// against a crystal driven by the HFXO. Hardware detects temperature +// changes and initiates a re-calibration of the LFRCO as needed when +// operating in EM0, EM1, or EM2. If a re-calibration is necessary and the +// HFXO is not active, the precision mode hardware will automatically +// enable HFXO for a short time to perform the calibration. EM4 operation is +// not allowed while precision mode is enabled. +// If high precision is selected on devices that do not support it, default +// precision will be used. +// Default precision +// High precision +// cmuPrecisionDefault +#ifndef SL_CLOCK_MANAGER_LFRCO_PRECISION +#define SL_CLOCK_MANAGER_LFRCO_PRECISION cmuPrecisionDefault +#endif +// + +// + +#endif /* SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H */ + +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_clock_manager_tree_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_clock_manager_tree_config.h new file mode 100644 index 0000000000..0dc99bc7b9 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_clock_manager_tree_config.h @@ -0,0 +1,293 @@ +/***************************************************************************//** + * @file + * @brief Clock Manager - Clock Tree configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_CLOCK_MANAGER_TREE_CONFIG_H +#define SL_CLOCK_MANAGER_TREE_CONFIG_H + +// Internal Defines: DO NOT MODIFY +// Those defines are used internally to help converting the DEFAULT_HF_CLOCK_SOURCE and DEFAULT_LF_CLOCK_SOURCE +// selection of each clock branch to the right HW register value. +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFRCODPLL 0xFF +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFXO 0xFE +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_FSRCO 0xFD +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFRCO 0xFC +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFXO 0xFB +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_ULFRCO 0xFA + +// Clock Tree Settings + +// Default Clock Source Selection for HF clock branches +// HFRCODPLL +// HFXO +// FSRCO +// Selection of the high frequency clock source. HF clock branches can select this value by chosing the DEFAULT_HF value. +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFRCODPLL +#ifndef SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#define SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE_HFXO +#endif + +// Default Clock Source Selection for LF clock branches +// LFRCO +// LFXO +// ULFRCO +// Selection of the low frequency clock source. LF clock branches can select this value by chosing the DEFAULT_HF value. +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFRCO +#ifndef SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#define SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE_LFXO +#endif + +// System Clock Branch Settings + +// Clock Source Selection for SYSCLK branch +// DEFAULT_HF +// FSRCO +// HFRCODPLL +// HFXO +// Selection of the Clock source for SYSCLK +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_SYSCLK_SOURCE +#define SL_CLOCK_MANAGER_SYSCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#endif + +// HCLK branch divider +// DIV1 +// DIV2 +// DIV4 +// DIV8 +// DIV16 +// HCLK branch is derived from SYSCLK. This clock drives the AHB bus interface. +// CMU_SYSCLKCTRL_HCLKPRESC_DIV1 +#ifndef SL_CLOCK_MANAGER_HCLK_DIVIDER +#define SL_CLOCK_MANAGER_HCLK_DIVIDER CMU_SYSCLKCTRL_HCLKPRESC_DIV1 +#endif + +// PCLK branch divider +// DIV1 +// DIV2 +// PCLK branch is derived from HCLK. This clock drives the APB bus interface. +// CMU_SYSCLKCTRL_PCLKPRESC_DIV2 +#ifndef SL_CLOCK_MANAGER_PCLK_DIVIDER +#define SL_CLOCK_MANAGER_PCLK_DIVIDER CMU_SYSCLKCTRL_PCLKPRESC_DIV2 +#endif + +// + +// Trace Clock Branches Settings +// Clock Source Selection for TRACECLK branch +// DISABLE +// SYSCLK +// HFRCOEM23 +// HFRCODPLLRT +// Selection of the Clock source for TRACECLK +// CMU_TRACECLKCTRL_CLKSEL_SYSCLK +#ifndef SL_CLOCK_MANAGER_TRACECLK_SOURCE +#define SL_CLOCK_MANAGER_TRACECLK_SOURCE CMU_TRACECLKCTRL_CLKSEL_SYSCLK +#endif + +// TRACECLK branch Divider +// DIV1 +// DIV2 +// DIV3 +// DIV4 +// Selection of the divider value for TRACECLK branch +// CMU_TRACECLKCTRL_PRESC_DIV1 +#ifndef SL_CLOCK_MANAGER_TRACECLK_DIVIDER +#define SL_CLOCK_MANAGER_TRACECLK_DIVIDER CMU_TRACECLKCTRL_PRESC_DIV1 +#endif + +// + +// High Frequency Clock Branches Settings +// Each HF Clock Tree branch can be customized, else the same clock source as for SYSCLK will be used when possible +// EM01GRPACLK clock the Timer peripherals +// Clock Source Selection for EM01GRPACLK branch +// DEFAULT_HF +// HFRCODPLL +// HFXO +// FSRCO +// HFRCOEM23 +// HFRCODPLLRT +// HFXORT +// Selection of the Clock source for EM01GRPACLK +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM01GRPACLK_SOURCE +#define SL_CLOCK_MANAGER_EM01GRPACLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#endif + +// Clock Source Selection for EM01GRPCCLK branch +// DEFAULT_HF +// HFRCODPLL +// HFXO +// FSRCO +// HFRCOEM23 +// HFRCODPLLRT +// HFXORT +// Selection of the Clock source for EM01GRPCCLK +// SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM01GRPCCLK_SOURCE +#define SL_CLOCK_MANAGER_EM01GRPCCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_HF_CLOCK_SOURCE +#endif + +// Clock Source Selection for IADCCLK branch +// EM01GRPACLK +// FSRCO +// HFRCOEM23 +// Selection of the Clock source for IADCCLK +// CMU_IADCCLKCTRL_CLKSEL_EM01GRPACLK +#ifndef SL_CLOCK_MANAGER_IADCCLK_SOURCE +#define SL_CLOCK_MANAGER_IADCCLK_SOURCE CMU_IADCCLKCTRL_CLKSEL_EM01GRPACLK +#endif + +// + +// Low Frequency Clock Branches Settings + +// Clock Source Selection for EM23GRPACLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for EM23GRPACLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM23GRPACLK_SOURCE +#define SL_CLOCK_MANAGER_EM23GRPACLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for EM4GRPACLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for EM4GRPACLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_EM4GRPACLK_SOURCE +#define SL_CLOCK_MANAGER_EM4GRPACLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for SYSRTCCLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for SYSRTCCLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_SYSRTCCLK_SOURCE +#define SL_CLOCK_MANAGER_SYSRTCCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for WDOG0CLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// HCLKDIV1024 +// Selection of the Clock source for WDOG0CLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_WDOG0CLK_SOURCE +#define SL_CLOCK_MANAGER_WDOG0CLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for WDOG1CLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// HCLKDIV1024 +// Selection of the Clock source for WDOG1CLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_WDOG1CLK_SOURCE +#define SL_CLOCK_MANAGER_WDOG1CLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for LCDCLK branch +// DEFAULT_LF +// LFRCO +// LFXO +// ULFRCO +// Selection of the Clock source for LDCCLK +// SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#ifndef SL_CLOCK_MANAGER_LCDCLK_SOURCE +#define SL_CLOCK_MANAGER_LCDCLK_SOURCE SL_CLOCK_MANAGER_DEFAULT_LF_CLOCK_SOURCE +#endif + +// Clock Source Selection for PCNT0CLK branch +// DISABLED +// EM23GRPACLK +// PCNTS0 +// Selection of the Clock source for PCNT0CLK +// CMU_PCNT0CLKCTRL_CLKSEL_EM23GRPACLK +#ifndef SL_CLOCK_MANAGER_PCNT0CLK_SOURCE +#define SL_CLOCK_MANAGER_PCNT0CLK_SOURCE CMU_PCNT0CLKCTRL_CLKSEL_EM23GRPACLK +#endif + +// + +// Mixed Frequency Clock Branch Settings +// Clock Source Selection for EUSART0CLK branch +// DISABLED +// EM01GRPCCLK +// HFRCOEM23 +// LFRCO +// LFXO +// Selection of the Clock source for EUSART0CLK +// CMU_EUSART0CLKCTRL_CLKSEL_EM01GRPCCLK +#ifndef SL_CLOCK_MANAGER_EUSART0CLK_SOURCE +#define SL_CLOCK_MANAGER_EUSART0CLK_SOURCE CMU_EUSART0CLKCTRL_CLKSEL_EM01GRPCCLK +#endif + +// Clock Source Selection for SYSTICKCLK branch +// <0=> HCLK +// <1=> EM23GRPACLK +// Selection of the Clock source for SYSTICKCLK +// 0 +#ifndef SL_CLOCK_MANAGER_SYSTICKCLK_SOURCE +#define SL_CLOCK_MANAGER_SYSTICKCLK_SOURCE 0 +#endif + +// Clock Source Selection for VDAC0CLK branch +// DISABLED +// EM01GRPACLK +// EM23GRPACLK +// FSRCO +// HFRCOEM23 +// Selection of the Clock source for VDAC0CLK +// CMU_VDAC0CLKCTRL_CLKSEL_EM01GRPACLK +#ifndef SL_CLOCK_MANAGER_VDAC0CLK_SOURCE +#define SL_CLOCK_MANAGER_VDAC0CLK_SOURCE CMU_VDAC0CLKCTRL_CLKSEL_EM01GRPACLK +#endif + +// +// + +#endif /* SL_CLOCK_MANAGER_TREE_CONFIG_H */ + +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_gp_interface_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_memory_manager_region_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_memory_manager_region_config.h index f940d40ec4..f34bb11775 100644 --- a/matter/efr32/efr32mg26/BRD4117A/config/sl_memory_manager_region_config.h +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_memory_manager_region_config.h @@ -40,7 +40,7 @@ // The stack size configured here will be used by the stack that the // application uses when coming out of a reset. #ifndef SL_STACK_SIZE -#define SL_STACK_SIZE 0 +#define SL_STACK_SIZE 4608 #endif // diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_openthread_features_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4117A/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg26/BRD4117A/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..23f3739333 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4117A/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD4118A/autogen/sl_component_catalog.h b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_component_catalog.h index fde042621e..50d5e14780 100644 --- a/matter/efr32/efr32mg26/BRD4118A/autogen/sl_component_catalog.h +++ b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_component_catalog.h @@ -38,11 +38,14 @@ #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/efr32mg26/BRD4118A/autogen/sl_event_handler.c b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_event_handler.c index d8ad57994a..bee8f78d8c 100644 --- a/matter/efr32/efr32mg26/BRD4118A/autogen/sl_event_handler.c +++ b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_event_handler.c @@ -13,9 +13,12 @@ #include "sl_rail_util_power_manager_init.h" #endif #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #if defined(USE_TEMP_SENSOR) #include "sl_i2cspm_instances.h" @@ -23,6 +26,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #if defined(CONFIG_ENABLE_UART) @@ -85,6 +89,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -97,16 +102,24 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); #endif + +#ifdef SL_OT_ENABLE + sl_ot_sys_init(); +#endif // SL_OT_ENABLE } void sl_internal_app_init(void) { +#ifdef SL_OT_ENABLE + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); +#endif // SL_OT_ENABLE } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_custom_cli.c b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_init.c b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_init.h b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4118A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/efr32mg26/BRD4118A/config/sl_gp_interface_config.h b/matter/efr32/efr32mg26/BRD4118A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4118A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4118A/config/sl_openthread_features_config.h b/matter/efr32/efr32mg26/BRD4118A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4118A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/efr32mg26/BRD4118A/config/sl_openthread_rtos_config.h b/matter/efr32/efr32mg26/BRD4118A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4118A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/efr32mg26/BRD4118A/config/sl_rail_util_rssi_config.h b/matter/efr32/efr32mg26/BRD4118A/config/sl_rail_util_rssi_config.h new file mode 100644 index 0000000000..23f3739333 --- /dev/null +++ b/matter/efr32/efr32mg26/BRD4118A/config/sl_rail_util_rssi_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief RSSI configuration header file. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_RAIL_UTIL_RSSI_CONFIG_H +#define SL_RAIL_UTIL_RSSI_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RSSI Offset Configuration + +// Software RSSI offset value +// Default: 0 +#define SL_RAIL_UTIL_RSSI_OFFSET 0 + +// +// <<< end of configuration section >>> +#endif // SL_RAIL_UTIL_RSSI_CONFIG_H diff --git a/matter/efr32/mgm24/BRD2704A/autogen/sl_component_catalog.h b/matter/efr32/mgm24/BRD2704A/autogen/sl_component_catalog.h index 6ece55491e..f785dfa798 100644 --- a/matter/efr32/mgm24/BRD2704A/autogen/sl_component_catalog.h +++ b/matter/efr32/mgm24/BRD2704A/autogen/sl_component_catalog.h @@ -31,12 +31,16 @@ #define SL_CATALOG_IOSTREAM_PRESENT #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_LED0_PRESENT #define SL_CATALOG_SIMPLE_LED_PRESENT diff --git a/matter/efr32/mgm24/BRD2704A/autogen/sl_event_handler.c b/matter/efr32/mgm24/BRD2704A/autogen/sl_event_handler.c index 5252ea9648..0df04a1b08 100644 --- a/matter/efr32/mgm24/BRD2704A/autogen/sl_event_handler.c +++ b/matter/efr32/mgm24/BRD2704A/autogen/sl_event_handler.c @@ -12,13 +12,17 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_led_instances.h" #include "sl_uartdrv_instances.h" #include "psa/crypto.h" @@ -62,6 +66,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -74,15 +79,18 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + sl_ot_sys_init(); } void sl_internal_app_init(void) { + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_custom_cli.c b/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_init.c b/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_init.h b/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/mgm24/BRD2704A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD2704A/config/sl_gp_interface_config.h b/matter/efr32/mgm24/BRD2704A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/mgm24/BRD2704A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD2704A/config/sl_openthread_features_config.h b/matter/efr32/mgm24/BRD2704A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/mgm24/BRD2704A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/mgm24/BRD2704A/config/sl_openthread_rtos_config.h b/matter/efr32/mgm24/BRD2704A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/mgm24/BRD2704A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4316A/autogen/sl_component_catalog.h b/matter/efr32/mgm24/BRD4316A/autogen/sl_component_catalog.h index 533c965231..93ebed17a0 100644 --- a/matter/efr32/mgm24/BRD4316A/autogen/sl_component_catalog.h +++ b/matter/efr32/mgm24/BRD4316A/autogen/sl_component_catalog.h @@ -31,6 +31,7 @@ #define SL_CATALOG_IOSTREAM_PRESENT #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef DISPLAY_ENABLED #define SL_CATALOG_DMD_MEMLCD_PRESENT #define SL_CATALOG_MEMLCD_USART_PRESENT @@ -39,11 +40,14 @@ #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/mgm24/BRD4316A/autogen/sl_event_handler.c b/matter/efr32/mgm24/BRD4316A/autogen/sl_event_handler.c index 3ce21c0ef0..893556b8ed 100644 --- a/matter/efr32/mgm24/BRD4316A/autogen/sl_event_handler.c +++ b/matter/efr32/mgm24/BRD4316A/autogen/sl_event_handler.c @@ -12,9 +12,12 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #ifdef USE_TEMP_SENSOR #include "sl_i2cspm_instances.h" @@ -22,6 +25,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_uartdrv_instances.h" #include "psa/crypto.h" @@ -62,7 +66,7 @@ void sl_driver_init(void) sl_simple_button_init_instances(); #if defined(CONFIG_ENABLE_UART) sl_uartdrv_init_instances(); - #endif +#endif } void sl_service_init(void) @@ -70,6 +74,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -82,15 +87,18 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + sl_ot_sys_init(); } void sl_internal_app_init(void) { + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_custom_cli.c b/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_init.c b/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_init.h b/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/mgm24/BRD4316A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4316A/config/sl_gp_interface_config.h b/matter/efr32/mgm24/BRD4316A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/mgm24/BRD4316A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4316A/config/sl_openthread_features_config.h b/matter/efr32/mgm24/BRD4316A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/mgm24/BRD4316A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/mgm24/BRD4316A/config/sl_openthread_rtos_config.h b/matter/efr32/mgm24/BRD4316A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/mgm24/BRD4316A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4317A/autogen/sl_component_catalog.h b/matter/efr32/mgm24/BRD4317A/autogen/sl_component_catalog.h index 533c965231..93ebed17a0 100644 --- a/matter/efr32/mgm24/BRD4317A/autogen/sl_component_catalog.h +++ b/matter/efr32/mgm24/BRD4317A/autogen/sl_component_catalog.h @@ -31,6 +31,7 @@ #define SL_CATALOG_IOSTREAM_PRESENT #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef DISPLAY_ENABLED #define SL_CATALOG_DMD_MEMLCD_PRESENT #define SL_CATALOG_MEMLCD_USART_PRESENT @@ -39,11 +40,14 @@ #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/mgm24/BRD4317A/autogen/sl_event_handler.c b/matter/efr32/mgm24/BRD4317A/autogen/sl_event_handler.c index 28e07478a4..2b6740a730 100644 --- a/matter/efr32/mgm24/BRD4317A/autogen/sl_event_handler.c +++ b/matter/efr32/mgm24/BRD4317A/autogen/sl_event_handler.c @@ -12,9 +12,12 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #ifdef USE_TEMP_SENSOR #include "sl_i2cspm_instances.h" @@ -22,6 +25,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #if defined(CONFIG_ENABLE_UART) #include "sl_uartdrv_instances.h" @@ -72,6 +76,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -84,15 +89,18 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + sl_ot_sys_init(); } void sl_internal_app_init(void) { + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_custom_cli.c b/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_init.c b/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_init.h b/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/mgm24/BRD4317A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4317A/config/sl_gp_interface_config.h b/matter/efr32/mgm24/BRD4317A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/mgm24/BRD4317A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4317A/config/sl_openthread_features_config.h b/matter/efr32/mgm24/BRD4317A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/mgm24/BRD4317A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/mgm24/BRD4317A/config/sl_openthread_rtos_config.h b/matter/efr32/mgm24/BRD4317A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/mgm24/BRD4317A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4318A/autogen/sl_component_catalog.h b/matter/efr32/mgm24/BRD4318A/autogen/sl_component_catalog.h index 76cc564a4f..29acbadf5b 100644 --- a/matter/efr32/mgm24/BRD4318A/autogen/sl_component_catalog.h +++ b/matter/efr32/mgm24/BRD4318A/autogen/sl_component_catalog.h @@ -35,15 +35,19 @@ #endif #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #ifdef CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_MX25_FLASH_SHUTDOWN_USART_PRESENT #endif // CONFIG_USE_EXTERNAL_FLASH #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/mgm24/BRD4318A/autogen/sl_event_handler.c b/matter/efr32/mgm24/BRD4318A/autogen/sl_event_handler.c index 79fa5affbd..5744749187 100644 --- a/matter/efr32/mgm24/BRD4318A/autogen/sl_event_handler.c +++ b/matter/efr32/mgm24/BRD4318A/autogen/sl_event_handler.c @@ -12,9 +12,12 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #ifdef USE_TEMP_SENSOR #include "sl_i2cspm_instances.h" @@ -22,6 +25,7 @@ #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" #include "sl_uartdrv_instances.h" @@ -72,6 +76,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -84,15 +89,18 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + sl_ot_sys_init(); } void sl_internal_app_init(void) { + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_custom_cli.c b/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_init.c b/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_init.h b/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/mgm24/BRD4318A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4318A/config/sl_gp_interface_config.h b/matter/efr32/mgm24/BRD4318A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/mgm24/BRD4318A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4318A/config/sl_openthread_features_config.h b/matter/efr32/mgm24/BRD4318A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/mgm24/BRD4318A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/mgm24/BRD4318A/config/sl_openthread_rtos_config.h b/matter/efr32/mgm24/BRD4318A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/mgm24/BRD4318A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4319A/autogen/sl_component_catalog.h b/matter/efr32/mgm24/BRD4319A/autogen/sl_component_catalog.h index 120451711a..7f4e16a931 100644 --- a/matter/efr32/mgm24/BRD4319A/autogen/sl_component_catalog.h +++ b/matter/efr32/mgm24/BRD4319A/autogen/sl_component_catalog.h @@ -31,12 +31,16 @@ #define SL_CATALOG_IOSTREAM_PRESENT #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_MEMORY_PROFILER_API_PRESENT +#define SL_CATALOG_MPU_PRESENT #define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_OT_GP_INTERFACE_PRESENT +#define SL_CATALOG_OPENTHREAD_STACK_PRESENT #define SL_CATALOG_POWER_MANAGER_PRESENT #define SL_CATALOG_PSA_CRYPTO_PRESENT #define SL_CATALOG_RAIL_LIB_PRESENT #define SL_CATALOG_RAIL_UTIL_PTI_PRESENT #define SL_CATALOG_SE_MANAGER_PRESENT +#define SL_CATALOG_SECURITY_MANAGER_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT #define SL_CATALOG_BTN0_PRESENT #define SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/matter/efr32/mgm24/BRD4319A/autogen/sl_event_handler.c b/matter/efr32/mgm24/BRD4319A/autogen/sl_event_handler.c index 8f85b99455..1c3e1e707b 100644 --- a/matter/efr32/mgm24/BRD4319A/autogen/sl_event_handler.c +++ b/matter/efr32/mgm24/BRD4319A/autogen/sl_event_handler.c @@ -12,13 +12,17 @@ #include "pa_conversions_efr32.h" #include "sl_rail_util_power_manager_init.h" #include "sl_rail_util_pti.h" +#include "sl_rail_util_rssi.h" #include "sl_board_control.h" #include "sl_bt_rtos_adaptation.h" +#include "platform-efr32.h" #include "sl_sleeptimer.h" +#include "sl_mpu.h" #include "gpiointerrupt.h" #include "sl_iostream_rtt.h" #include "sl_mbedtls.h" #include "nvm3_default.h" +#include "sl_ot_rtos_adaptation.h" #include "sl_simple_button_instances.h" #if defined(CONFIG_ENABLE_UART) #include "sl_uartdrv_instances.h" @@ -66,6 +70,7 @@ void sl_service_init(void) sl_board_configure_vcom(); sl_sleeptimer_init(); sl_hfxo_manager_init(); + sl_mpu_disable_execute_from_ram(); sl_mbedtls_init(); psa_crypto_init(); sli_aes_seed_mask(); @@ -78,15 +83,18 @@ void sl_stack_init(void) sl_rail_util_pa_init(); sl_rail_util_power_manager_init(); sl_rail_util_pti_init(); + sl_rail_util_rssi_init(); sl_bt_rtos_init(); + sl_ot_sys_init(); } void sl_internal_app_init(void) { + sl_ot_rtos_stack_init(); + sl_ot_rtos_app_init(); } void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); } - diff --git a/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_custom_cli.c b/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_custom_cli.c new file mode 100644 index 0000000000..47847a2308 --- /dev/null +++ b/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_custom_cli.c @@ -0,0 +1,61 @@ +/***************************************************************************//** + * @file + * @brief Custom CLI support for OpenThread + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include +#include +#include +#include "sl_ot_custom_cli.h" + +/******************************************************************************* + * Example syntax (.slcc or .slcp) for populating this file: + * + * template_contribution: + * - name: sl_ot_cli_command # Register a command + * value: + * name: status # Name of command + * handler: status_command # Function to be called. Must be defined + * + ******************************************************************************/ +extern otError bleCommand(void *aContext, uint8_t aArgsLength, char *aArgs[]); + +otCliCommand sl_ot_custom_commands[] = { +#ifdef SL_OPENTHREAD_BLE_CLI_ENABLE + {"ble", bleCommand}, +#endif + +}; + +// This is needed because `sizeof` is calculated at compile time and can't be calculated outside of this source file. +const uint8_t sl_ot_custom_commands_count = OT_ARRAY_LENGTH(sl_ot_custom_commands); + +void sl_ot_custom_cli_init(void) +{ + IgnoreError(otCliSetUserCommands(sl_ot_custom_commands, sl_ot_custom_commands_count, NULL)); +} diff --git a/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_init.c b/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_init.c new file mode 100644 index 0000000000..ee6f441a0c --- /dev/null +++ b/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_init.c @@ -0,0 +1,39 @@ +/***************************************************************************//** + * @file + * @brief OpenThread initialization. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_ot_init.h" + +void sl_ot_init(void) +{ + sl_ot_create_instance(); + sl_ot_sleep_init(); + sl_ot_cli_init(); + sl_ot_custom_cli_init(); +} \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_init.h b/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_init.h new file mode 100644 index 0000000000..c663079541 --- /dev/null +++ b/matter/efr32/mgm24/BRD4319A/autogen/sl_ot_init.h @@ -0,0 +1,41 @@ +/***************************************************************************//** + * @file + * @brief This generated header includes declaration of all functions required + * during initialization that must be defined by the OpenThread application. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_OT_INIT_H +#define SL_OT_INIT_H + +void sl_ot_init(void); +extern void sl_ot_create_instance(void); +extern void sl_ot_sleep_init(void); +extern void sl_ot_cli_init(void); +extern void sl_ot_custom_cli_init(void); + +#endif // SL_OT_INIT_H \ No newline at end of file diff --git a/matter/efr32/mgm24/BRD4319A/config/sl_debug_swo_config.h b/matter/efr32/mgm24/BRD4319A/config/sl_debug_swo_config.h deleted file mode 100644 index 34761be508..0000000000 --- a/matter/efr32/mgm24/BRD4319A/config/sl_debug_swo_config.h +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SWO configuration - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_DEBUG_SWO_CONFIG_H -#define SL_DEBUG_SWO_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu >>> - -// SWO Configuration - -// SWO Frequency -// Must be 875 kHz for communication with Silicon Labs debuggers -// Default: 875000 -#define SL_DEBUG_SWO_FREQ 875000 - -// Enable interrupt event trace -// Default: 0 -#define SL_DEBUG_SWO_SAMPLE_IRQ 0 - -// Enable Program Counter samples -// Default: 0 -#define SL_DEBUG_SWO_SAMPLE_PC 0 - -// SWO debug sample intervals -// <64=> 64 -// <128=> 128 -// <192=> 192 -// <256=> 256 -// <320=> 320 -// <384=> 384 -// <448=> 448 -// <512=> 512 -// <576=> 576 -// <640=> 640 -// <704=> 704 -// <768=> 768 -// <832=> 832 -// <896=> 896 -// <960=> 960 -// <1024=> 1024 -// <2048=> 2048 -// <3072=> 3072 -// <4096=> 4096 -// <5102=> 5102 -// <6144=> 6144 -// <7168=> 7168 -// <8192=> 8192 -// <9216=> 9216 -// <10240=> 10240 -// <11264=> 11264 -// <12288=> 12288 -// <13312=> 13312 -// <14336=> 14336 -// <15360=> 15360 -// Must be 64, 128, 192, [ n * 64 ], 1024, 2048, 3072, [ n * 1024 ] , 15360 -// Default: 15360 -#define SL_DEBUG_SWO_SAMPLE_INTERVAL 15360 -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_DEBUG -// $[GPIO_SL_DEBUG] -#define SL_DEBUG_PERIPHERAL GPIO - -#define SL_DEBUG_SWV_PORT gpioPortA -#define SL_DEBUG_SWV_PIN 3 -// [GPIO_SL_DEBUG]$ -// <<< sl:end pin_tool >>> - -#endif // SL_DEBUG_SWO_CONFIG_H diff --git a/matter/efr32/mgm24/BRD4319A/config/sl_gp_interface_config.h b/matter/efr32/mgm24/BRD4319A/config/sl_gp_interface_config.h new file mode 100644 index 0000000000..a937b58b9c --- /dev/null +++ b/matter/efr32/mgm24/BRD4319A/config/sl_gp_interface_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief OpenThread Green Power configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Rx Offset time +// The rx offset time for the bidirectional message. +// +#define GP_RX_OFFSET_IN_MICRO_SECONDS 21000 +// + +// TX Timeout +// Tx timeout after which the gp outgoing packet is invalid. +// +#define GP_TX_MAX_TIMEOUT_IN_MICRO_SECONDS 5000000 +// +// <<< end of configuration section >>> diff --git a/matter/efr32/mgm24/BRD4319A/config/sl_openthread_features_config.h b/matter/efr32/mgm24/BRD4319A/config/sl_openthread_features_config.h new file mode 100644 index 0000000000..2bfbbcc5e7 --- /dev/null +++ b/matter/efr32/mgm24/BRD4319A/config/sl_openthread_features_config.h @@ -0,0 +1,410 @@ +/***************************************************************************//** + * @file + * @brief OpenThread stack configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef _SL_OPENTHREAD_FEATURES_CONFIG_H +#define _SL_OPENTHREAD_FEATURES_CONFIG_H +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Default OpenThread Stack Configuration + +// Thread Stack Protocol Version +// +// Thread 1.1 +// Thread 1.2 +// Thread 1.3 +// Thread 1.4 +// Current Default: OT_THREAD_VERSION_1_3 +#ifndef OPENTHREAD_CONFIG_THREAD_VERSION +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 +#endif +// + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) +// The following features require at least Thread Stack Protocol Version 1.2 +// Backbone Router +#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 0 +#endif +// CSL Auto Synchronization using data polling +#ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#endif +// CSL (Coordinated Sampled Listening) Debug +#ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 +#endif +// CSL (Coordinated Sampled Listening) Receiver +#ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#endif +// CSL Scheduling Uncertainty (±10 us units) <12..999:1> +#ifndef SL_OPENTHREAD_CSL_TX_UNCERTAINTY +#if OPENTHREAD_RADIO + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 175 +#elif OPENTHREAD_FTD + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 20 +#else + #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 12 +#endif +#endif +// DUA (Domain Unicast Address) +#ifndef OPENTHREAD_CONFIG_DUA_ENABLE +#define OPENTHREAD_CONFIG_DUA_ENABLE 1 +#endif +// Link Metrics Initiator +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 +#endif +// Link Metrics Subject +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif +// Multicast Listener Registration +#ifndef OPENTHREAD_CONFIG_MLR_ENABLE +#define OPENTHREAD_CONFIG_MLR_ENABLE 1 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 + +#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3) +// The following features require at least Thread Stack Protocol Version 1.3 +// DNS Client +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 +#endif +// DNS-SD Server +#ifndef OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 +#endif +// Service Registration Protocol (SRP) Client +#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#endif +// Service Registration Protocol (SRP) Server +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_ENABLE +#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 +#endif +// TCPlp (Low power TCP over OpenThread) +#ifndef OPENTHREAD_CONFIG_TCP_ENABLE +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#endif +// DNS Client over TCP +#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE +#define OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0 +#endif +// Thread over Infrastructure (NCP only) +#ifndef OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE +#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE 0 +#endif +// +#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_3 + +// Border Agent +#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#endif +// +// Border Router +#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#endif +// +// Channel Manager +#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 +#endif +// +// Channel Monitor +#ifndef OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE +#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 +#endif +// + +// Commissioner +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#endif + +// Max Joiner Entries +// The maximum number of Joiner entries maintained by the Commissioner. +// 2 +#ifndef OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES +#define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 2 +#endif +// + +// COAP API +#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#endif +// +// COAP Observe (RFC7641) API +#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0 +#endif +// +// COAP Secure API +#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#endif +// +// DHCP6 Client +#ifndef OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#endif +// +// DHCP6 Server +#ifndef OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#endif +// +// Diagnostic +#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE +#define OPENTHREAD_CONFIG_DIAG_ENABLE 0 +#endif +// +// ECDSA (Elliptic Curve Digital Signature Algorithm) (Required for Matter support) +#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#endif +// +// External Heap +#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#endif +// +// IPv6 Fragmentation +#ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE +#define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0 +#endif +// +// Maximum number of IPv6 unicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif +// +// Maximum number of IPv6 multicast addresses allowed to be externally added +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 +#endif +// +// Jam Detection +#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE +#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0 +#endif +// +// Joiner +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif +// +// Link Raw Service +#ifndef OPENTHREAD_CONFIG_LINK_RAW_ENABLE +#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 0 +#endif +// +// MAC Filter +#ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 +#endif +// +// MLE Long Routes extension (experimental) +#ifndef OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE +#define OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE 0 +#endif +// +// MultiPAN RCP +#ifndef OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE +#define OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE 0 +#endif +// +// Multiple OpenThread Instances +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 +#endif +// +// Multiple Static Instance Support +#ifndef OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE +#define OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE 0 +#endif +// +// Number of OpenThread Instances For Static Buffer Allocation +#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_NUM 2 +#endif +// +// Define broadcast IID for spinel frames dedicated to all hosts in multipan configuration +#ifndef OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID +#define OPENTHREAD_SPINEL_CONFIG_BROADCAST_IID 0 +#endif +// +// OTNS (OpenThread Network Simulator) +#ifndef OPENTHREAD_CONFIG_OTNS_ENABLE +#define OPENTHREAD_CONFIG_OTNS_ENABLE 0 +#endif +// +// Ping Sender Module +#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +#endif + +// +// Power Calibration Module (RCP only configuration) +#ifndef OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE +#define OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE 0 +#endif + +// +// Platform UDP +#ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 +#endif +// +// Reference Device for Thread Test Harness +#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE +#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0 +#endif +// +// Service Entries in Thread Network Data +#ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0 +#endif +// +// RAM (volatile-only storage) +#ifndef OPENTHREAD_SETTINGS_RAM +#define OPENTHREAD_SETTINGS_RAM 0 +#endif +// +// SLAAC Addresses +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#endif +// +// SNTP Client +#ifndef OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE 0 +#endif +// +// TMF Network Diagnostic client API +#ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE +#define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE 1 +#endif +// +// Time Synchronization Service +#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 +// +// UDP Forward +#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#endif +// +// Enable Mac beacon payload parsing support +#ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE +#define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 1 +#endif +// +// Max raw power calibration length. +#ifndef SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH +#define SL_OPENTHREAD_RAW_POWER_CALIBRATION_LENGTH 4 +#endif +// +// Max FEM config setting length. +#ifndef SL_OPENTHREAD_FEM_SETTING_LENGTH +#define SL_OPENTHREAD_FEM_SETTING_LENGTH 4 +#endif +// +// The maximum number of RX buffers to use in the radio driver. +// 16 +#ifndef SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT +#define SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT 16 +#endif +// +// Logging +// LOG_OUTPUT +// NONE +// APP +// PLATFORM_DEFINED +// Default: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED +#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP +#endif + +// DYNAMIC_LOG_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE +#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0 +#endif + +// Enable Logging +#define OPENTHREAD_FULL_LOGS_ENABLE 0 +#if OPENTHREAD_FULL_LOGS_ENABLE + +// Note: Enabling higher log levels, which include logging packet details, can cause delays which may result in join failures. +// LOG_LEVEL +// NONE +// CRIT +// WARN +// NOTE +// INFO +// DEBG +// Default: OT_LOG_LEVEL_DEBG +#ifndef OPENTHREAD_CONFIG_LOG_LEVEL +#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG +#endif +// CLI +#ifndef OPENTHREAD_CONFIG_LOG_CLI +#define OPENTHREAD_CONFIG_LOG_CLI 1 +#endif +// PKT_DUMP +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif +// PLATFORM +#ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +#define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +#endif +// PREPEND_LEVEL +#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +#endif + +#endif // OPENTHREAD_FULL_LOGS_ENABLE + +// Log crash dump after initialization +#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0 +#endif +// + +// +// +// + +// <<< end of configuration section >>> +#endif // _SL_OPENTHREAD_FEATURES_CONFIG_H diff --git a/matter/efr32/mgm24/BRD4319A/config/sl_openthread_rtos_config.h b/matter/efr32/mgm24/BRD4319A/config/sl_openthread_rtos_config.h new file mode 100644 index 0000000000..fec9e853d2 --- /dev/null +++ b/matter/efr32/mgm24/BRD4319A/config/sl_openthread_rtos_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file + * @brief OpenThread RTOS configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread stack task priority +// Default: 24 (CMSIS-RTOS2 osPriorityNormal) +// Defines OpenThread stack task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_STACK_TASK_PRIORITY (24) + +// +// Priority Configuration for OpenThread App Task +// OpenThread task priority +// Default: 23 (CMSIS-RTOS2 osPriorityBelowNormal7) +// Defines OpenThread App task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_APP_TASK_PRIORITY (23) + +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread stack task stack size in bytes <1000-20000> +// Default: 4608 +// Defines the stack size of the OpenThread RTOS stack task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_STACK_TASK_MEM_SIZE 4608 + +// OpenThread app task stack size in bytes <1000-20000> +// Default: 4096 +// Defines the stack size of the OpenThread RTOS app task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_APP_TASK_MEM_SIZE 4608 + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_CLI_TASK_MEM_SIZE 2048 +// +// Priority Configuration for OpenThread RTOS Stack Task +// OpenThread CLI task prority +// Default: 16 (CMSIS-RTOS2 osPriorityBelowNormal) +// Defines OpenThread CLI task priority. This must be a valid priority value +// from CMSIS-RTOS2 osPriority_t definition. +#define SL_OPENTHREAD_RTOS_CLI_TASK_PRIORITY (16) + +// OpenThread CLI task stack size in bytes <1000-20000> +// Default: 2048 +// Defines the stack size of the OpenThread RTOS CLI task. The value is in bytes and +// and will be word aligned when it is applied at the task creation. +#define SL_OPENTHREAD_OS_CLI_TASK_SIZE 2048 + +// +// App Task +// Enable default App task +// Default: On +#define SL_OPENTHREAD_ENABLE_APP_TASK 0 + +// +// CLI Task +// Enable CLI task +// Default: On +#define SL_OPENTHREAD_ENABLE_CLI_TASK 0 + +// +// <<< end of configuration section >>>