Skip to content

Commit

Permalink
[examples] Aligned nrfconnect examples to the NCS 2.7.0 version
Browse files Browse the repository at this point in the history
The new nRF Connect SDK 2.7.0 version introduced significant
changes in the build system that resulted in a requirement
to refactor all examples suported by nrfconnect platform.
  • Loading branch information
kkasperczyk-no committed Jul 18, 2024
1 parent 5461466 commit 0eb1cf2
Show file tree
Hide file tree
Showing 244 changed files with 3,715 additions and 2,134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle_nrf52840 -DCONF_FILE=prj_no_dfu.conf -DCONFIG_CHIP_ROTATING_DEVICE_ID=y
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle_nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf52840dongle_nrf52840 lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
Expand Down
31 changes: 31 additions & 0 deletions config/nrfconnect/app/check-sysbuild-use.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This script checks is sysbuild is used to build the target. If not, it prints the fatal error
# message, as the nRF Connect examples do not support deprecated child-image approach anymore.

if (NOT SYSBUILD)
message(FATAL_ERROR " ###################################################################################\n"
" # This example does not support child-image approach anymore. #\n"
" # The nRF Connect SDK platform marked child-image approach as deprecated #\n"
" # and it is recommended to use the new sysbuild solution. #\n"
" # #\n"
" # To build this application with sysbuild support enabled, #\n"
" # you have to add --sysbuild flag to the build command, for example: #\n"
" # #\n"
" # west build -b <your_board_name> --sysbuild nameIt was moved to support sysbuild #\n"
" ###################################################################################\n")
endif()
10 changes: 6 additions & 4 deletions docs/guides/nrfconnect_examples_software_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ To test the DFU over Matter, you need to complete the following steps:
4. Run OTA Provider application with _matter.ota_ replaced with the path to the
Matter OTA image which you wish to provide to the Matter device. Note that
the Matter OTA image is, by default, generated in the
example's build directory:
the Matter OTA image is, by default, generated in the example's build
directory:
```
$ out/provider/chip-ota-provider-app -f matter.ota
Expand Down Expand Up @@ -180,7 +180,8 @@ Complete the following steps to perform DFU using mcumgr:
that the Bluetooth LE advertising has started. See the user interface
section in the example documentation to check the LED number.
4. Upload the application firmware image to the device by running the following
command in your example directory with the <application_name> replaced by your application name, for example `lock`:
command in your example directory with the <application_name> replaced by
your application name, for example `lock`:
```
sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/<application_name>/zephyr/zephyr.signed.bin -n 0 -w 1
Expand Down Expand Up @@ -246,7 +247,8 @@ Complete the following steps to perform DFU using mcumgr:
go straight to the step 8.
a. Upload the network core firmware image to the device by running the
following command in your example directory with the <network_image_name> replaced by your network image name, for example `ipc_radio`:
following command in your example directory with the <network_image_name>
replaced by your network image name, for example `ipc_radio`:
```
sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/signed_by_mcuboot_and_b0_<network_image_name>.bin -n 1 -w 1
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/nrfconnect_factory_data_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,9 @@ $ python scripts/tools/nrfconnect/nrfconnect_generate_partition.py -i build/ligh
```
As a result, `factory_data.hex` and `factory_data.bin` files are created in the
`/build/light_bulb/zephyr/` directory. The first file contains the memory offset. For this
reason, it can be programmed directly to the device using a programmer (for
example, `nrfjprog`).
`/build/light_bulb/zephyr/` directory. The first file contains the memory
offset. For this reason, it can be programmed directly to the device using a
programmer (for example, `nrfjprog`).
<hr>
Expand All @@ -786,8 +786,8 @@ directory and build the example with the following option (replace
$ west build -b nrf52840dk_nrf52840 -- -DCONFIG_CHIP_FACTORY_DATA=y -DSB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y
```
Alternatively, you can also add `SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y` Kconfig
setting to the example's `prj.conf` file.
Alternatively, you can also add `SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y`
Kconfig setting to the example's `prj.conf` file.
Each factory data parameter has a default value. These are described in the
[Kconfig file](../../config/nrfconnect/chip-module/Kconfig). Setting a new value
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ target_compile_options(app PRIVATE -Werror -Wno-error=maybe-uninitialized)

project(chip-nrfconnect-all-clusters-app-example)

include(${CHIP_ROOT}/config/nrfconnect/app/check-sysbuild-use.cmake)
include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)
include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake)
include(${CHIP_ROOT}/src/app/chip_data_model.cmake)
Expand Down
67 changes: 67 additions & 0 deletions examples/all-clusters-app/nrfconnect/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#### Radio core selection
config NRF_DEFAULT_IPC_RADIO
default y

# Enable IEEE802.15.4 serialization to network core
config NETCORE_IPC_RADIO_IEEE802154
default y if (SOC_SERIES_NRF53X) && !WIFI_NRF700X

# Enable Bluetooth serialization to network core
config NETCORE_IPC_RADIO_BT_HCI_IPC
default y if SOC_SERIES_NRF53X

if BOOTLOADER_MCUBOOT

#### DFU multi-image support
config DFU_MULTI_IMAGE_PACKAGE_BUILD
default y

config DFU_MULTI_IMAGE_PACKAGE_APP
default y

config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
default y

#### DFU network core configuration
if SOC_SERIES_NRF53X

config MCUBOOT_UPDATEABLE_IMAGES
default 2

choice MCUBOOT_MODE
default MCUBOOT_MODE_OVERWRITE_ONLY
endchoice

choice BOOT_SIGNATURE_TYPE
default BOOT_SIGNATURE_TYPE_RSA
endchoice

config SECURE_BOOT_NETCORE
default y

config NETCORE_APP_UPDATE
default y

config DFU_MULTI_IMAGE_PACKAGE_NET
default y

endif # SOC_SERIES_NRF53X
endif # BOOTLOADER_MCUBOOT

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@ CONFIG_MATTER_LOG_LEVEL_INF=y

# Use partition manager to configure the settings partition not to overlap with Open Bootloader
CONFIG_PM_SINGLE_IMAGE=y

# Enable CHIP pairing automatically on application start.
CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
25 changes: 0 additions & 25 deletions examples/all-clusters-app/nrfconnect/child_image/hci_ipc/prj.conf

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0eb1cf2

Please sign in to comment.