Skip to content

Commit

Permalink
Update configuration to make compilation work for zephyr platform
Browse files Browse the repository at this point in the history
  • Loading branch information
jlatusek committed Dec 11, 2023
1 parent e46fff3 commit 20f2f3d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -509,3 +509,7 @@ config CHIP_OTA_IMAGE_EXTRA_ARGS
endif

endif

rsource "../../third_party/pigweed/repo/Kconfig.zephyr"
rsource "../../third_party/pigweed/repo/pw_sys_io_zephyr/Kconfig"
rsource "../../third_party/pigweed/repo/pw_assert_zephyr/Kconfig"
8 changes: 7 additions & 1 deletion src/test_driver/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ set(CHIP_CFLAGS
-I${CMAKE_CURRENT_SOURCE_DIR}/main/include
)

set(PW_ROOT ${CHIP_ROOT}/third_party/pigweed/repo)
# Load NCS/Zephyr build system
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
list(APPEND ZEPHYR_EXTRA_MODULES ${PW_ROOT})
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

# ==================================================
Expand All @@ -56,7 +58,11 @@ project(AllChipTests)
enable_testing()

target_sources(app PRIVATE main/runner.cpp)
target_link_libraries(app PUBLIC chip $<TARGET_FILE:kernel>)
target_link_libraries(app PUBLIC chip $<TARGET_FILE:kernel>
pw_unit_test
pw_log_basic
)

target_compile_definitions(app PUBLIC CHIP_HAVE_CONFIG_H)

add_test(AllChipTests zephyr/zephyr.exe)
12 changes: 11 additions & 1 deletion src/test_driver/nrfconnect/main/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ using namespace ::chip::DeviceLayer;

LOG_MODULE_REGISTER(runner, CONFIG_MATTER_LOG_LEVEL);

extern "C" int main(void)
extern "C" {
void console_init(void) {}

int console_putchar(const char * chr)
{
LOG_RAW(chr);
return 0;
}

int main(void)
{
VerifyOrDie(settings_subsys_init() == 0);

Expand All @@ -39,3 +48,4 @@ extern "C" int main(void)

_exit(status);
}
}
5 changes: 5 additions & 0 deletions src/test_driver/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,8 @@ CONFIG_CHIP_ENABLE_DNSSD_SRP=n
CONFIG_CHIP_DEVICE_VENDOR_ID=65521
CONFIG_CHIP_DEVICE_PRODUCT_ID=32768
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"

#Pigweed
CONFIG_PIGWEED_ASSERT=y
CONFIG_PIGWEED_SYS_IO=y
CONFIG_ZEPHYR_PIGWEED_MODULE=y

0 comments on commit 20f2f3d

Please sign in to comment.