Skip to content

Commit 345a29d

Browse files
authored
Merge branch 'master' into feature/unittest--transport-tests
2 parents db33f68 + 062e063 commit 345a29d

File tree

121 files changed

+7265
-4943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+7265
-4943
lines changed

.github/workflows/darwin.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ jobs:
8383
-enableUndefinedBehaviorSanitizer YES
8484
- flavor: tsan
8585
arguments: -enableThreadSanitizer YES
86+
# "leaks" does not seem to be very compatible with asan or tsan
87+
- flavor: leaks
88+
defines: ENABLE_LEAK_DETECTION=1
8689
steps:
8790
- name: Checkout
8891
uses: actions/checkout@v4

.pullapprove.yml

+8
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ groups:
173173
teams: [reviewers-samsung]
174174
reviews:
175175
request: 10
176+
shared-reviewers-eve:
177+
type: optional
178+
conditions:
179+
- files.include('*')
180+
reviewers:
181+
teams: [reviewers-eve]
182+
reviews:
183+
request: 10
176184
# shared-reviewers-signify disabled for now, because the reviewers-signify
177185
# team is empty and pullapprove seems to mis-handle that badly and treats
178186
# _all_ reviewers as being in this group.

build/config/linux/pkg-config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def GetPkgConfigPrefixToStrip(options, args):
9999
# from pkg-config's |prefix| variable.
100100
prefix = subprocess.check_output([options.pkg_config,
101101
"--variable=prefix"] + args, env=os.environ).decode('utf-8')
102-
if prefix[-4] == '/usr':
102+
if prefix[:4] == '/usr':
103103
return prefix[4:]
104104
return prefix
105105

examples/air-purifier-app/ameba/main/chipinterface.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#include <platform/CHIPDeviceLayer.h>
3838
#include <setup_payload/ManualSetupPayloadGenerator.h>
3939
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
40+
#if CONFIG_ENABLE_AMEBA_CRYPTO
41+
#include <platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h>
42+
#endif
4043

4144
#include <lwip_netconf.h>
4245

@@ -130,6 +133,12 @@ static void InitServer(intptr_t context)
130133
// Init ZCL Data Model and CHIP App Server
131134
static chip::CommonCaseDeviceServerInitParams initParams;
132135
(void) initParams.InitializeStaticResourcesBeforeServerInit();
136+
#if CONFIG_ENABLE_AMEBA_CRYPTO
137+
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
138+
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
139+
VerifyOrDie((sAmebaPersistentStorageOpKeystore.Init(initParams.persistentStorageDelegate)) == CHIP_NO_ERROR);
140+
initParams.operationalKeystore = &sAmebaPersistentStorageOpKeystore;
141+
#endif
133142
chip::Server::GetInstance().Init(initParams);
134143
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
135144
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

examples/all-clusters-app/ameba/main/chipinterface.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
#include <microwave-oven-device.h>
4242
#include <platform/Ameba/AmebaConfig.h>
4343
#include <platform/Ameba/NetworkCommissioningDriver.h>
44+
#if CONFIG_ENABLE_AMEBA_CRYPTO
45+
#include <platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h>
46+
#endif
4447
#include <platform/CHIPDeviceLayer.h>
4548
#include <setup_payload/ManualSetupPayloadGenerator.h>
4649
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
@@ -153,6 +156,13 @@ static void InitServer(intptr_t context)
153156

154157
initParams.InitializeStaticResourcesBeforeServerInit();
155158

159+
#if CONFIG_ENABLE_AMEBA_CRYPTO
160+
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
161+
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
162+
VerifyOrDie((sAmebaPersistentStorageOpKeystore.Init(initParams.persistentStorageDelegate)) == CHIP_NO_ERROR);
163+
initParams.operationalKeystore = &sAmebaPersistentStorageOpKeystore;
164+
#endif
165+
156166
chip::Server::GetInstance().Init(initParams);
157167
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
158168
// TODO: Use our own DeviceInfoProvider

examples/bridge-app/linux/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ assert(chip_build_tools)
2020

2121
executable("chip-bridge-app") {
2222
sources = [
23+
"${chip_root}/examples/bridge-app/bridge-common/include/CHIPProjectAppConfig.h",
2324
"${chip_root}/examples/bridge-app/linux/bridged-actions-stub.cpp",
24-
"${chip_root}/examples/tv-app/tv-common/include/CHIPProjectAppConfig.h",
2525
"Device.cpp",
2626
"include/Device.h",
2727
"include/main.h",

examples/light-switch-app/ameba/main/chipinterface.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#include <lib/core/ErrorStr.h>
3535
#include <platform/Ameba/AmebaConfig.h>
3636
#include <platform/Ameba/NetworkCommissioningDriver.h>
37+
#if CONFIG_ENABLE_AMEBA_CRYPTO
38+
#include <platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h>
39+
#endif
3740
#include <platform/CHIPDeviceLayer.h>
3841
#include <setup_payload/ManualSetupPayloadGenerator.h>
3942
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
@@ -100,6 +103,12 @@ static void InitServer(intptr_t context)
100103
// Init ZCL Data Model and CHIP App Server
101104
static chip::CommonCaseDeviceServerInitParams initParams;
102105
initParams.InitializeStaticResourcesBeforeServerInit();
106+
#if CONFIG_ENABLE_AMEBA_CRYPTO
107+
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
108+
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
109+
VerifyOrDie((sAmebaPersistentStorageOpKeystore.Init(initParams.persistentStorageDelegate)) == CHIP_NO_ERROR);
110+
initParams.operationalKeystore = &sAmebaPersistentStorageOpKeystore;
111+
#endif
103112
chip::Server::GetInstance().Init(initParams);
104113
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
105114
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

examples/light-switch-app/light-switch-common/light-switch-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -2792,7 +2792,7 @@ endpoint 0 {
27922792
callback attribute acceptedCommandList;
27932793
callback attribute attributeList;
27942794
ram attribute featureMap default = 0x0B;
2795-
ram attribute clusterRevision default = 1;
2795+
ram attribute clusterRevision default = 2;
27962796

27972797
handle command SetUTCTime;
27982798
handle command SetTrustedTimeSource;

examples/light-switch-app/light-switch-common/light-switch-app.zap

+1-1
Original file line numberDiff line numberDiff line change
@@ -3826,7 +3826,7 @@
38263826
"storageOption": "RAM",
38273827
"singleton": 0,
38283828
"bounded": 0,
3829-
"defaultValue": "1",
3829+
"defaultValue": "2",
38303830
"reportable": 1,
38313831
"minInterval": 1,
38323832
"maxInterval": 65534,

examples/lighting-app/ameba/main/chipinterface.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
#include <lib/core/ErrorStr.h>
3636
#include <platform/Ameba/AmebaConfig.h>
3737
#include <platform/Ameba/NetworkCommissioningDriver.h>
38+
#if CONFIG_ENABLE_AMEBA_CRYPTO
39+
#include <platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h>
40+
#endif
41+
#include <lwip_netconf.h>
3842
#include <platform/CHIPDeviceLayer.h>
3943
#include <setup_payload/ManualSetupPayloadGenerator.h>
4044
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4145

42-
#include <lwip_netconf.h>
43-
4446
#if CONFIG_ENABLE_PW_RPC
4547
#include "Rpc.h"
4648
#endif
@@ -121,6 +123,12 @@ static void InitServer(intptr_t context)
121123
// Init ZCL Data Model and CHIP App Server
122124
static chip::CommonCaseDeviceServerInitParams initParams;
123125
(void) initParams.InitializeStaticResourcesBeforeServerInit();
126+
#if CONFIG_ENABLE_AMEBA_CRYPTO
127+
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
128+
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
129+
VerifyOrDie((sAmebaPersistentStorageOpKeystore.Init(initParams.persistentStorageDelegate)) == CHIP_NO_ERROR);
130+
initParams.operationalKeystore = &sAmebaPersistentStorageOpKeystore;
131+
#endif
124132
chip::Server::GetInstance().Init(initParams);
125133
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
126134
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

examples/platform/silabs/MatterConfig.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
240240
#endif
241241

242242
#ifdef HEAP_MONITORING
243-
MemMonitoring::startHeapMonitoring();
243+
MemMonitoring::StartMonitor();
244244
#endif
245245

246246
//==============================================

examples/platform/silabs/MemMonitoring.cpp

+54-56
Original file line numberDiff line numberDiff line change
@@ -19,93 +19,91 @@
1919
#include "MemMonitoring.h"
2020

2121
#include "AppConfig.h"
22-
#include "FreeRTOS.h"
22+
#include <cmsis_os2.h>
2323
#include <platform/CHIPDeviceLayer.h>
24+
#include <sl_cmsis_os2_common.h>
2425

25-
#define BLE_STACK_TASK_NAME "Bluetooth stack"
26-
#define BLE_LINK_TASK_NAME "Bluetooth linklayer"
26+
namespace chip {
27+
namespace DeviceLayer {
28+
namespace Silabs {
2729

28-
static StackType_t monitoringStack[MONITORING_STACK_SIZE_byte / sizeof(StackType_t)];
29-
static StaticTask_t monitoringTaskStruct;
30+
static osThreadId_t sMonitorThreadHandle;
31+
constexpr uint32_t kMonitorTaskSize = 1024;
32+
static uint8_t monitorStack[kMonitorTaskSize];
33+
static osThread_t sMonitorTaskControlBlock;
34+
constexpr osThreadAttr_t kMonitorTaskAttr = { .name = "MemMonitor",
35+
.attr_bits = osThreadDetached,
36+
.cb_mem = &sMonitorTaskControlBlock,
37+
.cb_size = osThreadCbSize,
38+
.stack_mem = monitorStack,
39+
.stack_size = kMonitorTaskSize,
40+
.priority = osPriorityLow };
3041

3142
size_t nbAllocSuccess = 0;
3243
size_t nbFreeSuccess = 0;
3344
size_t largestBlockAllocated = 0;
3445

35-
void MemMonitoring::startHeapMonitoring()
46+
void MemMonitoring::StartMonitor()
3647
{
37-
xTaskCreateStatic(HeapMonitoring, "Monitoring", MONITORING_STACK_SIZE_byte / sizeof(StackType_t), NULL, 1, monitoringStack,
38-
&monitoringTaskStruct);
48+
sMonitorThreadHandle = osThreadNew(MonitorTask, nullptr, &kMonitorTaskAttr);
3949
}
4050

41-
void MemMonitoring::HeapMonitoring(void * pvParameter)
51+
void MemMonitoring::MonitorTask(void * pvParameter)
4252
{
53+
uint32_t threadCount = osThreadGetCount();
4354

44-
UBaseType_t appTaskValue;
45-
UBaseType_t bleEventTaskValue;
46-
UBaseType_t bleTaskValue;
47-
UBaseType_t linkLayerTaskValue;
48-
UBaseType_t openThreadTaskValue;
49-
UBaseType_t eventLoopTaskValue;
50-
51-
TaskHandle_t eventLoopHandleStruct = xTaskGetHandle(CHIP_DEVICE_CONFIG_CHIP_TASK_NAME);
52-
TaskHandle_t otTaskHandle = xTaskGetHandle(CHIP_DEVICE_CONFIG_THREAD_TASK_NAME);
53-
TaskHandle_t appTaskHandle = xTaskGetHandle(APP_TASK_NAME);
54-
TaskHandle_t bleStackTaskHandle = xTaskGetHandle(BLE_STACK_TASK_NAME);
55-
TaskHandle_t bleLinkTaskHandle = xTaskGetHandle(BLE_LINK_TASK_NAME);
56-
TaskHandle_t bleEventTaskHandle = xTaskGetHandle(CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME);
57-
58-
#if CHIP_SYSTEM_CONFIG_USE_LWIP
59-
UBaseType_t lwipTaskValue;
60-
TaskHandle_t lwipHandle = xTaskGetHandle(TCPIP_THREAD_NAME);
61-
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
55+
osThreadId_t * threadIdTable = new osThreadId_t[threadCount];
56+
// Forms a table of the active thread ids
57+
osThreadEnumerate(threadIdTable, threadCount);
6258

6359
while (true)
6460
{
65-
appTaskValue = uxTaskGetStackHighWaterMark(appTaskHandle);
66-
bleEventTaskValue = uxTaskGetStackHighWaterMark(bleEventTaskHandle);
67-
bleTaskValue = uxTaskGetStackHighWaterMark(bleStackTaskHandle);
68-
linkLayerTaskValue = uxTaskGetStackHighWaterMark(bleLinkTaskHandle);
69-
openThreadTaskValue = uxTaskGetStackHighWaterMark(otTaskHandle);
70-
eventLoopTaskValue = uxTaskGetStackHighWaterMark(eventLoopHandleStruct);
71-
#if CHIP_SYSTEM_CONFIG_USE_LWIP
72-
lwipTaskValue = uxTaskGetStackHighWaterMark(lwipHandle);
73-
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
7461

7562
SILABS_LOG("=============================");
76-
SILABS_LOG(" ");
77-
SILABS_LOG("Largest Block allocated 0x%x", largestBlockAllocated);
78-
SILABS_LOG("Number Of Successful Alloc 0x%x", nbAllocSuccess);
79-
SILABS_LOG("Number Of Successful Frees 0x%x", nbFreeSuccess);
80-
SILABS_LOG(" ");
81-
SILABS_LOG("App Task most bytes ever Free 0x%x", (appTaskValue * 4));
82-
SILABS_LOG("BLE Event most bytes ever Free 0x%x", (bleEventTaskValue * 4));
83-
SILABS_LOG("BLE Stack most bytes ever Free 0x%x", (bleTaskValue * 4));
84-
SILABS_LOG("Link Layer Task most bytes ever Free 0x%x", (linkLayerTaskValue * 4));
85-
SILABS_LOG("OpenThread Task most bytes ever Free 0x%x", (openThreadTaskValue * 4));
86-
SILABS_LOG("Event Loop Task most bytes ever Free 0x%x", (eventLoopTaskValue * 4));
87-
#if CHIP_SYSTEM_CONFIG_USE_LWIP
88-
SILABS_LOG("LWIP Task most bytes ever Free 0x%x", (lwipTaskValue * 4));
89-
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
90-
SILABS_LOG(" ");
63+
SILABS_LOG(" ");
64+
SILABS_LOG("Largest Block allocated %lu B", largestBlockAllocated);
65+
SILABS_LOG("Number Of Successful Alloc %lu", nbAllocSuccess);
66+
SILABS_LOG("Number Of Successful Frees %lu", nbFreeSuccess);
67+
SILABS_LOG(" ");
68+
69+
SILABS_LOG("Thread stack highwatermark ");
70+
for (uint8_t tIdIndex = 0; tIdIndex < threadCount; tIdIndex++)
71+
{
72+
osThreadId_t tId = threadIdTable[tIdIndex];
73+
if (tId != sMonitorThreadHandle) // don't print stats for this current debug thread.
74+
{
75+
// The smallest amount of free stack space there has been since the thread creation
76+
SILABS_LOG("\t%-10s : %6lu B", osThreadGetName(tId), osThreadGetStackSpace(tId));
77+
}
78+
}
79+
80+
SILABS_LOG(" ");
9181
SILABS_LOG("=============================");
92-
vTaskDelay(pdMS_TO_TICKS(5000));
82+
// run loop every 5 seconds
83+
osDelay(osKernelGetTickFreq() * 5);
9384
}
85+
86+
// will never get here. Still, free allocated memory before exiting
87+
delete threadIdTable;
9488
}
9589

90+
} // namespace Silabs
91+
} // namespace DeviceLayer
92+
} // namespace chip
93+
9694
extern "C" void memMonitoringTrackAlloc(void * ptr, size_t size)
9795
{
9896
if (ptr != NULL)
9997
{
100-
nbAllocSuccess++;
101-
if (largestBlockAllocated < size)
98+
chip::DeviceLayer::Silabs::nbAllocSuccess++;
99+
if (chip::DeviceLayer::Silabs::largestBlockAllocated < size)
102100
{
103-
largestBlockAllocated = size;
101+
chip::DeviceLayer::Silabs::largestBlockAllocated = size;
104102
}
105103
}
106104
}
107105

108106
extern "C" void memMonitoringTrackFree(void * ptr, size_t size)
109107
{
110-
nbFreeSuccess++;
108+
chip::DeviceLayer::Silabs::nbFreeSuccess++;
111109
}

examples/platform/silabs/MemMonitoring.h

+9-4
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,22 @@
1919
#pragma once
2020

2121
#ifdef HEAP_MONITORING
22-
#include "FreeRTOS.h"
2322

24-
#define MONITORING_STACK_SIZE_byte 1024
23+
namespace chip {
24+
namespace DeviceLayer {
25+
namespace Silabs {
2526

2627
class MemMonitoring
2728
{
2829
public:
29-
static void startHeapMonitoring();
30+
static void StartMonitor();
3031

3132
private:
32-
static void HeapMonitoring(void * pvParameter);
33+
static void MonitorTask(void * pvParameter);
3334
};
3435

36+
} // namespace Silabs
37+
} // namespace DeviceLayer
38+
} // namespace chip
39+
3540
#endif

examples/shell/shell_common/include/Globals.h

+2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
#include <protocols/secure_channel/MessageCounterManager.h>
2525
#include <transport/SessionHolder.h>
2626
#include <transport/SessionManager.h>
27+
#if INET_CONFIG_ENABLE_TCP_ENDPOINT
2728
#include <transport/raw/TCP.h>
29+
#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
2830
#include <transport/raw/UDP.h>
2931

3032
#if INET_CONFIG_ENABLE_TCP_ENDPOINT
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
49 : [Silabs] Update SDKs to new versions
1+
50 : [Telink] Update Docker image (Zephyr update)

integrations/docker/images/stage-2/chip-build-telink/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN set -x \
1212
&& : # last line
1313

1414
# Setup Zephyr
15-
ARG ZEPHYR_REVISION=047fe473eb7e407d9905c7f1f24533e12f534280
15+
ARG ZEPHYR_REVISION=68deadeb5c20b82d68700e720d4580e8003bf1d8
1616
WORKDIR /opt/telink/zephyrproject
1717
RUN set -x \
1818
&& python3 -m pip install -U --no-cache-dir west \

scripts/setup/constraints.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ colorama==0.4.6
4949
# west
5050
coloredlogs==15.0.1
5151
# via -r requirements.all.txt
52-
construct==2.10.54
52+
construct==2.10.70
5353
# via
5454
# -r requirements.esp32.txt
5555
# esp-coredump
@@ -208,7 +208,7 @@ python-socketio==4.6.1
208208
# via -r requirements.esp32.txt
209209
pytz==2022.7.1
210210
# via pandas
211-
pyyaml==6.0
211+
pyyaml==6.0.1
212212
# via
213213
# esptool
214214
# idf-component-manager
@@ -296,4 +296,3 @@ setuptools==68.0.0
296296
# Higher versions depend on proto-plus, which break
297297
# nanopb code generation (due to name conflict of the 'proto' module)
298298
google-api-core==2.17.0
299-

scripts/setup/requirements.esp32.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ reedsolo>=1.5.3,<=1.5.4
99
bitarray==2.6.0
1010
bitstring>=3.1.6,<4
1111
ecdsa>=0.16.0
12-
construct==2.10.54
12+
construct>=2.10.70
1313
python-socketio<5
1414
itsdangerous<2.1 ; python_version < "3.11"
1515
esp_idf_monitor==1.1.1

0 commit comments

Comments
 (0)