Skip to content

Commit 9468c2b

Browse files
committed
Merge branch 'master' of github.com:project-chip/connectedhomeip into tv2-5
2 parents bb769f9 + aa9f8e5 commit 9468c2b

File tree

126 files changed

+6767
-10118
lines changed

Some content is hidden

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

126 files changed

+6767
-10118
lines changed

.github/actions/bootstrap-cache/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Bootstrap cache
2-
description: Bootstrap cache
2+
description: Bootstrap cache (deprecated)
33
runs:
44
using: "composite"
55
steps:

.github/actions/bootstrap/action.yaml

+49-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,56 @@ inputs:
55
description: "Platform name"
66
required: false
77
default: none
8+
bootstrap-log-name:
9+
description: "Bootstrap log name"
10+
required: false
11+
default: bootstrap-logs-${{ github.job }}
12+
outputs:
13+
cache-hit:
14+
description: "Bootstrap environment was restored from cache"
15+
value: ${{ fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit }} # retry returns all outputs in `outputs`
16+
817
runs:
918
using: "composite"
1019
steps:
11-
- name: Bootstrap
20+
- name: Calculate bootstrap cache key
21+
id: bootstrap-cache-key
22+
shell: bash
23+
run: |
24+
# Calculate bootstrap cache key
25+
# In addition to the various setup files, the work directory matters as well,
26+
# because the bootstrapped Pigweed environment contains absolute paths.
27+
FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}"
28+
FINAL_HASH="$(echo "$PWD:$FILES_HASH" | shasum -a 256 | cut -d' ' -f1)"
29+
echo "Calculated bootstrap cache key for '$PWD': $FINAL_HASH"
30+
echo "hash=$FINAL_HASH" >> "$GITHUB_OUTPUT"
31+
32+
- uses: Wandalen/wretry.action@v1.4.10
33+
name: Bootstrap from cache
34+
id: bootstrap-cache
35+
continue-on-error: true
36+
with:
37+
action: buildjet/cache@v4
38+
attempt_limit: 3
39+
attempt_delay: 2000
40+
with: |
41+
key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.platform }}-${{ steps.bootstrap-cache-key.outputs.hash}}
42+
path: |
43+
.environment
44+
build_overrides/pigweed_environment.gni
45+
46+
- name: Run bootstrap
47+
if: fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true'
48+
env:
49+
PW_NO_CIPD_CACHE_DIR: Y
1250
shell: bash
13-
run: bash scripts/bootstrap.sh -p all,${{ inputs.platform }}
51+
run: source scripts/bootstrap.sh -p all,${{ inputs.platform }}
52+
53+
- name: Uploading bootstrap logs
54+
uses: actions/upload-artifact@v4
55+
if: always() && !env.ACT && fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true'
56+
with:
57+
name: ${{ inputs.bootstrap-log-name }}
58+
path: |
59+
.environment/gn_out/.ninja_log
60+
.environment/pigweed-venv/*.log

.github/actions/checkout-submodules-and-bootstrap/action.yaml

+1-8
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,14 @@ runs:
2626
with:
2727
platform: ${{ inputs.platform }}
2828
extra-parameters: ${{ inputs.extra-submodule-parameters }}
29-
- name: Bootstrap Cache
30-
uses: ./.github/actions/bootstrap-cache
3129
- name: Bootstrap
3230
uses: ./.github/actions/bootstrap
33-
env:
34-
PW_NO_CIPD_CACHE_DIR: Y
3531
with:
3632
platform: ${{ inputs.platform }}
33+
bootstrap-log-name: ${{ inputs.bootstrap-log-name }}
3734
- name: Dump disk info after checkout submodule & Bootstrap
3835
shell: bash
3936
run: scripts/dump_diskspace_info.sh
40-
- name: Upload Bootstrap Logs
41-
uses: ./.github/actions/upload-bootstrap-logs
42-
with:
43-
bootstrap-log-name: ${{ inputs.bootstrap-log-name }}
4437
- name: Work around TSAN ASLR issues
4538
if: runner.os == 'Linux' && !env.ACT
4639
shell: bash

.github/actions/upload-bootstrap-logs/action.yaml

-18
This file was deleted.

.github/workflows/cirque.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
with:
5858
platform: linux
5959

60+
# TODO: Is what's being cached here actually compatible with a regular bootstrap?
6061
- name: Bootstrap Cache
6162
uses: ./.github/actions/bootstrap-cache
6263
- name: Bootstrap Cirque

.github/workflows/examples-efr32.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
timeout-minutes: 30
6060
run: |
6161
scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker
62-
scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4164A --slc_generate --docker
6362
rm -rf ./out/
6463
- name: Build some BRD4187C variants (1)
6564
run: |
@@ -115,6 +114,7 @@ jobs:
115114
"./scripts/build/build_examples.py \
116115
--enable-flashbundle \
117116
--target efr32-brd4338a-light-wifi-917_soc-skip_rps_generation \
117+
--target efr32-brd4338a-lock-wifi-917_soc-skip_rps_generation \
118118
build \
119119
--copy-artifacts-to out/artifacts \
120120
"

.github/workflows/fuzzing-build.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,8 @@ jobs:
4646
run: |
4747
mkdir objdir-clone || true
4848
49-
- name: Bootstrap Cache
50-
uses: ./.github/actions/bootstrap-cache
5149
- name: Bootstrap
5250
uses: ./.github/actions/bootstrap
53-
- name: Upload Bootstrap Logs
54-
uses: ./.github/actions/upload-bootstrap-logs
5551

5652
- name: Build all-clusters-app
5753
run: |
@@ -84,12 +80,8 @@ jobs:
8480
run: |
8581
mkdir objdir-clone || true
8682
87-
- name: Bootstrap Cache
88-
uses: ./.github/actions/bootstrap-cache
8983
- name: Bootstrap
9084
uses: ./.github/actions/bootstrap
91-
- name: Upload Bootstrap Logs
92-
uses: ./.github/actions/upload-bootstrap-logs
9385

9486
- name: Build all-clusters-app
9587
run: |

.github/workflows/release_artifacts.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ jobs:
3939
uses: actions/checkout@v4
4040
with:
4141
ref: "${{ github.event.inputs.releaseTag }}"
42-
- name: Bootstrap Cache
43-
uses: ./.github/actions/bootstrap-cache
4442
- name: Bootstrap
4543
uses: ./.github/actions/bootstrap
46-
- name: Upload Bootstrap Logs
47-
uses: ./.github/actions/upload-bootstrap-logs
4844

4945
- name: Build
5046
run: scripts/examples/esp_example.sh all-clusters-app
@@ -74,12 +70,8 @@ jobs:
7470
uses: actions/checkout@v4
7571
with:
7672
ref: "${{ github.event.inputs.releaseTag }}"
77-
- name: Bootstrap Cache
78-
uses: ./.github/actions/bootstrap-cache
7973
- name: Bootstrap
8074
uses: ./.github/actions/bootstrap
81-
- name: Upload Bootstrap Logs
82-
uses: ./.github/actions/upload-bootstrap-logs
8375

8476
- name: Build example EFR32 Lock App
8577
run: scripts/examples/gn_silabs_example.sh examples/lock-app/efr32/

.github/workflows/spell.yml

-10
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ on:
2525
- ".github/.wordlist.txt"
2626

2727
jobs:
28-
# Seems redundant; removed as pyspelling is customized while this is not
29-
# check-reviewdog:
30-
# name: Check Spelling - reviewdog
31-
# runs-on: ubuntu-latest
32-
# steps:
33-
# - name: Checkout
34-
# uses: actions/checkout@v4
35-
# - uses: reviewdog/action-misspell@v1
36-
# with:
37-
# github_token: ${{ secrets.GITHUB_TOKEN }}
3828
check-spellcheck:
3929
name: Check Spelling - pyspelling
4030
runs-on: ubuntu-latest

.restyled.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ exclude:
7474
- "examples/chef/sample_app_util/test_files/*.yaml"
7575
- "examples/chef/zzz_generated/**/*"
7676
- "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*"
77+
- "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/*" # zap-generated files
7778
- "integrations/cloudbuild/*.yaml" # uglier long command line content
7879
- "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs
7980
- "scripts/tagging/tag_new_release.sh" # shellharden breaks parameter passing

docs/ci-cd/index.md

+9
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,14 @@ Work In Progress
3535
## Tools
3636

3737
- [Daily Fail Summary](tools/daily_fail_summary.md)
38+
- Spellcheck
39+
- Uses
40+
[`rojopolis`/spellcheck-github-actions](https://github.com/marketplace/actions/github-spellcheck-action#configuration),
41+
a PySpelling-based spellchecker
42+
- This tool utilizes the definitions in .spellcheck.yml and
43+
.github/`.wordlist.txt` to check all documentation files.
44+
.spellcheck.yml defines the settings while `.wordlist.txt` is a
45+
dictionary of words to skip checking (brand names, technical jargon,
46+
acronyms)
3847

3948
## General Improvement Ideas

examples/chef/common/clusters/wake-on-lan/WakeOnLanManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ std::string getMacAddress()
4141
}
4242

4343
char macStr[chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength * 2 + 1] = { 0 }; // added null char
44-
if (BytesToHex(&macBuffer[0], sizeof(macBuffer), &macStr[0], sizeof(macBuffer) * 2u, chip::Encoding::HexFlags::kUppercase) !=
44+
if (BytesToHex(mac.data(), mac.size(), &macStr[0], sizeof(macBuffer) * 2u, chip::Encoding::HexFlags::kUppercase) !=
4545
CHIP_NO_ERROR)
4646
{
4747
ChipLogProgress(Zcl, "WakeOnLanManager::getMacAddress hex conversion failed");

examples/chef/silabs/include/AppTask.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828

2929
#include "AppEvent.h"
3030
#include "BaseApplication.h"
31-
#include "FreeRTOS.h"
32-
#include "timers.h" // provides FreeRTOS timer support
3331
#include <ble/BLEEndPoint.h>
32+
#include <cmsis_os2.h>
3433
#include <lib/core/CHIPError.h>
3534
#include <platform/CHIPDeviceLayer.h>
3635

examples/chef/silabs/include/LightingManager.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323

2424
#include "AppEvent.h"
2525

26-
#include "FreeRTOS.h"
27-
#include "timers.h" // provides FreeRTOS timer support
28-
26+
#include <cmsis_os2.h>
2927
#include <lib/core/CHIPError.h>
3028

3129
class LightingManager
@@ -68,11 +66,12 @@ class LightingManager
6866
bool mAutoTurnOff;
6967
uint32_t mAutoTurnOffDuration;
7068
bool mAutoTurnOffTimerArmed;
69+
osTimerId_t mLightTimer;
7170

7271
void CancelTimer(void);
7372
void StartTimer(uint32_t aTimeoutMs);
7473

75-
static void TimerEventHandler(TimerHandle_t xTimer);
74+
static void TimerEventHandler(void * timerCbArg);
7675
static void AutoTurnOffTimerEventHandler(AppEvent * aEvent);
7776
static void ActuatorMovementTimerEventHandler(AppEvent * aEvent);
7877

examples/chef/silabs/src/AppTask.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ CHIP_ERROR AppTask::StartAppTask()
8181
void AppTask::AppTaskMain(void * pvParameter)
8282
{
8383
AppEvent event;
84-
QueueHandle_t sAppEventQueue = *(static_cast<QueueHandle_t *>(pvParameter));
84+
osMessageQueueId_t sAppEventQueue = *(static_cast<osMessageQueueId_t *>(pvParameter));
8585

8686
CHIP_ERROR err = sAppTask.Init();
8787
if (err != CHIP_NO_ERROR)
@@ -94,11 +94,11 @@ void AppTask::AppTaskMain(void * pvParameter)
9494

9595
while (true)
9696
{
97-
BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, pdMS_TO_TICKS(10));
98-
while (eventReceived == pdTRUE)
97+
osStatus_t eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, osWaitForever);
98+
while (eventReceived == osOK)
9999
{
100100
sAppTask.DispatchEvent(&event);
101-
eventReceived = xQueueReceive(sAppEventQueue, &event, 0);
101+
eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, 0);
102102
}
103103
}
104104
}

examples/chef/silabs/src/LightingManager.cpp

+17-30
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,20 @@
2121

2222
#include "AppConfig.h"
2323
#include "AppTask.h"
24-
#include <FreeRTOS.h>
2524

2625
LightingManager LightingManager::sLight;
2726

28-
TimerHandle_t sLightTimer;
29-
3027
CHIP_ERROR LightingManager::Init()
3128
{
32-
// Create FreeRTOS sw timer for light timer.
33-
sLightTimer = xTimerCreate("lightTmr", // Just a text name, not used by the RTOS kernel
34-
1, // == default timer period (mS)
35-
false, // no timer reload (==one-shot)
36-
(void *) this, // init timer id = light obj context
37-
TimerEventHandler // timer callback handler
38-
);
39-
40-
if (sLightTimer == NULL)
29+
// Create cmsis os sw timer for light timer.
30+
mLightTimer = osTimerNew(TimerEventHandler, // timer callback handler
31+
osTimerOnce, // no timer reload (one-shot timer)
32+
(void *) this, // pass the app task obj context
33+
NULL // No osTimerAttr_t to provide.
34+
35+
if (mLightTimer == NULL)
4136
{
42-
SILABS_LOG("sLightTimer timer create failed");
37+
SILABS_LOG("mLightTimer timer create failed");
4338
return APP_ERROR_CREATE_TIMER_FAILED;
4439
}
4540

@@ -123,38 +118,30 @@ bool LightingManager::InitiateAction(int32_t aActor, Action_t aAction)
123118

124119
void LightingManager::StartTimer(uint32_t aTimeoutMs)
125120
{
126-
if (xTimerIsTimerActive(sLightTimer))
127-
{
128-
SILABS_LOG("app timer already started!");
129-
CancelTimer();
130-
}
131-
132-
// timer is not active, change its period to required value (== restart).
133-
// FreeRTOS- Block for a maximum of 100 ticks if the change period command
134-
// cannot immediately be sent to the timer command queue.
135-
if (xTimerChangePeriod(sLightTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS)
121+
// Starts or restarts the function timer
122+
if (osTimerStart(mLightTimer, pdMS_TO_TICKS(aTimeoutMs)) != osOK)
136123
{
137-
SILABS_LOG("sLightTimer timer start() failed");
124+
SILABS_LOG("mLightTimer timer start() failed");
138125
appError(APP_ERROR_START_TIMER_FAILED);
139126
}
140127
}
141128

142129
void LightingManager::CancelTimer(void)
143130
{
144-
if (xTimerStop(sLightTimer, 0) == pdFAIL)
131+
if (osTimerStop(mLightTimer) == osError)
145132
{
146-
SILABS_LOG("sLightTimer stop() failed");
133+
SILABS_LOG("mLightTimer stop() failed");
147134
appError(APP_ERROR_STOP_TIMER_FAILED);
148135
}
149136
}
150137

151-
void LightingManager::TimerEventHandler(TimerHandle_t xTimer)
138+
void LightingManager::TimerEventHandler(void * timerCbArg)
152139
{
153-
// Get light obj context from timer id.
154-
LightingManager * light = static_cast<LightingManager *>(pvTimerGetTimerID(xTimer));
140+
// The callback argument is the light obj context assigned at timer creation.
141+
LightingManager * light = static_cast<LightingManager *>(timerCbArg);
155142

156143
// The timer event handler will be called in the context of the timer task
157-
// once sLightTimer expires. Post an event to apptask queue with the actual handler
144+
// once mLightTimer expires. Post an event to apptask queue with the actual handler
158145
// so that the event can be handled in the context of the apptask.
159146
AppEvent event;
160147
event.Type = AppEvent::kEventType_Timer;

examples/light-switch-app/silabs/include/AppTask.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828

2929
#include "AppEvent.h"
3030
#include "BaseApplication.h"
31-
#include "FreeRTOS.h"
32-
#include "timers.h" // provides FreeRTOS timer support
3331
#include <ble/BLEEndPoint.h>
32+
#include <cmsis_os2.h>
3433
#include <lib/core/CHIPError.h>
3534
#include <platform/CHIPDeviceLayer.h>
3635

0 commit comments

Comments
 (0)