I'll preface this by saying I am new to developing on the nRF and the Zephyr OS.
I am just trying to set up a flash read/write module on my nRF52DK PCA100040 model. From my readings, it seems I need to first set up a flash partition which is done in an overlay file. In my VSCode config, I added the .overlay file as an "Extra Device Tree Overlay".
The contents of my .overlay file is:
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
rolling_buffer: partition@7F000 {
label = "rolling_buffer";
reg = <0x7F000 0x1000>; /* 32b for log storage */
compatible = "fixed-partition";
};
};
};void initFlash()
{
int rc;
rc = flash_area_open(FIXED_PARTITION_ID(rolling_buffer), &fa);
if (rc) {
printk("Failed to open flash partition (%d)\n", rc);
// return;
}
}C:/ncs/v3.1.0/nrf/include/flash_map_pm.h:47:22: error: 'PM_rolling_buffer_ID' undeclared (first use in this function) 47 | #define PM_ID(label) PM_##label##_ID
CONFIG_GPIO=y CONFIG_SENSOR=y CONFIG_ADC=y CONFIG_PRINTK=y CONFIG_CBPRINTF_FP_SUPPORT=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_FCB=y CONFIG_LOG=y
west build --build-dir C:/logger/build C:/logger/build --pristine --board nrf52dk/nrf52832 --sysbuild -- -DCONF_FILE="prj.conf" -DEXTRA_DTC_OVERLAY_FILE=nrf52832dk_nrf52832.overlay -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y