Use external flash with MCUBOOT

This is my first time developing for Nordic processors. I am using Zephyr 3.0.99 with the nrf52810 on a ublox BMD-330 eval board. I connected a W25X20CL 2M-bit chip via the SPI bus. I have used the “littlefs” file system to create and read/write files on the external flash. The application will be BLE enabled and I am planning on using a custom service to transfer a new bootable image to the external flash. When I enable the MCUMGR with bluetooth the image is too large for the flash. But our app builds and still has some headroom left. So if I can do OTA updates to the external flash we should be good. I have enabled MCUBOOT and it goes through the 2 phase build. However when I flash the image onto the board I get the following

I am just using a simple hello world app to try and get this working. The partitions.yml looks like it has placed the mcuboot_secondary on the external flash. But I don't know what the above error means. The default was 128 and I managed to figure out how to change to 256. 512 will make the image too large. I have read dev zone articles and searched the web for 2 days. But all suggestions usually don't work because they are out of date and the configuration options have changed with the latest Zephyr. I would really appreciate if you could point me to a working example that uses your latest SDK or up to date info. on how to solve this problem.

Thanks

/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <sys/printk.h>

#define IMAGE_VERSION		CONFIG_MCUBOOT_IMAGE_VERSION

void main(void)
{
	printk("Hello World! board: %s image: %s\n", CONFIG_BOARD, IMAGE_VERSION);
}
nrf52dk_nrf52810.overlay8764.prj.conf7776.mcuboot.conf1423.zephyr.dts

  • Hi,

    I would really appreciate if you could point me to a working example that uses your latest SDK or up to date info. on how to solve this problem

    My colleague Simon have an example here:

    https://devzone.nordicsemi.com/f/nordic-q-a/82430/ncs-external-flash-ota-change-qspi-to-spi/345238#345238

    What nRF Connect SDK version are you using?

  • After studying the code a bit and trying to figure out which parts of it apply I made the modifications. I now get a lot of compile errors that I'm not sure how to interpret. Any suggestions on how to resolve?

    [0/61] Performing build step for 'mcuboot_subimage'
    [1/118] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/C_/Users/dagreen/ncs/v1.9.1/modules/crypto/mbedtls/library/aesni.c.obj
    [2/118] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
    [3/118] Linking C static library zephyr\drivers\serial\libdrivers__serial.a
    [4/118] Linking C static library zephyr\drivers\timer\libdrivers__timer.a
    [5/118] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/zephyr_init.c.obj
    [6/118] Building C object modules/mcuboot/boot/bootutil/zephyr/CMakeFiles/mcuboot_util.dir/C_/Users/dagreen/ncs/v1.9.1/bootloader/mcuboot/boot/bootutil/src/bootutil_public.c.obj
    [7/118] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj
    FAILED: zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj
    C:\Users\dagreen\ncs\v1.9.1\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.99-ncs1-1 -DDEVELOP_IN_NRF52832 -DKERNEL -DNRF52810_XXAA -DNRFX_COREDEP_DELAY_US_LOOP_CYCLES=3 -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/Users/dagreen/ncs/v1.9.1/zephyr/include -Izephyr/include/generated -IC:/Users/dagreen/ncs/v1.9.1/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/Users/dagreen/ncs/v1.9.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/Users/dagreen/ncs/v1.9.1/nrf/include -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/nordic/nrfx -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/nordic/nrfx/drivers/include -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/nordic/nrfx/mdk -IC:/Users/dagreen/ncs/v1.9.1/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/dagreen/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/include -IC:/Users/dagreen/ncs/v1.9.1/bootloader/mcuboot/boot/bootutil/zephyr/.. -IC:/Users/dagreen/ncs/v1.9.1/bootloader/mcuboot/boot/bootutil/zephyr/../include -IC:/Users/dagreen/ncs/v1.9.1/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -isystem C:/Users/dagreen/ncs/v1.9.1/zephyr/lib/libc/minimal/include -isystem c:/users/dagreen/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/dagreen/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros D:/Projects/Nordic/OTA/hello_world/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/dagreen/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/dagreen/ncs/v1.9.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/dagreen/ncs/v1.9.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj -MF zephyr\drivers\flash\CMakeFiles\drivers__flash.dir\spi_nor.c.obj.d -o zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj -c C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain.h:50,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/errno_private.h:10,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/lib/libc/minimal/include/errno.h:32,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:12:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1186:1: error: static assertion failed: "jedec,spi-nor jedec-id required for non-runtime SFDP"
     1186 | BUILD_ASSERT(DT_INST_NODE_HAS_PROP(0, jedec_id),
          | ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1195:1: error: static assertion failed: "jedec,spi-nor size required for non-runtime SFDP page layout"
     1195 | BUILD_ASSERT(DT_INST_NODE_HAS_PROP(0, size),
          | ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_P_size' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:538:32: note: in expansion of macro 'DT_CAT'
      538 | #define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
          |                                ^~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:34: note: in expansion of macro 'DT_PROP'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:42: note: in expansion of macro 'DT_DRV_INST'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1199:23: note: in expansion of macro 'DT_INST_PROP'
     1199 | #define INST_0_BYTES (DT_INST_PROP(0, size) / 8)
          |                       ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1205:29: note: in expansion of macro 'INST_0_BYTES'
     1205 | #define LAYOUT_PAGES_COUNT (INST_0_BYTES / CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE)
          |                             ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1207:55: note: in expansion of macro 'LAYOUT_PAGES_COUNT'
     1207 | BUILD_ASSERT((CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE * LAYOUT_PAGES_COUNT)
          |                                                       ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1207:14: error: expression in static assertion is not an integer
     1207 | BUILD_ASSERT((CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE * LAYOUT_PAGES_COUNT)
          |              ^
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain/gcc.h:72,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain.h:50,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/errno_private.h:10,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/lib/libc/minimal/include/errno.h:32,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:12:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:96:39: error: '__device_dts_ord_DT_N_INST_0_jedec_spi_nor_BUS_ORD' undeclared here (not in a function)
       96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
          |                                       ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:291:37: note: in expansion of macro 'DEVICE_NAME_GET'
      291 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_NAME(node_id))
          |                                     ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:311:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
      311 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
          |                                  ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:358:10: note: in expansion of macro 'DEVICE_DT_GET'
      358 |   .bus = DEVICE_DT_GET(DT_BUS(node_id)),       \
          |          ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:2: note: in expansion of macro 'SPI_DT_SPEC_GET'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |  ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1231:9: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1231 |  .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |         ^~~~~~~~~~~~~~~~~~~~
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/arch/arm/aarch32/arch.h:20,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/arch/cpu.h:19,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/kernel_includes.h:33,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/kernel.h:17,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/init.h:11,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:29,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/flash.h:26,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:13:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_P_spi_max_frequency' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:299:16: note: in expansion of macro 'DT_PROP'
      299 |   .frequency = DT_PROP(node_id, spi_max_frequency), \
          |                ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:359:13: note: in expansion of macro 'SPI_CONFIG_DT'
      359 |   .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |             ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:2: note: in expansion of macro 'SPI_DT_SPEC_GET'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |  ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:18: note: in expansion of macro 'DT_DRV_INST'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1231:9: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1231 |  .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |         ^~~~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_REG_IDX_0_VAL_ADDRESS' undeclared here (not in a function); did you mean 'DT_N_S_cpus_S_cpu_0_REG_IDX_0_VAL_ADDRESS'?
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:1717:30: note: in expansion of macro 'DT_REG_ADDR_BY_IDX'
     1717 | #define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
          |                              ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:301:12: note: in expansion of macro 'DT_REG_ADDR'
      301 |   .slave = DT_REG_ADDR(node_id),    \
          |            ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:359:13: note: in expansion of macro 'SPI_CONFIG_DT'
      359 |   .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |             ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:2: note: in expansion of macro 'SPI_DT_SPEC_GET'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |  ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:18: note: in expansion of macro 'DT_DRV_INST'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1231:9: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1231 |  .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |         ^~~~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_P_jedec_id' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:34: note: in expansion of macro 'DT_PROP'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:42: note: in expansion of macro 'DT_DRV_INST'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1244:14: note: in expansion of macro 'DT_INST_PROP'
     1244 |  .jedec_id = DT_INST_PROP(0, jedec_id),
          |              ^~~~~~~~~~~~
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/flash.h:26,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:13:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_FULL_NAME' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:903:11: note: in definition of macro 'Z_DEVICE_DEFINE'
      903 |   .name = drv_name,     \
          |           ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:64:53: note: in expansion of macro '__DEBRACKET'
       64 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
          |                                                     ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:59:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |  ^~~~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:54:2: note: in expansion of macro '__COND_CODE'
       54 |  __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
          |  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_macro.h:157:2: note: in expansion of macro 'Z_COND_CODE_1'
      157 |  Z_COND_CODE_1(_flag, _if_1_code, _else_code)
          |  ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:649:2: note: in expansion of macro 'COND_CODE_1'
      649 |  COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
          |  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:203:2: note: in expansion of macro 'DT_PROP_OR'
      203 |  DT_PROP_OR(node_id, label, DT_NODE_FULL_NAME(node_id))
          |  ^~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:475:36: note: in expansion of macro 'DT_CAT'
      475 | #define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
          |                                    ^~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:203:29: note: in expansion of macro 'DT_NODE_FULL_NAME'
      203 |  DT_PROP_OR(node_id, label, DT_NODE_FULL_NAME(node_id))
          |                             ^~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:253:4: note: in expansion of macro 'DEVICE_DT_NAME'
      253 |    DEVICE_DT_NAME(node_id), init_fn,  \
          |    ^~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:272:2: note: in expansion of macro 'DEVICE_DT_DEFINE'
      272 |  DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:272:19: note: in expansion of macro 'DT_DRV_INST'
      272 |  DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
          |                   ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1263:1: note: in expansion of macro 'DEVICE_DT_INST_DEFINE'
     1263 | DEVICE_DT_INST_DEFINE(0, &spi_nor_init, NULL,
          | ^~~~~~~~~~~~~~~~~~~~~
    [8/118] Linking C static library modules\nrf\lib\fatal_error\lib..__nrf__lib__fatal_error.a
    [9/118] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/C_/Users/dagreen/ncs/v1.9.1/modules/crypto/mbedtls/library/aria.c.obj
    [10/118] Linking C static library modules\mcuboot\boot\bootutil\zephyr\libmcuboot_util.a
    [11/118] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/C_/Users/dagreen/ncs/v1.9.1/modules/crypto/mbedtls/library/asn1parse.c.obj
    [12/118] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/C_/Users/dagreen/ncs/v1.9.1/modules/crypto/mbedtls/library/aes.c.obj
    ninja: build stopped: subcommand failed.
    [4/61] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj
    FAILED: zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj
    C:\Users\dagreen\ncs\v1.9.1\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.99-ncs1-1 -DDEVELOP_IN_NRF52832 -DKERNEL -DNRF52810_XXAA -DNRFX_COREDEP_DELAY_US_LOOP_CYCLES=3 -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/Users/dagreen/ncs/v1.9.1/zephyr/include -Izephyr/include/generated -IC:/Users/dagreen/ncs/v1.9.1/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/Users/dagreen/ncs/v1.9.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/Users/dagreen/ncs/v1.9.1/nrf/include -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/nordic/nrfx -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/nordic/nrfx/drivers/include -IC:/Users/dagreen/ncs/v1.9.1/modules/hal/nordic/nrfx/mdk -IC:/Users/dagreen/ncs/v1.9.1/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/dagreen/ncs/v1.9.1/modules/lib/tinycbor/zephyr/../include -isystem C:/Users/dagreen/ncs/v1.9.1/zephyr/lib/libc/minimal/include -isystem c:/users/dagreen/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/dagreen/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros D:/Projects/Nordic/OTA/hello_world/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=D:/Projects/Nordic/OTA/hello_world=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/dagreen/ncs/v1.9.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/dagreen/ncs/v1.9.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj -MF zephyr\drivers\flash\CMakeFiles\drivers__flash.dir\spi_nor.c.obj.d -o zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj -c C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain.h:50,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/errno_private.h:10,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/lib/libc/minimal/include/errno.h:32,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:12:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1186:1: error: static assertion failed: "jedec,spi-nor jedec-id required for non-runtime SFDP"
     1186 | BUILD_ASSERT(DT_INST_NODE_HAS_PROP(0, jedec_id),
          | ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1195:1: error: static assertion failed: "jedec,spi-nor size required for non-runtime SFDP page layout"
     1195 | BUILD_ASSERT(DT_INST_NODE_HAS_PROP(0, size),
          | ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_P_size' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:538:32: note: in expansion of macro 'DT_CAT'
      538 | #define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
          |                                ^~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:34: note: in expansion of macro 'DT_PROP'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:42: note: in expansion of macro 'DT_DRV_INST'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1199:23: note: in expansion of macro 'DT_INST_PROP'
     1199 | #define INST_0_BYTES (DT_INST_PROP(0, size) / 8)
          |                       ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1205:29: note: in expansion of macro 'INST_0_BYTES'
     1205 | #define LAYOUT_PAGES_COUNT (INST_0_BYTES / CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE)
          |                             ^~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1207:55: note: in expansion of macro 'LAYOUT_PAGES_COUNT'
     1207 | BUILD_ASSERT((CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE * LAYOUT_PAGES_COUNT)
          |                                                       ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1207:14: error: expression in static assertion is not an integer
     1207 | BUILD_ASSERT((CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE * LAYOUT_PAGES_COUNT)
          |              ^
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain/gcc.h:72,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/toolchain.h:50,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/errno_private.h:10,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/lib/libc/minimal/include/errno.h:32,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:12:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:96:39: error: '__device_dts_ord_DT_N_INST_0_jedec_spi_nor_BUS_ORD' undeclared here (not in a function)
       96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
          |                                       ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:291:37: note: in expansion of macro 'DEVICE_NAME_GET'
      291 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_NAME(node_id))
          |                                     ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:311:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
      311 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
          |                                  ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:358:10: note: in expansion of macro 'DEVICE_DT_GET'
      358 |   .bus = DEVICE_DT_GET(DT_BUS(node_id)),       \
          |          ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:2: note: in expansion of macro 'SPI_DT_SPEC_GET'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |  ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1231:9: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1231 |  .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |         ^~~~~~~~~~~~~~~~~~~~
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/arch/arm/aarch32/arch.h:20,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/arch/cpu.h:19,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/kernel_includes.h:33,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/kernel.h:17,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/init.h:11,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:29,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/flash.h:26,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:13:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_P_spi_max_frequency' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:299:16: note: in expansion of macro 'DT_PROP'
      299 |   .frequency = DT_PROP(node_id, spi_max_frequency), \
          |                ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:359:13: note: in expansion of macro 'SPI_CONFIG_DT'
      359 |   .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |             ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:2: note: in expansion of macro 'SPI_DT_SPEC_GET'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |  ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:18: note: in expansion of macro 'DT_DRV_INST'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1231:9: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1231 |  .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |         ^~~~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_REG_IDX_0_VAL_ADDRESS' undeclared here (not in a function); did you mean 'DT_N_S_cpus_S_cpu_0_REG_IDX_0_VAL_ADDRESS'?
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:1717:30: note: in expansion of macro 'DT_REG_ADDR_BY_IDX'
     1717 | #define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
          |                              ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:301:12: note: in expansion of macro 'DT_REG_ADDR'
      301 |   .slave = DT_REG_ADDR(node_id),    \
          |            ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:359:13: note: in expansion of macro 'SPI_CONFIG_DT'
      359 |   .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |             ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:2: note: in expansion of macro 'SPI_DT_SPEC_GET'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |  ^~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/spi.h:376:18: note: in expansion of macro 'DT_DRV_INST'
      376 |  SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1231:9: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1231 |  .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |         ^~~~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_P_jedec_id' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:34: note: in expansion of macro 'DT_PROP'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2491:42: note: in expansion of macro 'DT_DRV_INST'
     2491 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1244:14: note: in expansion of macro 'DT_INST_PROP'
     1244 |  .jedec_id = DT_INST_PROP(0, jedec_id),
          |              ^~~~~~~~~~~~
    In file included from C:/Users/dagreen/ncs/v1.9.1/zephyr/include/drivers/flash.h:26,
                     from C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:13:
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:40: error: 'DT_N_INST_0_jedec_spi_nor_FULL_NAME' undeclared here (not in a function)
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:903:11: note: in definition of macro 'Z_DEVICE_DEFINE'
      903 |   .name = drv_name,     \
          |           ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:64:53: note: in expansion of macro '__DEBRACKET'
       64 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
          |                                                     ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:59:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |  ^~~~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:54:2: note: in expansion of macro '__COND_CODE'
       54 |  __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
          |  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_macro.h:157:2: note: in expansion of macro 'Z_COND_CODE_1'
      157 |  Z_COND_CODE_1(_flag, _if_1_code, _else_code)
          |  ^~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:649:2: note: in expansion of macro 'COND_CODE_1'
      649 |  COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
          |  ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:203:2: note: in expansion of macro 'DT_PROP_OR'
      203 |  DT_PROP_OR(node_id, label, DT_NODE_FULL_NAME(node_id))
          |  ^~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:475:36: note: in expansion of macro 'DT_CAT'
      475 | #define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
          |                                    ^~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:203:29: note: in expansion of macro 'DT_NODE_FULL_NAME'
      203 |  DT_PROP_OR(node_id, label, DT_NODE_FULL_NAME(node_id))
          |                             ^~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:253:4: note: in expansion of macro 'DEVICE_DT_NAME'
      253 |    DEVICE_DT_NAME(node_id), init_fn,  \
          |    ^~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:272:2: note: in expansion of macro 'DEVICE_DT_DEFINE'
      272 |  DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/sys/util_internal.h:98:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
       98 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:305:31: note: in expansion of macro 'UTIL_CAT'
      305 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/devicetree.h:2434:27: note: in expansion of macro 'DT_INST'
     2434 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/include/device.h:272:19: note: in expansion of macro 'DT_DRV_INST'
      272 |  DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
          |                   ^~~~~~~~~~~
    C:/Users/dagreen/ncs/v1.9.1/zephyr/drivers/flash/spi_nor.c:1263:1: note: in expansion of macro 'DEVICE_DT_INST_DEFINE'
     1263 | DEVICE_DT_INST_DEFINE(0, &spi_nor_init, NULL,
          | ^~~~~~~~~~~~~~~~~~~~~
    [8/61] Building C object modules/tinycbor/CMakeFiles/..__modules__lib__tinycbor__zephyr.dir/C_/Users/dagreen/ncs/v1.9.1/modules/lib/tinycbor/src/cborencoder.c.obj
    FAILED: modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build mcuboot/zephyr/zephyr.hex mcuboot/zephyr/zephyr.elf
    cmd.exe /C "cd /D D:\Projects\Nordic\OTA\hello_world\build\mcuboot && C:\Users\dagreen\ncs\v1.9.1\toolchain\opt\bin\cmake.exe --build . --"
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\Users\dagreen\ncs\v1.9.1\toolchain\opt\bin\cmake.EXE' --build 'd:\Projects\Nordic\OTA\hello_world\build'
    
    8715.prj.conf

    From child_image/mcuboot

    8715.prj.conf7220.nrf52dk_nrf52810.overlay

  • Hi,

    Looks like the overlay is not getting applied. Check the start of the log to see if it's get applied or not.

    I am using Zephyr 3.0.99 with the nrf52810 on a ublox BMD-330 eval board.

    If you are building for ubx_bmd330eval_nrf52810 , then you should name your overlay file ubx_bmd330eval_nrf52810.overlay and not nrf52dk_nrf52810.overlay

  • I am using version 1.9.1

    I began debugging MCUboot and finally figured out the settings and their dependencies. Now I have things building and seem to work. I can mount a file system on the storage partition and read/write files. So I am convinced the external flash is working.

    My question is does MCUMGR support image partitions on the external flash? When I use it to list the partitions only see the ones on the internal flash. I would like to use it to upload and test booting from external flash.

    > mcumgr -c nrf52 image list

    Images:
    image=0 slot=0
    version: 0.0.0
    bootable: true
    flags: active confirmed
    hash: 3cc864cc51508c03e70aa83fd49d47e0aaf943736eb7b1ac1472c69511eeb718
    Split status: N/A (0)

    The board.dts file looks like the partitions are defined and the partition manager seems to confirm it.

    west build -t partition_manager_report
    -- west build: running target partition_manager_report
    [1/1] cmd.exe /C "cd /D D:\Projects\Nordic\OTA\littlefs_ub... D:/Projects/Nordic/OTA/littlefs_ubx/build/partitions.yml"
    external_flash (0x40000 - 256kB):
    +-------------------------------------------+
    | 0x0: mcuboot_secondary (0x24000 - 144kB) |
    | 0x24000: external_flash (0x1c000 - 112kB) |
    +-------------------------------------------+

    flash_primary (0x30000 - 192kB):
    +-------------------------------------------------+
    | 0x0: mcuboot (0xc000 - 48kB) |
    +---0xc000: mcuboot_primary (0x24000 - 144kB)-----+
    | 0xc000: mcuboot_pad (0x200 - 512B) |
    +---0xc200: mcuboot_primary_app (0x23e00 - 143kB)-+
    | 0xc200: app (0x23e00 - 143kB) |
    +-------------------------------------------------+

    sram_primary (0x6000 - 24kB):
    +------------------------------------------+
    | 0x20000000: sram_primary (0x6000 - 24kB) |
    +------------------------------------------+

    From ubx_bmd330eval_nrf52810.dts

    &flash0 {

        partitions {
            compatible = "fixed-partitions";
            #address-cells = <1>;
            #size-cells = <1>;

            boot_partition: partition@0 {
                label = "mcuboot";
                reg = <0x00000000 0xc000>;
            };
            slot0_partition: partition@c000 {
                label = "image-0";
                reg = <0x0000C000 0xd000>;
            };
            slot1_partition: partition@19000 {
                label = "image-1";
                reg = <0x00019000 0xd000>;
            };
            scratch_partition: partition@26000 {
                label = "image-scratch";
                reg = <0x00026000 0x3000>;
            };
            storage_partition: partition@29000 {
                label = "storage";
                reg = <0x00029000 0x00007000>;
            };
        };
    };
Related