Skip to content

Commit

Permalink
Bump third_party/pigweed/repo from 73cac22 to b88cd71 (#26133)
Browse files Browse the repository at this point in the history
* Pin new pigweed branch

* Fix issues caught in CI

* Fix CI

* Clean up

* Fix QPG plaform CI issues

* Fix CI issues for Ameba

* Fix Ameba CI for real this time

* Restyle

* Fix k32w0 and mw320 CI

* Restyle

* CI fixes for TI platform stuff

* Fixes CI for Infineon

* Fix/efr32 ci with pw roll up (#113)

* add syscall_stubs to efr32 test driver to support gcc 12

* fix release pw rpc build, and test driver

* Fix CI for Infineon cyw30739

* Roll to latest pigweed commit

* Clean up for review

* Fix CI

* Restyle

* Fix CI

---------

Co-authored-by: Junior Martinez <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Aug 24, 2023
1 parent 172915a commit 9065177
Show file tree
Hide file tree
Showing 23 changed files with 779 additions and 86 deletions.
7 changes: 6 additions & 1 deletion examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ mw320_executable("shell_mw320") {
"${chip_root}/src/setup_payload",
]

deps = [ "${chip_root}/src/platform:syscalls_stub" ]

include_dirs = [
"${chip_root}/src/platform/nxp/mw320",
"${examples_plat_dir}/app/project_include",
Expand All @@ -84,7 +86,10 @@ mw320_executable("shell_mw320") {

ldscript = "${examples_plat_dir}/app/ldscripts/88MW320_xx_xxxx_flash.ld"

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
ldflags = [
"-T" + rebase_path(ldscript, root_build_dir),
"-Wl,--no-warn-rwx-segment",
]
defines = [
"MW320_SHELL_STREAMER",
"SHELL_STREAMER_APP_SPECIFIC",
Expand Down
1 change: 1 addition & 0 deletions examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ k32w0_executable("contact_sensor_app") {
"${chip_root}/examples/contact-sensor-app/contact-sensor-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/third_party/mbedtls:mbedtls",
"${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
]
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ k32w0_executable("light_app") {
"${chip_root}/examples/lighting-app/nxp/zap/",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/third_party/mbedtls:mbedtls",
"${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
]
Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ k32w0_executable("lock_app") {
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/crypto",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/third_party/mbedtls:mbedtls",
"${chip_root}/third_party/simw-top-mini:se05x",
"${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
Expand Down
11 changes: 9 additions & 2 deletions examples/platform/linux/system_rpc_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace {
constexpr size_t kMaxTransmissionUnit = 512;
uint16_t socket_port = 33000;

stream::ServerSocket server_socket;
stream::SocketStream socket_stream;

hdlc::RpcChannelOutput hdlc_channel_output(socket_stream, hdlc::kDefaultRpcAddress, "HDLC channel");
Expand All @@ -63,7 +64,10 @@ void Init()
});

PW_LOG_INFO("Starting pw_rpc server on port %d", socket_port);
PW_CHECK_OK(socket_stream.Serve(socket_port));
PW_CHECK_OK(server_socket.Listen(socket_port));
auto accept_result = server_socket.Accept();
PW_CHECK_OK(accept_result.status());
socket_stream = *std::move(accept_result);
}

rpc::Server & Server()
Expand All @@ -88,7 +92,10 @@ Status Start()
// An out of range status indicates the remote end has disconnected.
// Start to serve the connection again, which will allow another
// remote to connect.
PW_CHECK_OK(socket_stream.Serve(socket_port));
PW_CHECK_OK(server_socket.Listen(socket_port));
auto accept_result = server_socket.Accept();
PW_CHECK_OK(accept_result.status());
socket_stream = *std::move(accept_result);
}
continue;
}
Expand Down
27 changes: 0 additions & 27 deletions examples/platform/nxp/mw320/BUILD.gn

This file was deleted.

4 changes: 1 addition & 3 deletions examples/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,7 @@ config("efr32-common-config") {
defines += [ "HEAP_MONITORING" ]
}

# Do not warn for LOAD segment with RWX permissions
# Uncomment this cflag when pigweed update is done and GCC 12.2 is used.
#ldflags = [ "-Wl,--no-warn-rwx-segment" ]
ldflags = [ "-Wl,--no-warn-rwx-segment" ]
}

config("silabs-wifi-config") {
Expand Down
1 change: 1 addition & 0 deletions examples/shell/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ k32w0_executable("shell_app") {
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/lock-app/lock-common",
"${chip_root}/examples/shell/shell_common:shell_common",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/third_party/mbedtls:mbedtls",
"${chip_root}/third_party/simw-top-mini:se05x",
"${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
Expand Down
87 changes: 40 additions & 47 deletions src/platform/Ameba/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,56 +186,49 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface **
NetworkInterface * head = NULL;
struct ifaddrs * ifaddr = nullptr;

if (xnetif == NULL)
// xnetif is never null, no need to check. If we do check with -Werror=address, we get compiler error.
for (struct netif * ifa = xnetif; ifa != NULL; ifa = ifa->next)
{
ChipLogError(DeviceLayer, "Failed to get network interfaces");
}
else
{
for (struct netif * ifa = xnetif; ifa != NULL; ifa = ifa->next)
NetworkInterface * ifp = new NetworkInterface();

Platform::CopyString(ifp->Name, ifa->name);

ifp->name = CharSpan::fromCharString(ifp->Name);
ifp->isOperational = true;
if ((ifa->flags) & NETIF_FLAG_ETHERNET)
ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET;
else
ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI;
ifp->offPremiseServicesReachableIPv4.SetNull();
ifp->offPremiseServicesReachableIPv6.SetNull();

memcpy(ifp->MacAddress, ifa->hwaddr, sizeof(ifa->hwaddr));

if (0)
{
NetworkInterface * ifp = new NetworkInterface();

Platform::CopyString(ifp->Name, ifa->name);

ifp->name = CharSpan::fromCharString(ifp->Name);
ifp->isOperational = true;
if ((ifa->flags) & NETIF_FLAG_ETHERNET)
ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET;
else
ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI;
ifp->offPremiseServicesReachableIPv4.SetNull();
ifp->offPremiseServicesReachableIPv6.SetNull();

memcpy(ifp->MacAddress, ifa->hwaddr, sizeof(ifa->hwaddr));

if (0)
{
ChipLogError(DeviceLayer, "Failed to get network hardware address");
}
else
{
// Set 48-bit IEEE MAC Address
ifp->hardwareAddress = ByteSpan(ifp->MacAddress, 6);
}

if (ifa->ip_addr.u_addr.ip4.addr != 0)
{
memcpy(ifp->Ipv4AddressesBuffer[0], &(ifa->ip_addr.u_addr.ip4.addr), kMaxIPv4AddrSize);
ifp->Ipv4AddressSpans[0] = ByteSpan(ifp->Ipv4AddressesBuffer[0], kMaxIPv4AddrSize);
ifp->IPv4Addresses = chip::app::DataModel::List<chip::ByteSpan>(ifp->Ipv4AddressSpans, 1);
}

if (ifa->ip6_addr->u_addr.ip6.addr != 0)
{
memcpy(ifp->Ipv6AddressesBuffer[0], &(ifa->ip6_addr->u_addr.ip6.addr), kMaxIPv6AddrSize);
ifp->Ipv6AddressSpans[0] = ByteSpan(ifp->Ipv6AddressesBuffer[0], kMaxIPv6AddrSize);
ifp->IPv6Addresses = chip::app::DataModel::List<chip::ByteSpan>(ifp->Ipv6AddressSpans, 1);
}

ifp->Next = head;
head = ifp;
ChipLogError(DeviceLayer, "Failed to get network hardware address");
}
else
{
// Set 48-bit IEEE MAC Address
ifp->hardwareAddress = ByteSpan(ifp->MacAddress, 6);
}

if (ifa->ip_addr.u_addr.ip4.addr != 0)
{
memcpy(ifp->Ipv4AddressesBuffer[0], &(ifa->ip_addr.u_addr.ip4.addr), kMaxIPv4AddrSize);
ifp->Ipv4AddressSpans[0] = ByteSpan(ifp->Ipv4AddressesBuffer[0], kMaxIPv4AddrSize);
ifp->IPv4Addresses = chip::app::DataModel::List<chip::ByteSpan>(ifp->Ipv4AddressSpans, 1);
}

// ifa->ip6_addr->u_addr.ip6.addr is never null, no need to check. If we do check with -Werror=address, we get compiler
// error.
memcpy(ifp->Ipv6AddressesBuffer[0], &(ifa->ip6_addr->u_addr.ip6.addr), kMaxIPv6AddrSize);
ifp->Ipv6AddressSpans[0] = ByteSpan(ifp->Ipv6AddressesBuffer[0], kMaxIPv6AddrSize);
ifp->IPv6Addresses = chip::app::DataModel::List<chip::ByteSpan>(ifp->Ipv6AddressSpans, 1);

ifp->Next = head;
head = ifp;
}

*netifpp = head;
Expand Down
4 changes: 4 additions & 0 deletions src/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -487,3 +487,7 @@ if (chip_device_platform != "none") {
public_deps = [ ":platform_buildconfig" ]
}
}

source_set("syscalls_stub") {
sources = [ "SyscallStubs.cpp" ]
}
Loading

0 comments on commit 9065177

Please sign in to comment.