Skip to content

Commit 2666d2c

Browse files
committed
img_mgmt: Use absolute address while checking app
Use absolute addresses while determining a running application partition. Ref: NCSIDB-1773 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent f3179a3 commit 2666d2c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

include/flash_map_pm.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@
6868
(DEVICE_DT_GET_OR_NULL(DT_NODELABEL(FIXED_PARTITION_DATA_FIELD(label, _DEV)))))
6969
#define FLASH_AREA_DEVICE(label) FIXED_PARTITION_DEVICE(label)
7070

71+
#define FIXED_PARTITION_MTD(label) \
72+
COND_CODE_1(DT_NODE_EXISTS(FIXED_PARTITION_DATA_FIELD(label, _DEV)), \
73+
(FIXED_PARTITION_DATA_FIELD(label, _DEV)), \
74+
(DT_NODELABEL(FIXED_PARTITION_DATA_FIELD(label, _DEV))))
75+
#define FIXED_PARTITION_NODE_MTD(node) \
76+
COND_CODE_1( \
77+
DT_FIXED_SUBPARTITION_EXISTS(node), \
78+
(DT_MTD_FROM_FIXED_SUBPARTITION(node)), \
79+
(DT_MTD_FROM_FIXED_PARTITION(node)))
80+
7181
#define FIXED_PARTITION_EXISTS(label) IS_ENABLED(PM_IS_ENABLED(label))
7282
#define FLASH_AREA_LABEL_EXISTS(label) FIXED_PARTITION_EXISTS(label)
7383

subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ BUILD_ASSERT(PM_MCUBOOT_PAD_SIZE == PM_MCUBOOT_SECONDARY_PAD_SIZE);
7171
#endif
7272

7373
#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \
74+
DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \
75+
FIXED_PARTITION_MTD(label)) && \
7476
(FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \
7577
FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET)
7678
#endif /* USE_PARTITION_MANAGER */

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ manifest:
6464
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
6565
- name: zephyr
6666
repo-path: sdk-zephyr
67-
revision: dc05376c170fc2739a4881629caf49c40d485a9e
67+
revision: pull/3520/head
6868
import:
6969
# In addition to the zephyr repository itself, NCS also
7070
# imports the contents of zephyr/west.yml at the above

0 commit comments

Comments
 (0)