Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NXP][k32w1] Rework reference apps #34926

Merged
merged 52 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
432a3d5
[NXP][platform][common] Update pw RPC flag in streamer_nxp
marius-alex-tache Apr 26, 2024
61e1ed1
[NXP][examples][common] Fix binding issue due to generated Zap flag r…
Martin-NXP Mar 11, 2024
17d3fcd
[NXP][examples][common] make-pretty update
dinabenamar Mar 21, 2024
7d8b409
[NXP][examples][common] Fix contact-sensor-app always returning empty…
marian-chereji-nxp Apr 17, 2024
52050ce
[NXP][examples][common] Call init using the base class reference
marius-alex-tache Mar 7, 2024
7ab8b46
[NXP][examples][common] Update app task common code
marius-alex-tache Mar 13, 2024
49f046f
[NXP][examples][common] Add additional common components
marius-alex-tache Mar 11, 2024
fb11017
[NXP][examples][common] Add missing header in Identify
marius-alex-tache Apr 25, 2024
620f5b3
[NXP][examples][common] Add multi-image OTA requestor initiator
marius-alex-tache Apr 25, 2024
0cdbd93
[NXP][examples][common] Update pw RPC implementation
marius-alex-tache Apr 26, 2024
8497a83
[NXP][examples][common] Small updates to common app code
marius-alex-tache May 8, 2024
20e3f0c
[NXP][examples][common] Make Animate pure virtual
marius-alex-tache May 20, 2024
e99c091
[NXP][examples][common] Add pw RPC init
marius-alex-tache May 21, 2024
c711556
[NXP][examples][common] Allow platforms to redefine the path to the F…
dinabenamar Apr 19, 2024
04549f1
[NXP][examples][common] Add TestEventTriggerDelegate
andrei-menzopol Jun 13, 2024
2c80ef5
[NXP][examples][common] Minor updates for some components
marius-alex-tache Jul 19, 2024
a01f2e0
[NXP][examples][common] Add initial version of lighting app
marius-alex-tache Apr 25, 2024
90f9450
[NXP][examples][common] Add initial version of contact sensor
marius-alex-tache Jul 19, 2024
701c801
[NXP][openthread][k32w1] Update mbedtls target
marius-alex-tache Jun 27, 2024
76b82ae
[NXP][platform][k32w] OTA/FactoryData changes
andrei-menzopol Apr 19, 2024
59a8fbf
[NXP][platform][k32w1] SDK 2.15 platform updates
andrei-menzopol Feb 23, 2024
2f20b3d
[NXP][platform][k32w1] Add "chip_key_storage" solution selector and l…
marian-chereji-nxp Feb 29, 2024
35976e6
[NXP][platform][k32w1] Add Zephyr NVS based key storage build option
marian-chereji-nxp Feb 28, 2024
5286a60
[NXP][examples][k32w1] App updates
marius-alex-tache Jun 26, 2024
2ff7754
[NXP][examples][k32w1] Update ZclCallbacks after transition to common…
marius-alex-tache Jul 19, 2024
f67e410
[NXP][k32w1] Remove k32w parent folder
marius-alex-tache Jul 19, 2024
91810b4
[NXP][platform][k32w1] Add FactoryDataDriver implementation
marius-alex-tache Jul 19, 2024
6d0de7b
[NXP][platform][k32w] Remove k32w/common
marius-alex-tache Jul 11, 2024
6ef126c
[NXP][scripts] Minor updates for NXP related scripts
marius-alex-tache Jun 27, 2024
d74e6d9
[NXP][platform][common] Add nxp_factory_data, nxp_ota gn targets
marius-alex-tache Feb 7, 2024
0e505b3
[NXP][platform][common] Create NXPConfigNVS.cpp file, remove NXPConfi…
Martin-NXP Feb 29, 2024
2498362
[NXP] revert mcxw71 headers
marius-alex-tache Aug 12, 2024
0659f55
[NXP][k32w1] Add default logging target
marius-alex-tache Aug 12, 2024
8365373
[NXP][k32w1] Update paths to reference nxp_matter_support
marius-alex-tache Aug 12, 2024
3eee1ac
[NXP] Bump nxp_matter_support
marius-alex-tache Aug 12, 2024
331c1de
Restyled by whitespace
restyled-commits Aug 12, 2024
1a1c128
Restyled by clang-format
restyled-commits Aug 12, 2024
06fb4d0
Restyled by gn
restyled-commits Aug 12, 2024
34c5e39
Restyled by prettier-markdown
restyled-commits Aug 12, 2024
8afe39b
Restyled by autopep8
restyled-commits Aug 12, 2024
6bf2a79
Restyled by isort
restyled-commits Aug 12, 2024
1ce6752
[NXP][k32w1] Fix gn import order
marius-alex-tache Aug 12, 2024
e0b5178
[NXP][k32w1] Fix wrong README reference
marius-alex-tache Aug 12, 2024
f9afafd
[NXP][k32w1] Update workflow docker image
marius-alex-tache Aug 12, 2024
e43140b
[NXP][rw61x] Adding nxp_ota and nxp_factory_data as they are now mand…
chapongatien Jul 17, 2024
2e62c7c
[NXP][platform][common] Fix build warning
yeaissa May 21, 2024
64f2686
Restyled by gn
restyled-commits Aug 12, 2024
29c29ec
[NXP][platform] Remove deprecated files
marius-alex-tache Aug 13, 2024
983ac33
[NXP][workflow] Create separate jobs for k32w0/k32w1
marius-alex-tache Aug 13, 2024
a31bd00
[NXP][k32w0] Adding nxp_ota and nxp_factory_data as they are now mand…
marius-alex-tache Jul 18, 2024
1c2025c
[NXP][scripts] Fix script issue when there is no --args
Martin-NXP Jul 31, 2024
084b400
[NXP][k32w1] Disable SMU2
marius-alex-tache Aug 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 54 additions & 10 deletions .github/workflows/examples-nxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:
k32w:
name: K32W
k32w0:
name: K32W0

env:
BUILD_TYPE: gn_k32w
Expand All @@ -39,7 +39,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-k32w:66
image: ghcr.io/project-chip/chip-build-k32w:71
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -66,8 +66,6 @@ jobs:
--target nxp-k32w0-freertos-contact-sensor \
--target nxp-k32w0-freertos-contact-sensor-low-power \
--target nxp-k32w0-freertos-contact-sensor-low-power-factory \
--target nxp-k32w1-freertos-lighting \
--target nxp-k32w1-freertos-contact-sensor-low-power \
build \
--copy-artifacts-to out/artifacts \
"
Expand All @@ -77,16 +75,62 @@ jobs:
nxp k32w0+release light \
out/artifacts/nxp-k32w0-freertos-lighting/chip-k32w0x-light-example.elf \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w1+release light \
out/artifacts/nxp-k32w1-freertos-lighting/chip-k32w1-light-example.elf \
/tmp/bloat_reports/
- name: Get contact sensor size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w0+release contact \
out/artifacts/nxp-k32w0-freertos-contact-sensor-low-power/chip-k32w0x-contact-example.elf \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: ./.github/actions/upload-size-reports
if: ${{ !env.ACT }}
with:
platform-name: K32W0
k32w1:
name: K32W1

env:
BUILD_TYPE: gn_k32w

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-nxp:71
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: nxp
extra-submodule-parameters: --recursive

- name: Set up environment for size reports
uses: ./.github/actions/setup-size-reports
if: ${{ !env.ACT }}
with:
gh-context: ${{ toJson(github) }}

- name: Build examples
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target nxp-k32w1-freertos-lighting \
--target nxp-k32w1-freertos-contact-sensor-low-power \
build \
--copy-artifacts-to out/artifacts \
"
- name: Get lighting app size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w1+release light \
out/artifacts/nxp-k32w1-freertos-lighting/chip-k32w1-light-example.elf \
/tmp/bloat_reports/
- name: Get contact sensor size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w1+release contact \
out/artifacts/nxp-k32w1-freertos-contact-sensor-low-power/chip-k32w1-contact-example.elf \
Expand All @@ -95,7 +139,7 @@ jobs:
uses: ./.github/actions/upload-size-reports
if: ${{ !env.ACT }}
with:
platform-name: K32W
platform-name: K32W1
rw61x:
name: RW61X

Expand Down
53 changes: 53 additions & 0 deletions examples/contact-sensor-app/nxp/common/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "AppTask.h"

#if CONFIG_LOW_POWER
#include "PWR_Interface.h"
#endif

#include <platform/CHIPDeviceLayer.h>

void ContactSensorApp::AppTask::PreInitMatterStack()
{
ChipLogProgress(DeviceLayer, "Welcome to NXP Contact Sensor Demo App");
}

#if CONFIG_LOW_POWER
void ContactSensorApp::AppTask::AppMatter_DisallowDeviceToSleep()
{
PWR_DisallowDeviceToSleep();
}

void ContactSensorApp::AppTask::AppMatter_AllowDeviceToSleep()
{
PWR_AllowDeviceToSleep();
}
#endif

ContactSensorApp::AppTask & ContactSensorApp::AppTask::GetDefaultInstance()
{
static ContactSensorApp::AppTask sAppTask;
return sAppTask;
}

chip::NXP::App::AppTaskBase & chip::NXP::App::GetAppTask()
{
return ContactSensorApp::AppTask::GetDefaultInstance();
}
69 changes: 69 additions & 0 deletions examples/contact-sensor-app/nxp/common/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <lib/support/logging/CHIPLogging.h>

#include "DeviceCallbacks.h"
#if CONFIG_ENABLE_FEEDBACK
#include "UserInterfaceFeedback.h"
#endif

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/EventLogging.h>

using namespace ::chip;
using namespace ::chip::app::Clusters;

void logBooleanStateEvent(bool state)
{
chip::EventNumber eventNumber;
chip::app::Clusters::BooleanState::Events::StateChange::Type event{ state };
if (CHIP_NO_ERROR != chip::app::LogEvent(event, 1, eventNumber))
{
ChipLogProgress(Zcl, "booleanstate: failed to reacord state-change event");
}
}

void ContactSensorApp::DeviceCallbacks::PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
chip::AttributeId attributeId, uint8_t type, uint16_t size,
uint8_t * value)
{
if (clusterId == BooleanState::Id)
{
if (attributeId != BooleanState::Attributes::StateValue::Id)
{
ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(attributeId));
return;
}
#if CONFIG_ENABLE_FEEDBACK
FeedbackMgr().RestoreState();
#endif
logBooleanStateEvent(static_cast<bool>(*value));
}
else
{
ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(attributeId));
}
}

chip::DeviceManager::CHIPDeviceManagerCallbacks & chip::NXP::App::GetDeviceCallbacks()
{
static ContactSensorApp::DeviceCallbacks sDeviceCallbacks;
return sDeviceCallbacks;
}
38 changes: 38 additions & 0 deletions examples/contact-sensor-app/nxp/common/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <app-common/zap-generated/cluster-objects.h>
#include <lib/support/logging/CHIPLogging.h>

#if CONFIG_ENABLE_FEEDBACK
#include "UserInterfaceFeedback.h"
#endif

/** @brief BooleanState Cluster Init
*
* This function is called when a specific cluster is initialized. It gives the
* application an opportunity to take care of cluster initialization procedures.
* It is called exactly once for each endpoint where cluster is present.
*/
void emberAfBooleanStateClusterInitCallback(chip::EndpointId endpoint)
{
ChipLogProgress(Zcl, "emberAfBooleanStateClusterInitCallback\n");
#if CONFIG_ENABLE_FEEDBACK
FeedbackMgr().RestoreState();
#endif
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,16 +16,12 @@
* limitations under the License.
*/

#include "DefaultTestEventTriggerDelegate.h"
#pragma once

#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
struct AppEvent;
typedef void (*EventHandler)(const AppEvent &);

namespace chip {

bool DefaultTestEventTriggerDelegate::DoesEnableKeyMatch(const ByteSpan & enableKey) const
struct AppEvent
{
return !mEnableKey.empty() && mEnableKey.data_equal(enableKey);
}

} // namespace chip
EventHandler Handler;
};
50 changes: 50 additions & 0 deletions examples/contact-sensor-app/nxp/common/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "AppConfig.h"
#include "AppTaskFreeRTOS.h"

#include <platform/CHIPDeviceLayer.h>

namespace ContactSensorApp {

class AppTask : public chip::NXP::App::AppTaskFreeRTOS
{
public:
// AppTaskFreeRTOS virtual methods
void PreInitMatterStack() override;
#if CONFIG_LOW_POWER
void AppMatter_DisallowDeviceToSleep() override;
void AppMatter_AllowDeviceToSleep() override;
#endif

// This returns an instance of this class.
static AppTask & GetDefaultInstance();
};

} // namespace ContactSensorApp

/**
* Returns the application-specific implementation of the AppTaskBase object.
*
* Applications can use this to gain access to features of the AppTaskBase
* that are specific to the selected application.
*/
chip::NXP::App::AppTaskBase & GetAppTask();
Loading
Loading