Skip to content

Commit

Permalink
[Infineon] PSoC6 SVE2 Fixes for multiple test cases (#22646)
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenCY authored Sep 15, 2022
1 parent 3d33309 commit 822993c
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@
"esp32-m5stack-all-clusters-ipv6only",
"esp32-m5stack-all-clusters-rpc",
"esp32-m5stack-all-clusters-rpc-ipv6only",
"infineon-p6-all-clusters",
"infineon-p6-lock",
"infineon-p6-light",
"infineon-psoc6-all-clusters",
"infineon-psoc6-lock",
"infineon-psoc6-light",
"linux-arm64-all-clusters",
"linux-arm64-all-clusters-ipv6only",
"linux-arm64-chip-tool",
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/infineon_psoc6_software_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ Infineon PSoC6 example applications by passing the

```
$ scripts/build/build_examples.py --enable-flashbundle --target infineon-psoc6-lock-ota build
$ third_party/psoc6/psoc6_sdk/ota/ota_base_build.sh out/infineon-psoc6-lock-ota chip-psoc6-lock-example
$ third_party/infineon/psoc6/psoc6_sdk/ota/ota_base_build.sh out/infineon-psoc6-lock-ota chip-psoc6-lock-example
```

- Build the PSoC6 OTA Update application from the chip root dir and create OTA
file

```
$ scripts/build/build_examples.py --enable-flashbundle --no-log-timestamps --target infineon-psoc6-lock-ota-updateimage build
$ third_party/psoc6/psoc6_sdk/ota/ota_update_build.sh out/infineon-psoc6-lock-ota-updateimage chip-psoc6-lock-example
$ third_party/infineon/psoc6/psoc6_sdk/ota/ota_update_build.sh out/infineon-psoc6-lock-ota-updateimage chip-psoc6-lock-example
```

* Additionally a pre-compiled bootloader must be flashed to the board using
[Cypress Programmer](https://softwaretools.infineon.com/tools/com.ifx.tb.tool.cypressprogrammer).
This image can be found at:

$ ./third_party/psoc6/psoc6_sdk/ota/matter-psoc6-mcuboot-bootloader.hex
$ ./third_party/infineon/psoc6/psoc6_sdk/ota/matter-psoc6-mcuboot-bootloader.hex

* In a terminal start the Provider app passing to it the path to the Matter
OTA file created in the previous step:(output of ota_update_build step)
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ config("psoc6_ota_config") {

psoc6_sdk_sources("all_clusters_app_sdk_sources") {
include_dirs = [
"${chip_root}/src/platform/PSOC6",
"${chip_root}/src/platform/Infineon/PSOC6",
"${psoc6_project_dir}/include",
"${examples_plat_dir}",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION 43012

/* The SoftwareVersion attribute of the Basic cluster. */
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
#endif

// For convenience, Chip Security Test Mode can be enabled and the
// requirement for authentication in various protocols can be disabled.
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-minimal-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ config("psoc6_ota_config") {

psoc6_sdk_sources("all_clusters_app_sdk_sources") {
include_dirs = [
"${chip_root}/src/platform/PSOC6",
"${chip_root}/src/platform/Infineon/PSOC6",
"${psoc6_project_dir}/include",
"${examples_plat_dir}",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION 43012

/* The SoftwareVersion attribute of the Basic cluster. */
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
#endif

// For convenience, Chip Security Test Mode can be enabled and the
// requirement for authentication in various protocols can be disabled.
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ config("psoc6_ota_config") {

psoc6_sdk_sources("lighting_app_sdk_sources") {
include_dirs = [
"${chip_root}/src/platform/PSOC6",
"${chip_root}/src/platform/Infineon/PSOC6",
"${psoc6_project_dir}/include",
"${examples_plat_dir}",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION 43012

/* The SoftwareVersion attribute of the Basic cluster. */
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
#endif

/* define Device type based on the application */
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 257 // 0x0101 Dimmable Bulb
Expand Down
18 changes: 18 additions & 0 deletions examples/lighting-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <setup_payload/SetupPayload.h>

#include <DeviceInfoProviderImpl.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <platform/Infineon/PSOC6/NetworkCommissioningDriver.h>

Expand Down Expand Up @@ -120,6 +121,23 @@ void NetWorkCommissioningInstInit()
sWiFiNetworkCommissioningInstance.Init();
}

void OnIdentifyStart(Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStart");
}

void OnIdentifyStop(Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStop");
}

static Identify gIdentify1 = {
chip::EndpointId{ 1 },
OnIdentifyStart,
OnIdentifyStop,
EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_NONE,
};

static void InitServer(intptr_t context)
{
// Init ZCL Data Model
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ config("psoc6_ota_config") {
}
psoc6_sdk_sources("lock_app_sdk_sources") {
include_dirs = [
"${chip_root}/src/platform/PSOC6",
"${chip_root}/src/platform/Infineon/PSOC6",
"${psoc6_project_dir}/include",
"${examples_plat_dir}",
]
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/infineon/psoc6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION 43012

/* The SoftwareVersion attribute of the Basic cluster. */
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
#endif

/* define Device type based on the application */
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 10 // 0x00A Door lock
Expand Down
17 changes: 17 additions & 0 deletions examples/lock-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,23 @@ void NetWorkCommissioningInstInit()
sWiFiNetworkCommissioningInstance.Init();
}

void OnIdentifyStart(Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStart");
}

void OnIdentifyStop(Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStop");
}

static Identify gIdentify1 = {
chip::EndpointId{ 1 },
OnIdentifyStart,
OnIdentifyStop,
EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_NONE,
};

static void InitServer(intptr_t context)
{
// Init ZCL Data Model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ void P6WiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback
{
ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network:%s", chip::ErrorStr(err));
mpConnectCallback = nullptr;
chip::DeviceLayer::PlatformMgr().LockChipStack();
callback->OnResult(networkingStatus, CharSpan(), 0);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
}
}

Expand Down Expand Up @@ -365,8 +363,7 @@ void P6WiFiDriver::OnNetworkStatusChange()
if (staConnected)
{
mpStatusChangeCallback->OnNetworkingStatusChange(
Status::kSuccess, MakeOptional(ByteSpan(configuredNetwork.networkID, configuredNetwork.networkIDLen)),
MakeOptional(GetLastDisconnectReason()));
Status::kSuccess, MakeOptional(ByteSpan(configuredNetwork.networkID, configuredNetwork.networkIDLen)), NullOptional);
return;
}
mpStatusChangeCallback->OnNetworkingStatusChange(
Expand Down
4 changes: 2 additions & 2 deletions src/system/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if (chip_device_platform == "cc13x2_26x2") {
import("${qpg_sdk_build_root}/qpg_sdk.gni")
} else if (chip_device_platform == "k32w0") {
import("//build_overrides/k32w0_sdk.gni")
} else if (chip_device_platform == "p6") {
import("//build_overrides/p6.gni")
} else if (chip_device_platform == "psoc6") {
import("//build_overrides/psoc6.gni")
} else if (chip_device_platform == "cyw30739") {
import("//build_overrides/cyw30739_sdk.gni")
} else if (chip_device_platform == "mt793x") {
Expand Down
2 changes: 1 addition & 1 deletion third_party/infineon/psoc6/psoc6_sdk/ota/ota_base_build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OUT_DIR=$1
HEX_NAME=$2
ANYCLOUD_DIR=third_party/p6/p6_sdk/libs/anycloud-ota/
ANYCLOUD_DIR=third_party/infineon/psoc6/psoc6_sdk/libs/anycloud-ota/

mv "$OUT_DIR"/"$HEX_NAME".hex "$OUT_DIR"/"$HEX_NAME".unsigned.hex

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OUT_DIR=$1
HEX_NAME=$2
ANYCLOUD_DIR=third_party/p6/p6_sdk/libs/anycloud-ota/
ANYCLOUD_DIR=third_party/infineon/psoc6/psoc6_sdk/libs/anycloud-ota/

mv "$OUT_DIR"/"$HEX_NAME".hex "$OUT_DIR"/"$HEX_NAME".unsigned.hex

Expand Down

0 comments on commit 822993c

Please sign in to comment.