Good day
We have developed a custom board and intend to store data inside the non-volatile section of the nrf91. In doing so I have attempted to build the soc_flash sample firstly on a compatible board and then converting it to use with our custom board.
it is important to note that I am using the latest SDK2.4. To start off with, I tried to build the standard sample on the nrf9160dk and am getting this error:
'PM_PM_PM_mcuboot_secondary_ID_LABEL_OFFSET' undeclared (first use in this function)
51 | UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))'
51 | UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))'
is this sample out of date?
In doing some changes, I have tried to select my storage_partition area (found in my DT) in order to use in this code but I am always getting that the flash device isnt ready:
Nordic nRF5 Flash Testing
=========================
Flash device not ready
*** Booting Zephyr OS build v3.3.99-ncs1 ***
=========================
Flash device not ready
*** Booting Zephyr OS build v3.3.99-ncs1 ***
Please assist me in how to accomplish this and if this sample is supposed to build correctly initially.
My board file will be linked below:
/ / { chosen { zephyr,console = &uart0; zephyr,shell-uart = &uart0; zephyr,uart-mcumgr = &uart0; }; leds { compatible = "gpio-leds"; red_led: led_1 { gpios = <&gpio0 21 0>; label = "RGB red channel"; }; green_led: led_2 { gpios = <&gpio0 22 0>; label = "RGB green channel"; }; blue_led: led_3 { gpios = <&gpio0 23 0>; label = "RGB blue channel"; }; }; buttons { compatible = "gpio-keys"; button0: button_0 { gpios = <&gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Switch 1"; }; compatible = "gpio-keys"; button1: button_1 { gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Switch 2"; }; }; /* These aliases are provided for compatibility with samples */ aliases { led0 = &red_led; led1 = &green_led; led2 = &blue_led; sw0 = &button0; mcuboot-button0 = &button1; mcuboot-led0 = &blue_led; watchdog0 = &wdt0; accel0 = &lis2dh; // spi-flash0 = &w25q32jv; }; }; &adc { status = "okay"; }; &gpiote { status = "okay"; }; &gpio0 { status = "okay"; }; // Terminal UART &uart0 { status = "okay"; current-speed = <9600>; pinctrl-0 = <&uart0_default>; pinctrl-1 = <&uart0_sleep>; pinctrl-names = "default", "sleep"; }; // Modbus UART &uart1 { status = "disabled"; current-speed = <115200>; pinctrl-0 = <&uart1_default>; pinctrl-1 = <&uart1_sleep>; pinctrl-names = "default", "sleep"; modbus0 { compatible = "zephyr,modbus-serial"; status = "okay"; de-gpios = < &gpio0 2 GPIO_ACTIVE_LOW>; /* D9 */ re-gpios = < &gpio0 3 GPIO_ACTIVE_HIGH>; }; }; // Dongle UART &uart2 { status = "disabled"; current-speed = <115200>; pinctrl-0 = <&uart2_default>; pinctrl-1 = <&uart2_sleep>; pinctrl-names = "default", "sleep"; }; // RTC and Accelorometer Definition &i2c3 { compatible = "nordic,nrf-twim"; status = "okay"; pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; pcf85063a: pcf85063a@51 { compatible = "nxp,pcf85063a"; reg = <0x51>; }; lis2dh: lis2dh@18 { status = "okay"; compatible = "st,lis2dh"; reg = <0x18>; irq-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; disconnect-sdo-sa0-pull-up; anym-on-int1; }; }; // External Flash Definition &spi2 { compatible = "nordic,nrf-spim"; status = "disabled"; cs-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; pinctrl-0 = <&spi3_default>; pinctrl-1 = <&spi3_sleep>; pinctrl-names = "default", "sleep"; }; &timer0 { status = "okay"; }; &timer1 { status = "okay"; }; &timer2 { status = "okay"; }; &flash0 { partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 0x10000>; }; slot0_partition: partition@10000 { label = "image-0"; }; slot0_ns_partition: partition@40000 { label = "image-0-nonsecure"; }; slot1_partition: partition@80000 { label = "image-1"; }; slot1_ns_partition: partition@b0000 { label = "image-1-nonsecure"; }; scratch_partition: partition@f0000 { label = "image-scratch"; reg = <0x000f0000 0xa000>; }; storage_partition1: partition@fa000 { label = "storage"; reg = <0x000fa000 0x00006000>; }; }; }; / { reserved-memory { #address-cells = <1>; #size-cells = <1>; ranges; sram0_s: image_s@20000000 { /* Secure image memory */ }; sram0_bsd: image_bsd@20010000 { /* BSD (shared) memory */ }; sram0_ns: image_ns@20020000 { /* Non-Secure image memory */ }; }; }; / { vbatt { compatible = "voltage-divider"; io-channels = <&adc 7 >; output-ohms = <100000>; full-ohms = <(100000 + 100000)>; power-gpios = <&gpio0 25 0>; }; };