Skip to content

Commit

Permalink
Pigweed: update to 79525f59ff (#15701)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgoliver authored and pull[bot] committed Aug 30, 2023
1 parent 9e22473 commit 1067934
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 53 deletions.
1 change: 0 additions & 1 deletion config/linux/lib/pw_rpc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ static_library("pw_rpc") {
"$dir_pw_hdlc:encoder",
"$dir_pw_hdlc:pw_rpc",
"$dir_pw_hdlc:rpc_channel_output",
"$dir_pw_rpc:synchronized_channel_output",
"$dir_pw_rpc/system_server:facade",
"$dir_pw_stream:socket_stream",
dir_pw_log,
Expand Down
1 change: 1 addition & 0 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ target_sources(${APP_TARGET} PRIVATE
target_include_directories(${APP_TARGET} PRIVATE
${PIGWEED_ROOT}/pw_sys_io/public
${PIGWEED_ROOT}/pw_assert/public
${PIGWEED_ROOT}/pw_assert/assert_lite_public_overrides
${PIGWEED_ROOT}/pw_assert_log/public
${PIGWEED_ROOT}/pw_assert_log/public_overrides
${PIGWEED_ROOT}/pw_bytes/public
Expand Down
27 changes: 8 additions & 19 deletions examples/common/pigweed/RpcService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,23 @@ pw::stream::SysIoWriter sysIoWriter;
::chip::rpc::Mutex * uart_mutex;

template <size_t buffer_size>
class ChipRpcChannelOutputBuffer : public pw::rpc::ChannelOutput
class ChipRpcChannelOutput : public pw::rpc::ChannelOutput
{
public:
constexpr ChipRpcChannelOutputBuffer(pw::stream::Writer & writer, uint8_t address, const char * channel_name) :
constexpr ChipRpcChannelOutput(pw::stream::Writer & writer, uint8_t address, const char * channel_name) :
pw::rpc::ChannelOutput(channel_name), mWriter(writer), mAddress(address)
{}

std::span<std::byte> AcquireBuffer() override
pw::Status Send(std::span<const std::byte> buffer) override
{
if (uart_mutex)
{
uart_mutex->Lock();
}
return mBuffer;
}

pw::Status SendAndReleaseBuffer(std::span<const std::byte> buffer) override
{
PW_DASSERT(buffer.data() == mBuffer.data());
if (buffer.empty())
{
if (uart_mutex)
{
uart_mutex->Unlock();
}
return pw::OkStatus();
}
if (uart_mutex)
{
uart_mutex->Lock();
}
pw::Status ret = pw::hdlc::WriteUIFrame(mAddress, buffer, mWriter);
if (uart_mutex)
{
Expand All @@ -86,12 +76,11 @@ class ChipRpcChannelOutputBuffer : public pw::rpc::ChannelOutput

private:
pw::stream::Writer & mWriter;
std::array<std::byte, buffer_size> mBuffer;
const uint8_t mAddress;
};

// Set up the output channel for the pw_rpc server to use to use.
ChipRpcChannelOutputBuffer<kMaxTransmissionUnit> hdlc_channel_output(sysIoWriter, pw::hdlc::kDefaultRpcAddress, "HDLC channel");
ChipRpcChannelOutput<kMaxTransmissionUnit> hdlc_channel_output(sysIoWriter, pw::hdlc::kDefaultRpcAddress, "HDLC channel");

pw::rpc::Channel channels[] = { pw::rpc::Channel::Create<1>(&hdlc_channel_output) };

Expand Down
2 changes: 1 addition & 1 deletion examples/common/pigweed/system_rpc_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ stream::SysIoWriter writer;
stream::SysIoReader reader;

// Set up the output channel for the pw_rpc server to use.
hdlc::RpcChannelOutputBuffer<kMaxTransmissionUnit> hdlc_channel_output(writer, pw::hdlc::kDefaultRpcAddress, "HDLC channel");
hdlc::RpcChannelOutput hdlc_channel_output(writer, pw::hdlc::kDefaultRpcAddress, "HDLC channel");
Channel channels[] = { pw::rpc::Channel::Create<1>(&hdlc_channel_output) };
rpc::Server server(channels);

Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ executable("chip-lighting-app") {
"$dir_pw_hdlc:rpc_channel_output",
"$dir_pw_log",
"$dir_pw_rpc:server",
"$dir_pw_rpc:synchronized_channel_output",
"$dir_pw_rpc/system_server:facade",
"$dir_pw_stream:socket_stream",
"$dir_pw_stream:sys_io_stream",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/builders/nrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def generate(self):

cmd = '''
source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {outdir} -b {board} {sourcedir}{overlayflags}
'''.format(
outdir=shlex.quote(self.output_dir),
Expand Down
28 changes: 14 additions & 14 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -629,72 +629,72 @@ cmake -S {root}/examples/shell/mbed -B {out}/mbed-CY8CPROTO_062_4343W-shell-rele

# Generating nrf-native-posix-64-tests
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-native-posix-64-tests -b native_posix_64 {root}/src/test_driver/nrfconnect'

# Generating nrf-nrf52840dk-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-light -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect'

# Generating nrf-nrf52840dk-light-rpc
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-light-rpc -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=rpc.overlay'

# Generating nrf-nrf52840dk-lock
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-lock -b nrf52840dk_nrf52840 {root}/examples/lock-app/nrfconnect'

# Generating nrf-nrf52840dk-pump
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-pump -b nrf52840dk_nrf52840 {root}/examples/pump-app/nrfconnect'

# Generating nrf-nrf52840dk-pump-controller
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-pump-controller -b nrf52840dk_nrf52840 {root}/examples/pump-controller-app/nrfconnect'

# Generating nrf-nrf52840dk-shell
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-shell -b nrf52840dk_nrf52840 {root}/examples/shell/nrfconnect'

# Generating nrf-nrf52840dongle-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dongle-light -b nrf52840dongle_nrf52840 {root}/examples/lighting-app/nrfconnect'

# Generating nrf-nrf5340dk-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-light -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect'

# Generating nrf-nrf5340dk-light-rpc
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-light-rpc -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=rpc.overlay'

# Generating nrf-nrf5340dk-lock
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-lock -b nrf5340dk_nrf5340_cpuapp {root}/examples/lock-app/nrfconnect'

# Generating nrf-nrf5340dk-pump
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-pump -b nrf5340dk_nrf5340_cpuapp {root}/examples/pump-app/nrfconnect'

# Generating nrf-nrf5340dk-pump-controller
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-pump-controller -b nrf5340dk_nrf5340_cpuapp {root}/examples/pump-controller-app/nrfconnect'

# Generating nrf-nrf5340dk-shell
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-shell -b nrf5340dk_nrf5340_cpuapp {root}/examples/shell/nrfconnect'

# Generating qpg-qpg6100-lock
Expand Down
2 changes: 1 addition & 1 deletion scripts/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ prettytable==2.2.1
# via
# mbed-ls
# mbed-os-tools
prompt-toolkit==3.0.21
prompt-toolkit==3.0.26
# via ipython
protobuf==3.17.3
# via -r requirements.txt
Expand Down
1 change: 1 addition & 0 deletions scripts/environment.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cipd_package_files": [
"third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/arm.json",
"third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json",
"scripts/python.json"
],
Expand Down
2 changes: 1 addition & 1 deletion scripts/examples/nrfconnect_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ source "../scripts/activate.sh"
[[ -n $ZEPHYR_BASE ]] && source "$ZEPHYR_BASE/zephyr-env.sh"

# Use toolchain from Pigweed CIPD
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR"

# Set ccache base directory to improve the cache hit ratio
export CCACHE_BASEDIR="$PWD/$APP/nrfconnect"
Expand Down
26 changes: 14 additions & 12 deletions scripts/python.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[
{
"path": "infra/3pp/tools/cpython3/${platform}",
"platforms": ["mac-amd64", "windows-amd64"],
"tags": ["version:3.8.2.chromium.10"]
},
{
"path": "fuchsia/third_party/cmake/${platform}",
"platforms": ["mac-amd64", "linux-amd64"],
"tags": ["version:3.20.20210428-g857373c"]
}
]
{
"packages": [
{
"path": "infra/3pp/tools/cpython3/${platform}",
"platforms": ["mac-amd64", "windows-amd64"],
"tags": ["version:3.8.2.chromium.10"]
},
{
"path": "fuchsia/third_party/cmake/${platform}",
"platforms": ["mac-amd64", "linux-amd64"],
"tags": ["version:3.20.20210428-g857373c"]
}
]
}
2 changes: 1 addition & 1 deletion src/pybindings/pycontroller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ shared_library("CHIPController") {
include_dirs = [ "${chip_root}/third_party/pybind11/repo/include" ]
if (current_os == "mac") {
include_dirs +=
[ "${chip_root}/.environment/cipd/python/include/python3.8" ]
[ "${chip_root}/.environment/cipd/packages/python/include/python3.8" ]
} else if (current_os == "linux") {
include_dirs += [ "/usr/include/python3.9" ]
} else {
Expand Down
2 changes: 1 addition & 1 deletion third_party/pigweed/repo
Submodule repo updated 590 files

0 comments on commit 1067934

Please sign in to comment.