nrf52dk not able to build the SPI project.

Hello,

We are using nrf52dk, with zephyr OS also we have done the setup in VS code with extension.

Toolchain version: v2.9.0

SDK version: 3.7.99-ncs2, these all came in extension of nrf connect in vs code.

Expectation: We need to communicate the sensor over SPI1 with MAX30001 device.

Problem: I am not able to build the project. getting error of SPI node.

Build error logs:

//
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' --build C:/nrf52/my_sample/sample_SPI/build

Can anyone please help me on this. As I am new on this. Please guide us how to solve this issue.

Parents
  • I have attached the logs

    FAILED: CMakeFiles/app.dir/src/main.c.obj 
    C:/nrf52/my_sample/sample_SPI/build/sample_SPI/zephyr/include/generated/zephyr/devicetree_generated.h:12836:42: error: 'DT_N_S_soc_S_spi_40004000_S_spi_dev_a_0_P_frame_format' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40004000_S_spi_dev_a_0_P_reg'?
    12836 | #define DT_N_NODELABEL_reg_my_spi_master DT_N_S_soc_S_spi_40004000_S_spi_dev_a_0
          |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4879:29: note: in definition of macro 'DT_CAT3'
     4879 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
          |                             ^~
    C:/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:352:25: note: in expansion of macro 'DT_PROP'
      352 |                         DT_PROP(node_id, frame_format) |                        \
          |                         ^~~~~~~
    C:/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:404:27: note: in expansion of macro 'SPI_CONFIG_DT'
      404 |                 .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |                           ^~~~~~~~~~~~~
    C:/nrf52/my_sample/sample_SPI/src/main.c:10:45: note: in expansion of macro 'SPI_DT_SPEC_GET'
       10 | static const struct spi_dt_spec spi1_spec = SPI_DT_SPEC_GET(
          |                                             ^~~~~~~~~~~~~~~
    C:/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4877:24: note: in expansion of macro 'DT_N_NODELABEL_reg_my_spi_master'
     4877 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:200:29: note: in expansion of macro 'DT_CAT'
      200 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    C:/nrf52/my_sample/sample_SPI/src/main.c:11:5: note: in expansion of macro 'DT_NODELABEL'
       11 |     DT_NODELABEL(reg_my_spi_master),  // Device tree node label
          |     ^~~~~~~~~~~~
    [47/148] Building C object zephyr/arch/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/scb.c.obj
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/sample_SPI-prefix/src/sample_SPI-stamp/sample_SPI-build C:/nrf52/my_sample/sample_SPI/build/_sysbuild/sysbuild/images/sample_SPI-prefix/src/sample_SPI-stamp/sample_SPI-build 

Reply
  • I have attached the logs

    FAILED: CMakeFiles/app.dir/src/main.c.obj 
    C:/nrf52/my_sample/sample_SPI/build/sample_SPI/zephyr/include/generated/zephyr/devicetree_generated.h:12836:42: error: 'DT_N_S_soc_S_spi_40004000_S_spi_dev_a_0_P_frame_format' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40004000_S_spi_dev_a_0_P_reg'?
    12836 | #define DT_N_NODELABEL_reg_my_spi_master DT_N_S_soc_S_spi_40004000_S_spi_dev_a_0
          |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4879:29: note: in definition of macro 'DT_CAT3'
     4879 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
          |                             ^~
    C:/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:352:25: note: in expansion of macro 'DT_PROP'
      352 |                         DT_PROP(node_id, frame_format) |                        \
          |                         ^~~~~~~
    C:/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:404:27: note: in expansion of macro 'SPI_CONFIG_DT'
      404 |                 .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
          |                           ^~~~~~~~~~~~~
    C:/nrf52/my_sample/sample_SPI/src/main.c:10:45: note: in expansion of macro 'SPI_DT_SPEC_GET'
       10 | static const struct spi_dt_spec spi1_spec = SPI_DT_SPEC_GET(
          |                                             ^~~~~~~~~~~~~~~
    C:/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4877:24: note: in expansion of macro 'DT_N_NODELABEL_reg_my_spi_master'
     4877 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:200:29: note: in expansion of macro 'DT_CAT'
      200 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    C:/nrf52/my_sample/sample_SPI/src/main.c:11:5: note: in expansion of macro 'DT_NODELABEL'
       11 |     DT_NODELABEL(reg_my_spi_master),  // Device tree node label
          |     ^~~~~~~~~~~~
    [47/148] Building C object zephyr/arch/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/scb.c.obj
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/sample_SPI-prefix/src/sample_SPI-stamp/sample_SPI-build C:/nrf52/my_sample/sample_SPI/build/_sysbuild/sysbuild/images/sample_SPI-prefix/src/sample_SPI-stamp/sample_SPI-build 

Children
No Data
Related