From 99ece595381e63905d474e3d2722258547362465 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Fri, 3 Nov 2023 08:41:28 +0100 Subject: [PATCH] Fix chef build --- examples/chef/chef.py | 11 ++++++-- examples/chef/nrfconnect/CMakeLists.txt | 25 +++++-------------- examples/chef/nrfconnect/main.cpp | 4 +-- .../nrfconnect/pw_sys_io/sys_io_nrfconnect.cc | 2 +- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 3783596b04a1f2..b62e2bcf6ba3d0 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -683,7 +683,7 @@ def main() -> int: shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}") - if options.build_target in "esp32 nrfconnect ameba telink".split(): + if options.build_target in "esp32 ameba telink".split(): with open("project_include.cmake", "w") as f: f.write(textwrap.dedent(f"""\ set(CONFIG_DEVICE_VENDOR_ID {options.vid}) @@ -713,8 +713,15 @@ def main() -> int: nrf_build_cmds = ["west build -b nrf52840dk_nrf52840"] if options.do_clean: nrf_build_cmds.append("-p always") + nrf_build_cmds.append("--") if options.do_rpc: - nrf_build_cmds.append("-- -DOVERLAY_CONFIG=rpc.overlay") + nrf_build_cmds.append("-DOVERLAY_CONFIG=rpc.overlay") + nrf_build_cmds.append(f"-DCONFIG_CHIP_DEVICE_VENDOR_ID={options.vid}") + nrf_build_cmds.append(f"-DCONFIG_CHIP_DEVICE_PRODUCT_ID={options.pid}") + nrf_build_cmds.append(f"-DCONFIG_CHIP_DEVICE_PRODUCT_NAME='\"{options.pname}\"'") + nrf_build_cmds.append(f"-DSAMPLE_NAME={options.sample_device_type_name}") + nrf_build_cmds.append(f"-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING='\"{sw_ver_string}\"'") + shell.run_cmd(" ".join(nrf_build_cmds)) elif options.build_target == "silabs-thread": diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 0f09001fdb5bef..8d7c9a27dcfbd4 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -20,25 +20,16 @@ get_filename_component(NRFCONNECT_COMMON ${CHIP_ROOT}/examples/platform/nrfconne get_filename_component(CHEF ${CMAKE_CURRENT_SOURCE_DIR}/../ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -include(${CHEF}/project_include.cmake) get_filename_component(GEN_DIR ${CHEF}/out/${SAMPLE_NAME}/zap-generated REALPATH) set(CONF_FILE prj.conf) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${CONFIG_DEVICE_VENDOR_ID}") -set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${CONFIG_DEVICE_PRODUCT_ID}") -if(NOT ${CONFIG_DEVICE_PRODUCT_NAME} STREQUAL "") - set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME=\"${CONFIG_DEVICE_PRODUCT_NAME}\"") -endif() -if(NOT ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING} STREQUAL "") - set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}\"") -endif() -message(STATUS "Vendor ID " ${CONFIG_DEVICE_VENDOR_ID}) -message(STATUS "Product ID " ${CONFIG_DEVICE_PRODUCT_ID}) -message(STATUS "Product Name " ${CONFIG_DEVICE_PRODUCT_NAME}) -message(STATUS "SW Version String" ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}) +message(STATUS "Vendor ID " ${CONFIG_CHIP_DEVICE_VENDOR_ID}) +message(STATUS "Product ID " ${CONFIG_CHIP_DEVICE_PRODUCT_ID}) +message(STATUS "Product Name " ${CONFIG_CHIP_DEVICE_PRODUCT_NAME}) +message(STATUS "SW Version String" ${CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING}) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT ${CHIP_ROOT}/config/nrfconnect/chip-module/Kconfig.mcuboot.root) @@ -107,11 +98,7 @@ chip_configure_data_model(app include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake) -if (CONFIG_ENABLE_PW_RPC) - -target_compile_options(app PRIVATE - "-DCONFIG_ENABLE_PW_RPC=1" -) +if (CONFIG_CHIP_PW_RPC) # Make all targets created below depend on zephyr_interface to inherit MCU-related compilation flags link_libraries($) @@ -231,4 +218,4 @@ target_link_libraries(app PRIVATE pw_sys_io ) -endif(CONFIG_ENABLE_PW_RPC) +endif(CONFIG_CHIP_PW_RPC) diff --git a/examples/chef/nrfconnect/main.cpp b/examples/chef/nrfconnect/main.cpp index c4157798567e5b..d132252ecd87b3 100644 --- a/examples/chef/nrfconnect/main.cpp +++ b/examples/chef/nrfconnect/main.cpp @@ -39,7 +39,7 @@ #include #endif -#ifdef CONFIG_ENABLE_PW_RPC +#ifdef CONFIG_CHIP_PW_RPC #include "Rpc.h" #endif @@ -57,7 +57,7 @@ int main() { CHIP_ERROR err = CHIP_NO_ERROR; -#ifdef CONFIG_ENABLE_PW_RPC +#ifdef CONFIG_CHIP_PW_RPC rpc::Init(); #endif diff --git a/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc b/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc index 7c9f3429d12727..1eaffe9ac8bcb6 100644 --- a/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc +++ b/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc @@ -20,7 +20,7 @@ #include "pw_sys_io/sys_io.h" #include #include -#include +#include #ifdef CONFIG_USB #include