Skip to content

Commit

Permalink
[nrf fromtree] [nrfconnect] Fix build on master (project-chip#24340)
Browse files Browse the repository at this point in the history
Add missing configuration switches to the test driver.
Fix mbedTLS configuration for the test runner.
Fix the main function signature for the test runner.

Signed-off-by: Damian Krolik <[email protected]>
(cherry picked from commit 16c1232)
  • Loading branch information
Damian-Nordic committed Mar 8, 2023
1 parent 14b6131 commit a475700
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ jobs:
examples/all-clusters-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Run unit tests for Zephyr native_posix_64 platform
if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true'
if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-posix-64-tests build"
Expand Down
3 changes: 3 additions & 0 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ if (CONFIG_NORDIC_SECURITY_BACKEND)
zephyr_include_directories($<TARGET_PROPERTY:platform_cc3xx,INTERFACE_INCLUDE_DIRECTORIES>)
endif()
list(APPEND CHIP_CFLAGS -DMBEDTLS_CONFIG_FILE=<nrf-config.h>)
elseif(CONFIG_MBEDTLS)
zephyr_include_directories($<TARGET_PROPERTY:mbedTLS,INTERFACE_INCLUDE_DIRECTORIES>)
zephyr_compile_definitions($<TARGET_PROPERTY:mbedTLS,INTERFACE_COMPILE_DEFINITIONS>)
endif()

if (CONFIG_NRF_802154_RADIO_DRIVER)
Expand Down
2 changes: 1 addition & 1 deletion config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ config CHIP_DEBUG_SYMBOLS
Build the application with debug symbols.

config CHIP_MALLOC_SYS_HEAP
default y
default y if !ARCH_POSIX

config CHIP_FACTORY_DATA
bool "Enable Factory Data support"
Expand Down
2 changes: 1 addition & 1 deletion scripts/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ wcwidth==0.2.5
# prompt-toolkit
werkzeug==0.16.1
# via flask
west==0.12.0
west==1.0.0
# via -r requirements.txt
wheel==0.36.2
# via -r requirements.txt
Expand Down
3 changes: 0 additions & 3 deletions src/test_driver/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ set(CHIP_CFLAGS
-DCHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF=0
-DCHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS=1
-I${CMAKE_CURRENT_SOURCE_DIR}/main/include
-DMBEDTLS_CONFIG_FILE=<config-tls-generic.h>
-isystem$ENV{ZEPHYR_BASE}/modules/mbedtls/configs
-isystem$ENV{ZEPHYR_BASE}/../mbedtls/include
)

# Load NCS/Zephyr build system
Expand Down
2 changes: 1 addition & 1 deletion src/test_driver/nrfconnect/main/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace ::chip::DeviceLayer;

LOG_MODULE_REGISTER(runner, CONFIG_MATTER_LOG_LEVEL);

void main(void)
extern "C" void main(void)
{
VerifyOrDie(settings_subsys_init() == 0);

Expand Down
4 changes: 3 additions & 1 deletion src/test_driver/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h"
CONFIG_MBEDTLS_USER_CONFIG_ENABLE=y
CONFIG_MBEDTLS_USER_CONFIG_FILE="app_mbedtls_config.h"
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED=y
CONFIG_MBEDTLS_ECDH_C=y
CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_MBEDTLS_ECP_C=y
CONFIG_MBEDTLS_CIPHER_CCM_ENABLED=y

# Enable entropy
Expand Down

0 comments on commit a475700

Please sign in to comment.