Skip to content

Commit ad2b9b6

Browse files
committed
[nrf fromlist] tests: dfu: img_util: Fix partition detection
Fixes the logic in detecting which partition is being executed from Upstream PR #: 106189 Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
1 parent 8f87804 commit ad2b9b6

File tree

1 file changed

+3
-5
lines changed
  • tests/subsys/dfu/img_util/src

1 file changed

+3
-5
lines changed

tests/subsys/dfu/img_util/src/main.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
#define SLOT0_PARTITION slot0_partition
1414
#define SLOT1_PARTITION slot1_partition
1515

16-
#define PARTITION_IS_RUNNING_APP_PARTITION(label) \
17-
DT_SAME_NODE(PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \
18-
PARTITION_MTD(label)) && \
19-
(PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \
20-
PARTITION_OFFSET(label) + PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET)
16+
#define PARTITION_IS_RUNNING_APP_PARTITION(label) \
17+
DT_SAME_NODE(DT_MEM_FROM_PARTITION(DT_CHOSEN(zephyr_code_partition)), \
18+
DT_MEM_FROM_PARTITION(DT_NODELABEL(label)))
2119

2220
#if PARTITION_IS_RUNNING_APP_PARTITION(slot0_partition)
2321
#define UPLOAD_PARTITION_ID PARTITION_ID(SLOT1_PARTITION)

0 commit comments

Comments
 (0)