Skip to content

Commit 9f974f5

Browse files
maje-embnordicjm
authored andcommitted
samples: peripheral_power_profiling: Add support for nRF54LV10DK
Add support for nRF54LV10DK in peripheral_power_profiling sample. Ref: NCSDK-33990 Signed-off-by: Marcin Jelinski <[email protected]>
1 parent 93deb64 commit 9f974f5

File tree

5 files changed

+61
-7
lines changed

5 files changed

+61
-7
lines changed

samples/bluetooth/peripheral_power_profiling/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ config BT_POWER_PROFILING_LED_DISABLED
7979

8080
config BT_POWER_PROFILING_NFC_DISABLED
8181
bool "Disable NFC"
82+
default y if !HAS_HW_NRF_NFCT
8283
help
8384
Disables the NFC to reduce power consumption.
8485

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
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_NFC_T2T_NRFXLIB=n
8+
9+
CONFIG_NFC_NDEF=n
10+
CONFIG_NFC_NDEF_MSG=n
11+
CONFIG_NFC_NDEF_RECORD=n
12+
CONFIG_NFC_NDEF_LE_OOB_REC=n
13+
CONFIG_NFC_NDEF_CH_MSG=n
14+
15+
CONFIG_PM_DEVICE=y
16+
CONFIG_PM_DEVICE_RUNTIME=y
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
/delete-property/ sw2;
10+
/delete-property/ sw3;
11+
};
12+
};
13+
14+
/delete-node/ &button2;
15+
/delete-node/ &button3;
16+
17+
&uart30 {
18+
zephyr,pm-device-runtime-auto;
19+
};

samples/bluetooth/peripheral_power_profiling/sample.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tests:
1515
- nrf54l15dk/nrf54l10/cpuapp
1616
- nrf54l15dk/nrf54l15/cpuapp
1717
- nrf54lm20pdk/nrf54lm20a/cpuapp
18+
- nrf54lv10dk/nrf54lv10a/cpuapp
1819
platform_allow:
1920
- nrf52dk/nrf52832
2021
- nrf52833dk/nrf52833
@@ -25,6 +26,7 @@ tests:
2526
- nrf54l15dk/nrf54l10/cpuapp
2627
- nrf54l15dk/nrf54l15/cpuapp
2728
- nrf54lm20pdk/nrf54lm20a/cpuapp
29+
- nrf54lv10dk/nrf54lv10a/cpuapp
2830
tags:
2931
- bluetooth
3032
- ci_build

samples/bluetooth/peripheral_power_profiling/src/main.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
#include <zephyr/bluetooth/conn.h>
1919
#include <zephyr/bluetooth/hci.h>
2020

21+
#if !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)
2122
#include <nfc_t2t_lib.h>
22-
23+
#endif /* !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED) */
2324
#include <nfc/ndef/msg.h>
2425
#include <nfc/ndef/record.h>
2526
#include <nfc/ndef/ch.h>
@@ -58,21 +59,24 @@
5859

5960
#define NFC_BUFFER_SIZE 1024
6061

62+
6163
static struct bt_le_oob oob_local;
6264
static uint8_t tk_local[NFC_NDEF_LE_OOB_REC_TK_LEN];
65+
#if !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)
6366
static uint8_t nfc_buffer[NFC_BUFFER_SIZE];
67+
static void adv_work_handler(struct k_work *work);
68+
static K_WORK_DEFINE(adv_work, adv_work_handler);
69+
#endif /* !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED) */
6470

6571
static struct bt_le_ext_adv *adv_set;
6672

6773
static void system_off_work_handler(struct k_work *work);
6874
static void key_generation_work_handler(struct k_work *work);
69-
static void adv_work_handler(struct k_work *work);
7075
static void notify_work_handler(struct k_work *work);
7176
static void notify_timeout_handler(struct k_work *work);
7277

7378
static K_WORK_DELAYABLE_DEFINE(system_off_work, system_off_work_handler);
7479
static K_WORK_DEFINE(key_generate_work, key_generation_work_handler);
75-
static K_WORK_DEFINE(adv_work, adv_work_handler);
7680
static K_WORK_DELAYABLE_DEFINE(notify_work, notify_work_handler);
7781
static K_WORK_DELAYABLE_DEFINE(notify_timeout, notify_timeout_handler);
7882

@@ -149,6 +153,7 @@ static int set_led_off(uint8_t led_idx)
149153
}
150154
}
151155

156+
#if !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)
152157
static void nfc_callback(void *context, nfc_t2t_event_t event, const uint8_t *data,
153158
size_t data_length)
154159
{
@@ -184,6 +189,7 @@ static void nfc_callback(void *context, nfc_t2t_event_t event, const uint8_t *da
184189
break;
185190
}
186191
}
192+
#endif /* !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED) */
187193

188194
static void connected(struct bt_conn *conn, uint8_t conn_err)
189195
{
@@ -486,6 +492,7 @@ static void key_generation_work_handler(struct k_work *work)
486492
pairing_key_generate();
487493
}
488494

495+
#if !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)
489496
static void adv_work_handler(struct k_work *work)
490497
{
491498
int err;
@@ -518,6 +525,7 @@ static void adv_work_handler(struct k_work *work)
518525
printk("Connectable advertising started\n");
519526
}
520527
}
528+
#endif /* !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED) */
521529

522530
static void notify_work_handler(struct k_work *work)
523531
{
@@ -559,6 +567,7 @@ static void notify_timeout_handler(struct k_work *work)
559567
}
560568
}
561569

570+
#if !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)
562571
static int nfc_oob_data_setup(size_t *size)
563572
{
564573
static const uint8_t ndef_record_count = 2;
@@ -599,9 +608,11 @@ static int nfc_oob_data_setup(size_t *size)
599608

600609
return nfc_ndef_msg_encode(&NFC_NDEF_MSG(ndef_msg), nfc_buffer, size);
601610
}
611+
#endif /* !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED) */
602612

603613
static int nfc_init(void)
604614
{
615+
#if !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)
605616
int err;
606617
size_t nfc_buffer_size = sizeof(nfc_buffer);
607618

@@ -629,6 +640,9 @@ static int nfc_init(void)
629640
}
630641

631642
return err;
643+
#else
644+
return 0;
645+
#endif /* !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED) */
632646
}
633647

634648
static void reset_reason_print(void)
@@ -637,10 +651,12 @@ static void reset_reason_print(void)
637651

638652
reason = nrfx_reset_reason_get();
639653

640-
if (reason & NRFX_RESET_REASON_NFC_MASK) {
641-
printk("Wake up by NFC field detected\n");
642-
} else if (reason & NRFX_RESET_REASON_OFF_MASK) {
654+
if (reason & NRFX_RESET_REASON_OFF_MASK) {
643655
printk("Wake up by the advertising start buttons\n");
656+
#if !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)
657+
} else if (reason & NRFX_RESET_REASON_NFC_MASK) {
658+
printk("Wake up by NFC field detected\n");
659+
#endif /* !IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED) */
644660
#if defined(NRF_RESETINFO)
645661
} else if (reason & NRFX_RESET_REASON_LOCAL_SREQ_MASK) {
646662
printk("Application soft reset detected\n");
@@ -774,7 +790,7 @@ int main(void)
774790
return 0;
775791
}
776792

777-
if (!IS_ENABLED(BT_POWER_PROFILING_NFC_DISABLED)) {
793+
if (!IS_ENABLED(CONFIG_BT_POWER_PROFILING_NFC_DISABLED)) {
778794
err = nfc_init();
779795
if (err) {
780796
printk("Failed to initialize NFC (err %d)\n", err);

0 commit comments

Comments
 (0)