Skip to content

Commit 0eb1cf2

Browse files
[examples] Aligned nrfconnect examples to the NCS 2.7.0 version
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.
1 parent 5461466 commit 0eb1cf2

File tree

244 files changed

+3715
-2134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+3715
-2134
lines changed

.github/workflows/examples-nrfconnect.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle
8787
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
8888
run: |
89-
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle_nrf52840 -DCONF_FILE=prj_no_dfu.conf -DCONFIG_CHIP_ROTATING_DEVICE_ID=y
89+
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle_nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y
9090
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
9191
nrfconnect nrf52840dongle_nrf52840 lighting-app \
9292
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# This script checks is sysbuild is used to build the target. If not, it prints the fatal error
18+
# message, as the nRF Connect examples do not support deprecated child-image approach anymore.
19+
20+
if (NOT SYSBUILD)
21+
message(FATAL_ERROR " ###################################################################################\n"
22+
" # This example does not support child-image approach anymore. #\n"
23+
" # The nRF Connect SDK platform marked child-image approach as deprecated #\n"
24+
" # and it is recommended to use the new sysbuild solution. #\n"
25+
" # #\n"
26+
" # To build this application with sysbuild support enabled, #\n"
27+
" # you have to add --sysbuild flag to the build command, for example: #\n"
28+
" # #\n"
29+
" # west build -b <your_board_name> --sysbuild nameIt was moved to support sysbuild #\n"
30+
" ###################################################################################\n")
31+
endif()

docs/guides/nrfconnect_examples_software_update.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ To test the DFU over Matter, you need to complete the following steps:
4949
5050
4. Run OTA Provider application with _matter.ota_ replaced with the path to the
5151
Matter OTA image which you wish to provide to the Matter device. Note that
52-
the Matter OTA image is, by default, generated in the
53-
example's build directory:
52+
the Matter OTA image is, by default, generated in the example's build
53+
directory:
5454
5555
```
5656
$ out/provider/chip-ota-provider-app -f matter.ota
@@ -180,7 +180,8 @@ Complete the following steps to perform DFU using mcumgr:
180180
that the Bluetooth LE advertising has started. See the user interface
181181
section in the example documentation to check the LED number.
182182
4. Upload the application firmware image to the device by running the following
183-
command in your example directory with the <application_name> replaced by your application name, for example `lock`:
183+
command in your example directory with the <application_name> replaced by
184+
your application name, for example `lock`:
184185
185186
```
186187
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
@@ -246,7 +247,8 @@ Complete the following steps to perform DFU using mcumgr:
246247
go straight to the step 8.
247248
248249
a. Upload the network core firmware image to the device by running the
249-
following command in your example directory with the <network_image_name> replaced by your network image name, for example `ipc_radio`:
250+
following command in your example directory with the <network_image_name>
251+
replaced by your network image name, for example `ipc_radio`:
250252
251253
```
252254
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

docs/guides/nrfconnect_factory_data_configuration.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -764,9 +764,9 @@ $ python scripts/tools/nrfconnect/nrfconnect_generate_partition.py -i build/ligh
764764
```
765765
766766
As a result, `factory_data.hex` and `factory_data.bin` files are created in the
767-
`/build/light_bulb/zephyr/` directory. The first file contains the memory offset. For this
768-
reason, it can be programmed directly to the device using a programmer (for
769-
example, `nrfjprog`).
767+
`/build/light_bulb/zephyr/` directory. The first file contains the memory
768+
offset. For this reason, it can be programmed directly to the device using a
769+
programmer (for example, `nrfjprog`).
770770
771771
<hr>
772772
@@ -786,8 +786,8 @@ directory and build the example with the following option (replace
786786
$ west build -b nrf52840dk_nrf52840 -- -DCONFIG_CHIP_FACTORY_DATA=y -DSB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y
787787
```
788788
789-
Alternatively, you can also add `SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y` Kconfig
790-
setting to the example's `prj.conf` file.
789+
Alternatively, you can also add `SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y`
790+
Kconfig setting to the example's `prj.conf` file.
791791
792792
Each factory data parameter has a default value. These are described in the
793793
[Kconfig file](../../config/nrfconnect/chip-module/Kconfig). Setting a new value

examples/all-clusters-app/nrfconnect/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ target_compile_options(app PRIVATE -Werror -Wno-error=maybe-uninitialized)
3434

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

37+
include(${CHIP_ROOT}/config/nrfconnect/app/check-sysbuild-use.cmake)
3738
include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)
3839
include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake)
3940
include(${CHIP_ROOT}/src/app/chip_data_model.cmake)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
#### Radio core selection
18+
config NRF_DEFAULT_IPC_RADIO
19+
default y
20+
21+
# Enable IEEE802.15.4 serialization to network core
22+
config NETCORE_IPC_RADIO_IEEE802154
23+
default y if (SOC_SERIES_NRF53X) && !WIFI_NRF700X
24+
25+
# Enable Bluetooth serialization to network core
26+
config NETCORE_IPC_RADIO_BT_HCI_IPC
27+
default y if SOC_SERIES_NRF53X
28+
29+
if BOOTLOADER_MCUBOOT
30+
31+
#### DFU multi-image support
32+
config DFU_MULTI_IMAGE_PACKAGE_BUILD
33+
default y
34+
35+
config DFU_MULTI_IMAGE_PACKAGE_APP
36+
default y
37+
38+
config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
39+
default y
40+
41+
#### DFU network core configuration
42+
if SOC_SERIES_NRF53X
43+
44+
config MCUBOOT_UPDATEABLE_IMAGES
45+
default 2
46+
47+
choice MCUBOOT_MODE
48+
default MCUBOOT_MODE_OVERWRITE_ONLY
49+
endchoice
50+
51+
choice BOOT_SIGNATURE_TYPE
52+
default BOOT_SIGNATURE_TYPE_RSA
53+
endchoice
54+
55+
config SECURE_BOOT_NETCORE
56+
default y
57+
58+
config NETCORE_APP_UPDATE
59+
default y
60+
61+
config DFU_MULTI_IMAGE_PACKAGE_NET
62+
default y
63+
64+
endif # SOC_SERIES_NRF53X
65+
endif # BOOTLOADER_MCUBOOT
66+
67+
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"

examples/all-clusters-app/nrfconnect/boards/nrf52840dongle_nrf52840.conf

-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,3 @@ CONFIG_MATTER_LOG_LEVEL_INF=y
3838

3939
# Use partition manager to configure the settings partition not to overlap with Open Bootloader
4040
CONFIG_PM_SINGLE_IMAGE=y
41-
42-
# Enable CHIP pairing automatically on application start.
43-
CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y

examples/all-clusters-app/nrfconnect/child_image/hci_ipc/prj.conf

-25
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/hci_ipc/prj_dfu.conf

-25
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/hci_ipc/prj_release.conf

-25
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/mcuboot/boards/nrf52840dk_nrf52840.overlay

-21
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/mcuboot/boards/nrf52840dk_nrf52840_release.overlay

-21
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay

-20
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp_release.overlay

-21
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp.overlay

-21
This file was deleted.

examples/all-clusters-app/nrfconnect/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_release.overlay

-21
This file was deleted.

0 commit comments

Comments
 (0)