Hello,
I'm trying to run the NVS example on the NRF9160DK rev 1.1.3 with the on-board MX25R6435F external flash memory.
The sample runs OK as nrf9160dk/nrf9160 but the partitioning seems to have problems with nrf9160dk/nrf9160/ns mode.
I modified the NVS_PARTITION macro to match with my external flash partition.
This is the error:
C:/nrfconnect/nvs_int_flash_ns/src/main.c: In function 'main':
C:/ncs/v2.7.0/nrf/include/flash_map_pm.h:52:18: error: 'PM_PM_PM_sensor_data_ex_partition_ID_LABEL_OFFSET' undeclared (first use in this function)
52 | UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
| ^~~
C:/ncs/v2.7.0/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'
105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
| ^
C:/ncs/v2.7.0/nrf/include/flash_map_pm.h:52:9: note: in expansion of macro 'UTIL_CAT'
52 | UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
| ^~~~~~~~
C:/ncs/v2.7.0/nrf/include/flash_map_pm.h:55:39: note: in expansion of macro 'FIXED_PARTITION_DATA_FIELD'
55 | #define FIXED_PARTITION_OFFSET(label) FIXED_PARTITION_DATA_FIELD(label, _OFFSET)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/nrfconnect/nvs_int_flash_ns/src/main.c:53:33: note: in expansion of macro 'FIXED_PARTITION_OFFSET'
53 | #define NVS_PARTITION_OFFSET FIXED_PARTITION_OFFSET(NVS_PARTITION)
| ^~~~~~~~~~~~~~~~~~~~~~
C:/nrfconnect/nvs_int_flash_ns/src/main.c:86:21: note: in expansion of macro 'NVS_PARTITION_OFFSET'
86 | fs.offset = NVS_PARTITION_OFFSET;
| ^~~~~~~~~~~~~~~~~~~~
C:/ncs/v2.7.0/nrf/include/flash_map_pm.h:52:18: note: each undeclared identifier is reported only once for each function it appears in
52 | UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
| ^~~
C:/ncs/v2.7.0/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'
105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
| ^
C:/ncs/v2.7.0/nrf/include/flash_map_pm.h:52:9: note: in expansion of macro 'UTIL_CAT'
52 | UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
| ^~~~~~~~
C:/ncs/v2.7.0/nrf/include/flash_map_pm.h:55:39: note: in expansion of macro 'FIXED_PARTITION_DATA_FIELD'
55 | #define FIXED_PARTITION_OFFSET(label) FIXED_PARTITION_DATA_FIELD(label, _OFFSET)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/nrfconnect/nvs_int_flash_ns/src/main.c:53:33: note: in expansion of macro 'FIXED_PARTITION_OFFSET'
53 | #define NVS_PARTITION_OFFSET FIXED_PARTITION_OFFSET(NVS_PARTITION)
| ^~~~~~~~~~~~~~~~~~~~~~
C:/nrfconnect/nvs_int_flash_ns/src/main.c:86:21: note: in expansion of macro 'NVS_PARTITION_OFFSET'
86 | fs.offset = NVS_PARTITION_OFFSET;
| ^~~~~~~~~~~~~~~~~~~~
This is my prj.conf file:
And this is my .overlay file: