CONFIG_SPI_NOR was assigned the value y, but got the value n.

Hello,

I am trying to implement littlefs in my external flash memory. I am using nrf52832 and try to implement the littlefs sample code. 

When I am trying to enable Config_spi_nor then I found CONFIG_SPI_NOR was assigned the value y, but got the value n. Could you please help me how I can enable this configuration? 

I am also attaching my overlay file and prj file. Please have a look. 

 

Thank you.

Best regards

FS

CONFIG_FLASH=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

CONFIG_MAIN_STACK_SIZE=4096

# Let __ASSERT do its job
CONFIG_DEBUG=y

CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y

CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y

CONFIG_SETTINGS=y
CONFIG_SETTINGS_FS=y
CONFIG_SETTINGS_FS_DIR="/lfs/settings"
CONFIG_SETTINGS_FS_FILE="/lfs/settings/run"

Parents
  • // To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.
    
    // You can also use the buttons in the sidebar to perform actions on nodes.
    // Actions currently available include:
    
    // * Enabling / disabling the node
    // * Adding the bus to a bus
    // * Removing the node
    // * Connecting ADC channels
    
    // For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
    // You can also visit the nRF DeviceTree extension documentation at https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/ncs_configure_app.html#devicetree-support-in-the-extension
    &spi2 {
        IS25LP128: IS25LP128@0 {
           compatible = "jedec,spi-nor";
           label = "25LP128";
           reg = <0>;
           spi-max-frequency = <40000000>; /* Adjust based on your flash specifications *//* Adjust based on your flash JEDEC ID */
           size = <0x8000000>; /* Adjust based on your flash size */
           has-dpd;
           t-enter-dpd = <3000>;
           t-exit-dpd = <3000>;
           jedec-id = [9d 60 18]; 
           partitions {
               compatible = "fixed-partitions";
               #address-cells = <1>;
               #size-cells = <1>;
    
              lfs1_part: partition@0 {
              label = "littlefs_storage";
              reg = <0x00000000 0x01000000>;
           };
        };  
      };
    };
     
    
     / {
         fstab {
             compatible = "zephyr,fstab";
             lfs1: lfs1 {
                 compatible = "zephyr,fstab,littlefs";
                 mount-point = "/lfs1";
                 partition = <&lfs1_part>;
                 automount;
                 read-size = <16>;
                 prog-size = <16>;
                 cache-size = <64>;
                 lookahead-size = <32>;
                 block-cycles = <512>;
             };
         };
     };
    
    /{
       chosen {
           nordic,pm-ext-flash = &IS25LP128;
       };
     };

  • Hi,

    Which board are you using?

    Does this board have an external flash on it?

    Is the SPI DTS node you use enabled (status = "okay")?

    Regards,
    Sigurd Hellesvik

  •  SPI2 status is also okay. 

    Moreover I try SPI1 in the overlay as well. Still get the same issue.

  • Looks like maybe the overlay is not included in the build?

    Try to make an obvious error in the overlay file and see if that crashes the build?

  • I make a obvious error in the overlay. 

    Change the compatible "nordic,nrf-spi" to 'jedec,spi-nor' . 

    It crashes the build. I am attaching the error massage here. 

    [89/149] 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 
    F:\NRF\toolchains\cf2149caf2\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52832_XXAA -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IF:/NRF/v2.6.1/zephyr/include -IF:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated -IF:/NRF/v2.6.1/zephyr/soc/arm/nordic_nrf/nrf52 -IF:/NRF/v2.6.1/zephyr/soc/common/nordic_nrf/. -IF:/NRF/v2.6.1/zephyr/soc/arm/nordic_nrf/common/. -IF:/NRF/v2.6.1/nrf/include -IF:/NRF/v2.6.1/nrf/tests/include -IF:/NRF/v2.6.1/modules/hal/cmsis/CMSIS/Core/Include -IF:/NRF/v2.6.1/zephyr/modules/cmsis/. -IF:/NRF/v2.6.1/modules/hal/nordic/nrfx -IF:/NRF/v2.6.1/modules/hal/nordic/nrfx/drivers/include -IF:/NRF/v2.6.1/modules/hal/nordic/nrfx/mdk -IF:/NRF/v2.6.1/zephyr/modules/hal_nordic/nrfx/. -IF:/NRF/v2.6.1/modules/debug/segger/SEGGER -IF:/NRF/v2.6.1/modules/debug/segger/Config -isystem F:/NRF/v2.6.1/zephyr/lib/libc/common/include -Wshadow -fno-strict-aliasing -Og -imacros F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=F:/NRF/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2=CMAKE_SOURCE_DIR -fmacro-prefix-map=F:/NRF/v2.6.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=F:/NRF/v2.6.1=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -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 F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c
    In file included from F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain.h:50,
                     from F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util.h:18,
                     from F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:26,
                     from F:/NRF/v2.6.1/zephyr/include/zephyr/device.h:12,
                     from F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/flash.h:28,
                     from F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:14:
    F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "jedec,spi-nor jedec-id required for non-runtime SFDP"
       87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                    ^~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1468:1: note: in expansion of macro 'BUILD_ASSERT'
     1468 | BUILD_ASSERT(DT_INST_NODE_HAS_PROP(0, jedec_id),
          | ^~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "jedec,spi-nor size required for non-runtime SFDP page layout"
       87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                    ^~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1477:1: note: in expansion of macro 'BUILD_ASSERT'
     1477 | BUILD_ASSERT(DT_INST_NODE_HAS_PROP(0, size),
          | ^~~~~~~~~~~~
    F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated/devicetree_generated.h:2168:35: error: 'DT_N_S_soc_S_spi_40004000_P_size' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40004000_P_reg'?
     2168 | #define DT_N_INST_0_jedec_spi_nor DT_N_S_soc_S_spi_40004000
          |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:87:51: note: in definition of macro 'BUILD_ASSERT'
       87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                                   ^~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:615:32: note: in expansion of macro 'DT_CAT3'
      615 | #define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
          |                                ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3521:34: note: in expansion of macro 'DT_PROP'
     3521 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_N_INST_0_jedec_spi_nor'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:334:31: note: in expansion of macro 'UTIL_CAT'
      334 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3319:27: note: in expansion of macro 'DT_INST'
     3319 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3521:42: note: in expansion of macro 'DT_DRV_INST'
     3521 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1481:23: note: in expansion of macro 'DT_INST_PROP'
     1481 | #define INST_0_BYTES (DT_INST_PROP(0, size) / 8)
          |                       ^~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1487:29: note: in expansion of macro 'INST_0_BYTES'
     1487 | #define LAYOUT_PAGES_COUNT (INST_0_BYTES / CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE)
          |                             ^~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1489:55: note: in expansion of macro 'LAYOUT_PAGES_COUNT'
     1489 | BUILD_ASSERT((CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE * LAYOUT_PAGES_COUNT)
          |                                                       ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1489:14: error: expression in static assertion is not an integer
     1489 | BUILD_ASSERT((CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE * LAYOUT_PAGES_COUNT)
          |              ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:87:51: note: in definition of macro 'BUILD_ASSERT'
       87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                                   ^~~~
    In file included from F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:98:
    F:/NRF/v2.6.1/zephyr/include/zephyr/device.h:89:41: error: '__device_dts_ord_DT_N_S_soc_S_spi_40004000_BUS_ORD' undeclared here (not in a function)
       89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
          |                                         ^~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/device.h:89:33: note: in expansion of macro '_CONCAT'
       89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
          |                                 ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/device.h:216:37: note: in expansion of macro 'DEVICE_NAME_GET'
      216 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
          |                                     ^~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/device.h:233:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
      233 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
          |                                  ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:388:24: note: in expansion of macro 'DEVICE_DT_GET'
      388 |                 .bus = DEVICE_DT_GET(DT_BUS(node_id)),               \
          |                        ^~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:9: note: in expansion of macro 'SPI_DT_SPEC_GET'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |         ^~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1528:16: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1528 |         .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |                ^~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated/devicetree_generated.h:2168:35: error: 'DT_N_S_soc_S_spi_40004000_P_spi_max_frequency' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40003000_P_max_frequency'?
     2168 | #define DT_N_INST_0_jedec_spi_nor DT_N_S_soc_S_spi_40004000
          |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:4343:29: note: in definition of macro 'DT_CAT3'
     4343 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
          |                             ^~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:332:30: note: in expansion of macro 'DT_PROP'
      332 |                 .frequency = DT_PROP(node_id, spi_max_frequency),       \
          |                              ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:389:27: note: in expansion of macro 'SPI_CONFIG_DT'
      389 |                 .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |                           ^~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:9: note: in expansion of macro 'SPI_DT_SPEC_GET'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |         ^~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_N_INST_0_jedec_spi_nor'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:334:31: note: in expansion of macro 'UTIL_CAT'
      334 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3319:27: note: in expansion of macro 'DT_INST'
     3319 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:25: note: in expansion of macro 'DT_DRV_INST'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                         ^~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1528:16: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1528 |         .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |                ^~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated/devicetree_generated.h:2168:35: error: 'DT_N_S_soc_S_spi_40004000_P_duplex' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40004000_P_reg'?
     2168 | #define DT_N_INST_0_jedec_spi_nor DT_N_S_soc_S_spi_40004000
          |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:4343:29: note: in definition of macro 'DT_CAT3'
     4343 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
          |                             ^~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:334:25: note: in expansion of macro 'DT_PROP'
      334 |                         DT_PROP(node_id, duplex) |                      \
          |                         ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:389:27: note: in expansion of macro 'SPI_CONFIG_DT'
      389 |                 .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |                           ^~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:9: note: in expansion of macro 'SPI_DT_SPEC_GET'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |         ^~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_N_INST_0_jedec_spi_nor'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:334:31: note: in expansion of macro 'UTIL_CAT'
      334 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3319:27: note: in expansion of macro 'DT_INST'
     3319 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:25: note: in expansion of macro 'DT_DRV_INST'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                         ^~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1528:16: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1528 |         .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |                ^~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated/devicetree_generated.h:2168:35: error: 'DT_N_S_soc_S_spi_40004000_P_frame_format' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40004000_P_interrupts'?
     2168 | #define DT_N_INST_0_jedec_spi_nor DT_N_S_soc_S_spi_40004000
          |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:4343:29: note: in definition of macro 'DT_CAT3'
     4343 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
          |                             ^~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:335:25: note: in expansion of macro 'DT_PROP'
      335 |                         DT_PROP(node_id, frame_format) |                        \
          |                         ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:389:27: note: in expansion of macro 'SPI_CONFIG_DT'
      389 |                 .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |                           ^~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:9: note: in expansion of macro 'SPI_DT_SPEC_GET'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |         ^~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_N_INST_0_jedec_spi_nor'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:334:31: note: in expansion of macro 'UTIL_CAT'
      334 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3319:27: note: in expansion of macro 'DT_INST'
     3319 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:25: note: in expansion of macro 'DT_DRV_INST'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                         ^~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1528:16: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1528 |         .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |                ^~~~~~~~~~~~~~~~~~~~
    In file included from F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:19:
    F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated/devicetree_generated.h:2174:57: warning: unsigned conversion from 'int' to 'short unsigned int' changes value from '1073758208' to '16384' [-Woverflow]
     2174 | #define DT_N_S_soc_S_spi_40004000_REG_IDX_0_VAL_ADDRESS 1073758208 /* 0x40004000 */
          |                                                         ^~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:4345:33: note: in expansion of macro 'DT_N_S_soc_S_spi_40004000_REG_IDX_0_VAL_ADDRESS'
     4345 | #define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
          |                                 ^~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:2202:9: note: in expansion of macro 'DT_CAT4'
     2202 |         DT_CAT4(node_id, _REG_IDX_, idx, _VAL_ADDRESS)
          |         ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:2225:30: note: in expansion of macro 'DT_REG_ADDR_BY_IDX'
     2225 | #define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
          |                              ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:339:26: note: in expansion of macro 'DT_REG_ADDR'
      339 |                 .slave = DT_REG_ADDR(node_id),                          \
          |                          ^~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:389:27: note: in expansion of macro 'SPI_CONFIG_DT'
      389 |                 .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |                           ^~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:9: note: in expansion of macro 'SPI_DT_SPEC_GET'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |         ^~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_N_INST_0_jedec_spi_nor'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:334:31: note: in expansion of macro 'UTIL_CAT'
      334 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3319:27: note: in expansion of macro 'DT_INST'
     3319 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:25: note: in expansion of macro 'DT_DRV_INST'
      404 |         SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
          |                         ^~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1528:16: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
     1528 |         .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
          |                ^~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.5.0/zephyr/samples/basic/littlefs_2/build/zephyr/include/generated/devicetree_generated.h:2168:35: error: 'DT_N_S_soc_S_spi_40004000_P_jedec_id' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40004000_P_reg'?
     2168 | #define DT_N_INST_0_jedec_spi_nor DT_N_S_soc_S_spi_40004000
          |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:4343:29: note: in definition of macro 'DT_CAT3'
     4343 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
          |                             ^~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3521:34: note: in expansion of macro 'DT_PROP'
     3521 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_N_INST_0_jedec_spi_nor'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    F:/NRF/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:334:31: note: in expansion of macro 'UTIL_CAT'
      334 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3319:27: note: in expansion of macro 'DT_INST'
     3319 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    F:/NRF/v2.6.1/zephyr/include/zephyr/devicetree.h:3521:42: note: in expansion of macro 'DT_DRV_INST'
     3521 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    F:/NRF/v2.6.1/zephyr/drivers/flash/spi_nor.c:1545:21: note: in expansion of macro 'DT_INST_PROP'
     1545 |         .jedec_id = DT_INST_PROP(0, jedec_id),
          |                     ^~~~~~~~~~~~
    [94/149] Building C object zephyr/drivers/spi/CMakeFiles/drivers__spi.dir/spi_nrfx_common.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'F:\NRF\toolchains\cf2149caf2\opt\bin\cmake.EXE' --build 'f:\NRF\v2.5.0\zephyr\samples\basic\littlefs_2\build'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    

  • I tried on my end.

    To build the hello world sample with the overlay and prj.conf you supplied earlier in this ticket. Building for nrf52dk_nrf52832.

    And it builds without error on my side.
    Do you see the same if you do this with the hello world sample?

  •  I also did the same with my hello world sample and getting the same result. 

Reply Children
  • Could you zip that and upload it here so I can try the exact same?

  • 8765.littlefs.zip Hi, I have uploaded the zip file. I am using the little fs sample code and modify the overlay file and prj file for my nrf52832. 

    I am getting the waring every time. 

  • It works for me as you can see below.
    Have you changed anything in the SDK?

    west build -p -b nrf52dk_nrf52832
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/sihe/Downloads/tmp/littlefs
    -- CMake version: 3.30.2
    -- Found Python3: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: /home/sihe/.cache/zephyr
    -- Zephyr version: 3.5.99 (/home/sihe/ncs/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk_nrf52832
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found host-tools: zephyr 0.16.8 (/home/sihe/zephyr-sdk-0.16.8)
    -- Found toolchain: zephyr 0.16.8 (/home/sihe/zephyr-sdk-0.16.8)
    -- Found Dtc: /usr/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/sihe/ncs/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts
    -- Found devicetree overlay: /home/sihe/Downloads/tmp/littlefs/nrf52dk_nrf52832.overlay
    'label' is marked as deprecated in 'properties:' in /home/sihe/ncs/zephyr/dts/bindings/mtd/jedec,spi-nor.yaml for node /soc/spi@40023000/IS25LP128@0.
    -- Generated zephyr.dts: /home/sihe/Downloads/tmp/littlefs/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/sihe/Downloads/tmp/littlefs/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/sihe/Downloads/tmp/littlefs/build/zephyr/dts.cmake
    
    warning: Deprecated symbol SETTINGS_FS is enabled.
    
    Parsing /home/sihe/Downloads/tmp/littlefs/Kconfig
    Loaded configuration '/home/sihe/ncs/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832_defconfig'
    Merged configuration '/home/sihe/Downloads/tmp/littlefs/prj.conf'
    Configuration saved to '/home/sihe/Downloads/tmp/littlefs/build/zephyr/.config'
    Kconfig header saved to '/home/sihe/Downloads/tmp/littlefs/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /home/sihe/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/sihe/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /usr/bin/ccache
    -- Configuring done (2.8s)
    -- Generating done (0.1s)
    -- Build files have been written to: /home/sihe/Downloads/tmp/littlefs/build
    -- west build: building application
    [1/161] Preparing syscall dependency handling
    
    [3/161] Generating include/generated/version.h
    -- Zephyr version: 3.5.99 (/home/sihe/ncs/zephyr), build: v3.5.99-ncs1-1
    [161/161] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       62608 B       512 KB     11.94%
                 RAM:       11360 B        64 KB     17.33%
            IDT_LIST:          0 GB        32 KB      0.00%
    

  • it also works for me but got the warning. and yellow line under CONFIG_SPI_NOR=y 

  • The warning should also be present in your build log, right?

Related