Skip to content

Commit c5d641e

Browse files
samples: add support for nRF5340
Add nRF5340 support to all samples. Signed-off-by: Mariusz Szypuła <[email protected]>
1 parent 188b0d1 commit c5d641e

32 files changed

+535
-3
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_MAIN_STACK_SIZE=2048
8+
9+
# Use software cryptography on nRF5340
10+
CONFIG_ZIGBEE_USE_SOFTWARE_AES=y
11+
CONFIG_CRYPTO=n
12+
CONFIG_CRYPTO_NRF_ECB=n
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
pwmleds {
9+
compatible = "pwm-leds";
10+
pwm_led3: pwm_led_3 {
11+
pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
12+
};
13+
};
14+
15+
chosen {
16+
ncs,zigbee-timer = &timer2;
17+
};
18+
};
19+
20+
&pwm0 {
21+
pinctrl-0 = <&pwm0_default_alt>;
22+
pinctrl-1 = <&pwm0_sleep_alt>;
23+
pinctrl-names = "default", "sleep";
24+
};
25+
26+
&pinctrl {
27+
pwm0_default_alt: pwm0_default_alt {
28+
group1 {
29+
psels = <NRF_PSEL(PWM_OUT1, 0, 31)>;
30+
nordic,invert;
31+
};
32+
};
33+
34+
pwm0_sleep_alt: pwm0_sleep_alt {
35+
group1 {
36+
psels = <NRF_PSEL(PWM_OUT1, 0, 31)>;
37+
low-power-enable;
38+
};
39+
};
40+
41+
};
42+
43+
&timer2 {
44+
status = "okay";
45+
};

samples/light_bulb/sample.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ tests:
99
- nrf54l15dk/nrf54l15/cpuapp
1010
- nrf54l15dk/nrf54l10/cpuapp
1111
- nrf52840dk/nrf52840
12+
- nrf5340dk/nrf5340/cpuapp
1213
platform_allow:
1314
- nrf54l15dk/nrf54l15/cpuapp
1415
- nrf54l15dk/nrf54l10/cpuapp
1516
- nrf52840dk/nrf52840
17+
- nrf5340dk/nrf5340/cpuapp
1618
tags:
1719
- ci_build
1820
- smoke
@@ -31,10 +33,12 @@ tests:
3133
- nrf54l15dk/nrf54l15/cpuapp
3234
- nrf54l15dk/nrf54l10/cpuapp
3335
- nrf52840dk/nrf52840
36+
- nrf5340dk/nrf5340/cpuapp
3437
platform_allow:
3538
- nrf54l15dk/nrf54l15/cpuapp
3639
- nrf54l15dk/nrf54l10/cpuapp
3740
- nrf52840dk/nrf52840
41+
- nrf5340dk/nrf5340/cpuapp
3842
tags:
3943
- ci_build
4044
- shell

samples/light_switch/Kconfig.sysbuild

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,30 @@ config DFU_MULTI_IMAGE_PACKAGE_BUILD
1818
config DFU_MULTI_IMAGE_PACKAGE_APP
1919
default y
2020

21+
#### DFU dual core configuration
22+
if SOC_SERIES_NRF53X
23+
24+
config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
25+
default y
26+
27+
config MCUBOOT_UPDATEABLE_IMAGES
28+
default 2
29+
30+
choice MCUBOOT_MODE
31+
default MCUBOOT_MODE_OVERWRITE_ONLY
32+
endchoice
33+
34+
config SECURE_BOOT_NETCORE
35+
default y
36+
37+
config NETCORE_APP_UPDATE
38+
default y
39+
40+
config DFU_MULTI_IMAGE_PACKAGE_NET
41+
default y
42+
43+
endif # SOC_SERIES_NRF53X
44+
2145
endif # BOOTLOADER_MCUBOOT
2246

2347
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"

samples/light_switch/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ For example, when building from the command line, use the following command:
124124
Alternatively, you can :ref:`configure Zigbee FOTA manually <ug_zigbee_configuring_components_ota>`.
125125

126126
.. note::
127-
You can use the :file:`prj_fota.conf` file only with a development kit that contains the nRF52840, nRF54L15 or nRF54L10 SoC.
127+
You can use the :file:`prj_fota.conf` file only with a development kit that contains the nRF52840, nRF5340, nRF54L15 or nRF54L10 SoC.
128128

129129
To activate the Multiprotocol Bluetooth LE extension, set :makevar:`EXTRA_CONF_FILE` to the :file:`overlay-multiprotocol_ble.conf`.
130130
For example, when building from the command line, use the following command:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_MAIN_STACK_SIZE=2048
8+
9+
# Use software cryptography on nRF5340
10+
CONFIG_ZIGBEE_USE_SOFTWARE_AES=y
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
nordic,pm-ext-flash = &mx25r64;
10+
ncs,zigbee-timer = &timer2;
11+
};
12+
};
13+
14+
&timer2 {
15+
status = "okay";
16+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_MAIN_STACK_SIZE=2048
8+
9+
# Use software cryptography on nRF5340
10+
CONFIG_ZIGBEE_USE_SOFTWARE_AES=y
11+
12+
#######################
13+
# Zigbee FOTA overlay #
14+
#######################
15+
16+
# Allow for storing two images in MCUboot partitions
17+
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
18+
19+
# Store new images inside external flash
20+
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
21+
22+
# Configure QSPI for external flash
23+
CONFIG_NORDIC_QSPI_NOR=y
24+
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
25+
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
26+
27+
CONFIG_DFU_MULTI_IMAGE=y
28+
CONFIG_NRF53_ENFORCE_IMAGE_VERSION_EQUALITY=y
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
app:
2+
address: 0x10200
3+
region: flash_primary
4+
size: 0xdfe00
5+
mcuboot:
6+
address: 0x0
7+
region: flash_primary
8+
size: 0x10000
9+
mcuboot_pad:
10+
address: 0x10000
11+
region: flash_primary
12+
size: 0x200
13+
mcuboot_primary:
14+
address: 0x10000
15+
orig_span: &id001
16+
- mcuboot_pad
17+
- app
18+
region: flash_primary
19+
size: 0xe0000
20+
span: *id001
21+
mcuboot_primary_app:
22+
address: 0x10200
23+
orig_span: &id002
24+
- app
25+
region: flash_primary
26+
size: 0xdfe00
27+
span: *id002
28+
settings_storage:
29+
address: 0xf0000
30+
region: flash_primary
31+
size: 0x10000
32+
mcuboot_primary_1:
33+
address: 0x0
34+
size: 0x40000
35+
device: flash_ctrl
36+
region: ram_flash
37+
mcuboot_secondary:
38+
address: 0x00000
39+
size: 0xe0000
40+
device: MX25R64
41+
region: external_flash
42+
mcuboot_secondary_1:
43+
address: 0xe0000
44+
size: 0x40000
45+
device: MX25R64
46+
region: external_flash
47+
external_flash:
48+
address: 0x120000
49+
size: 0x6e0000
50+
device: MX25R64
51+
region: external_flash
52+
pcd_sram:
53+
address: 0x20000000
54+
size: 0x2000
55+
region: sram_primary

samples/light_switch/sample.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ tests:
99
- nrf54l15dk/nrf54l15/cpuapp
1010
- nrf54l15dk/nrf54l10/cpuapp
1111
- nrf52840dk/nrf52840
12+
- nrf5340dk/nrf5340/cpuapp
1213
platform_allow:
1314
- nrf54l15dk/nrf54l15/cpuapp
1415
- nrf54l15dk/nrf54l10/cpuapp
1516
- nrf52840dk/nrf52840
17+
- nrf5340dk/nrf5340/cpuapp
1618
tags:
1719
- ci_build
1820
- smoke
@@ -26,10 +28,12 @@ tests:
2628
- nrf54l15dk/nrf54l15/cpuapp
2729
- nrf54l15dk/nrf54l10/cpuapp
2830
- nrf52840dk/nrf52840
31+
- nrf5340dk/nrf5340/cpuapp
2932
platform_allow:
3033
- nrf54l15dk/nrf54l15/cpuapp
3134
- nrf54l15dk/nrf54l10/cpuapp
3235
- nrf52840dk/nrf52840
36+
- nrf5340dk/nrf5340/cpuapp
3337
tags:
3438
- ci_build
3539
- sysbuild
@@ -47,10 +51,12 @@ tests:
4751
- nrf54l15dk/nrf54l15/cpuapp
4852
- nrf54l15dk/nrf54l10/cpuapp
4953
- nrf52840dk/nrf52840
54+
- nrf5340dk/nrf5340/cpuapp
5055
platform_allow:
5156
- nrf54l15dk/nrf54l15/cpuapp
5257
- nrf54l15dk/nrf54l10/cpuapp
5358
- nrf52840dk/nrf52840
59+
- nrf5340dk/nrf5340/cpuapp
5460
tags:
5561
- ci_build
5662
- shell
@@ -74,3 +80,16 @@ tests:
7480
- smoke
7581
- sysbuild
7682
- ci_samples_zigbee
83+
sample.zigbee.light_switch.fota.nrf5340dk:
84+
sysbuild: true
85+
build_only: true
86+
extra_args:
87+
- FILE_SUFFIX=fota
88+
integration_platforms:
89+
- nrf5340dk/nrf5340/cpuapp
90+
platform_allow: nrf5340dk/nrf5340/cpuapp
91+
tags:
92+
- ci_build
93+
- smoke
94+
- sysbuild
95+
- ci_samples_zigbee

0 commit comments

Comments
 (0)