<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nordic SPI Zephyr example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97241/nordic-spi-zephyr-example</link><description>Hello, 
 I am looking for an example which uses nrf-spim driver in Zephyr environment. I am currently working with nrf9160 board, and this device has configured by default 
 
 &amp;quot;nordic,nrf-spim&amp;quot; driver. I am not able to find any example (Updated) which</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Mar 2023 16:05:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97241/nordic-spi-zephyr-example" /><item><title>RE: Nordic SPI Zephyr example</title><link>https://devzone.nordicsemi.com/thread/413092?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 16:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f33ee15e-13d3-4a3f-8816-c3a2edb5ad24</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Can you try to add:&amp;nbsp;&lt;span&gt;pinctrl-names&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;&amp;quot;default&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;quot;sleep&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;To&amp;nbsp;&lt;/span&gt;&lt;/span&gt;my_spi_slave in the overlay file.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic SPI Zephyr example</title><link>https://devzone.nordicsemi.com/thread/412993?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 11:59:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c458828e-880c-4022-8abe-34af69f6a949</guid><dc:creator>jfpastrana</dc:creator><description>&lt;p&gt;Hello Kenneth,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have already found this example, and I adapted to nrf9160. The example that you provided is not compiling for the board nrf5340 which is closer to nrf9160 rather than nrf52832.&lt;/p&gt;
&lt;p&gt;It throws the following error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:89:10: error: &amp;#39;PINCTRL_STATE_DT_N_S_soc_S_peripheral_50000000_S_spi_b000_PINCTRL_IDX_0_UPPER_TOKEN&amp;#39; undeclared here (not in a function); did you mean &amp;#39;DT_N_S_soc_S_peripheral_50000000_S_spi_a000_PINCTRL_IDX_0_UPPER_TOKEN&amp;#39;?
   89 |  _CONCAT(PINCTRL_STATE_,             \
      |          ^~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:67:26: note: in definition of macro &amp;#39;__DEBRACKET&amp;#39;
   67 | #define __DEBRACKET(...) __VA_ARGS__
      |                          ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:59:2: note: in expansion of macro &amp;#39;__GET_ARG2_DEBRACKET&amp;#39;
   59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
      |  ^~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:54:2: note: in expansion of macro &amp;#39;__COND_CODE&amp;#39;
   54 |  __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_macro.h:157:2: note: in expansion of macro &amp;#39;Z_COND_CODE_1&amp;#39;
  157 |  Z_COND_CODE_1(_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_macro.h:201:2: note: in expansion of macro &amp;#39;COND_CODE_1&amp;#39;
  201 |  COND_CODE_1(_flag, _code, ())
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\drivers\spi\spi_nrfx_spis.c:298:2: note: in expansion of macro &amp;#39;IF_ENABLED&amp;#39;
  298 |  IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_DEFINE(SPIS(idx))));        \
      |  ^~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:64:53: note: in expansion of macro &amp;#39;__DEBRACKET&amp;#39;
   64 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
      |                                                     ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:59:2: note: in expansion of macro &amp;#39;__GET_ARG2_DEBRACKET&amp;#39;
   59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
      |  ^~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:54:2: note: in expansion of macro &amp;#39;__COND_CODE&amp;#39;
   54 |  __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_macro.h:157:2: note: in expansion of macro &amp;#39;Z_COND_CODE_1&amp;#39;
  157 |  Z_COND_CODE_1(_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:154:2: note: in expansion of macro &amp;#39;COND_CODE_1&amp;#39;
  154 |  COND_CODE_1(Z_PINCTRL_SKIP_STATE(state_idx, node_id), (),        \
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\toolchain\common.h:133:23: note: in expansion of macro &amp;#39;_DO_CONCAT&amp;#39;
  133 | #define _CONCAT(x, y) _DO_CONCAT(x, y)
      |                       ^~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:89:2: note: in expansion of macro &amp;#39;_CONCAT&amp;#39;
   89 |  _CONCAT(PINCTRL_STATE_,             \
      |  ^~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:156:9: note: in expansion of macro &amp;#39;Z_PINCTRL_STATE_ID&amp;#39;
  156 |   .id = Z_PINCTRL_STATE_ID(state_idx, node_id),         \
      |         ^~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_loops.h:1086:2: note: in expansion of macro &amp;#39;Z_PINCTRL_STATE_INIT&amp;#39;
 1086 |  F(0, __VA_ARGS__)
      |  ^
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_loops.h:1089:2: note: in expansion of macro &amp;#39;Z_UTIL_LISTIFY_1&amp;#39;
 1089 |  Z_UTIL_LISTIFY_1(F, sep, __VA_ARGS__) __DEBRACKET sep \
      |  ^~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:99:36: note: in expansion of macro &amp;#39;Z_UTIL_LISTIFY_2&amp;#39;
   99 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
      |                                    ^
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:170:3: note: in expansion of macro &amp;#39;LISTIFY&amp;#39;
  170 |   LISTIFY(DT_NUM_PINCTRL_STATES(node_id),          \
      |   ^~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:240:2: note: in expansion of macro &amp;#39;Z_PINCTRL_STATES_DEFINE&amp;#39;
  240 |  Z_PINCTRL_STATES_DEFINE(node_id)           \
      |  ^~~~~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\drivers\spi\spi_nrfx_spis.c:298:30: note: in expansion of macro &amp;#39;PINCTRL_DT_DEFINE&amp;#39;
  298 |  IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_DEFINE(SPIS(idx))));        \
      |                              ^~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\drivers\spi\spi_nrfx_spis.c:333:1: note: in expansion of macro &amp;#39;SPI_NRFX_SPIS_DEFINE&amp;#39;
  333 | SPI_NRFX_SPIS_DEFINE(2);
      | ^~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:89:10: error: &amp;#39;PINCTRL_STATE_DT_N_S_soc_S_peripheral_50000000_S_spi_b000_PINCTRL_IDX_1_UPPER_TOKEN&amp;#39; undeclared here (not in a function); did you mean &amp;#39;DT_N_S_soc_S_peripheral_50000000_S_spi_a000_PINCTRL_IDX_1_UPPER_TOKEN&amp;#39;?
   89 |  _CONCAT(PINCTRL_STATE_,             \
      |          ^~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:67:26: note: in definition of macro &amp;#39;__DEBRACKET&amp;#39;
   67 | #define __DEBRACKET(...) __VA_ARGS__
      |                          ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:59:2: note: in expansion of macro &amp;#39;__GET_ARG2_DEBRACKET&amp;#39;
   59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
      |  ^~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:54:2: note: in expansion of macro &amp;#39;__COND_CODE&amp;#39;
   54 |  __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_macro.h:157:2: note: in expansion of macro &amp;#39;Z_COND_CODE_1&amp;#39;
  157 |  Z_COND_CODE_1(_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_macro.h:201:2: note: in expansion of macro &amp;#39;COND_CODE_1&amp;#39;
  201 |  COND_CODE_1(_flag, _code, ())
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\drivers\spi\spi_nrfx_spis.c:298:2: note: in expansion of macro &amp;#39;IF_ENABLED&amp;#39;
  298 |  IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_DEFINE(SPIS(idx))));        \
      |  ^~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:64:53: note: in expansion of macro &amp;#39;__DEBRACKET&amp;#39;
   64 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
      |                                                     ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:59:2: note: in expansion of macro &amp;#39;__GET_ARG2_DEBRACKET&amp;#39;
   59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
      |  ^~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:54:2: note: in expansion of macro &amp;#39;__COND_CODE&amp;#39;
   54 |  __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_macro.h:157:2: note: in expansion of macro &amp;#39;Z_COND_CODE_1&amp;#39;
  157 |  Z_COND_CODE_1(_flag, _if_1_code, _else_code)
      |  ^~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:154:2: note: in expansion of macro &amp;#39;COND_CODE_1&amp;#39;
  154 |  COND_CODE_1(Z_PINCTRL_SKIP_STATE(state_idx, node_id), (),        \
      |  ^~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\toolchain\common.h:133:23: note: in expansion of macro &amp;#39;_DO_CONCAT&amp;#39;
  133 | #define _CONCAT(x, y) _DO_CONCAT(x, y)
      |                       ^~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:89:2: note: in expansion of macro &amp;#39;_CONCAT&amp;#39;
   89 |  _CONCAT(PINCTRL_STATE_,             \
      |  ^~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:156:9: note: in expansion of macro &amp;#39;Z_PINCTRL_STATE_ID&amp;#39;
  156 |   .id = Z_PINCTRL_STATE_ID(state_idx, node_id),         \
      |         ^~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_loops.h:1090:2: note: in expansion of macro &amp;#39;Z_PINCTRL_STATE_INIT&amp;#39;
 1090 |  F(1, __VA_ARGS__)
      |  ^
C:\ncs\v2.1.1\zephyr\include\zephyr\sys\util_internal.h:99:36: note: in expansion of macro &amp;#39;Z_UTIL_LISTIFY_2&amp;#39;
   99 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
      |                                    ^
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:170:3: note: in expansion of macro &amp;#39;LISTIFY&amp;#39;
  170 |   LISTIFY(DT_NUM_PINCTRL_STATES(node_id),          \
      |   ^~~~~~~
C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:240:2: note: in expansion of macro &amp;#39;Z_PINCTRL_STATES_DEFINE&amp;#39;
  240 |  Z_PINCTRL_STATES_DEFINE(node_id)           \
      |  ^~~~~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\drivers\spi\spi_nrfx_spis.c:298:30: note: in expansion of macro &amp;#39;PINCTRL_DT_DEFINE&amp;#39;
  298 |  IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_DEFINE(SPIS(idx))));        \
      |                              ^~~~~~~~~~~~~~~~~
C:\ncs\v2.1.1\zephyr\drivers\spi\spi_nrfx_spis.c:333:1: note: in expansion of macro &amp;#39;SPI_NRFX_SPIS_DEFINE&amp;#39;
  333 | SPI_NRFX_SPIS_DEFINE(2);
      | ^~~~~~~~~~~~~~~~~~~~
[116/177] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/nrf_rtc_timer.c.obj
[117/177] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
[118/177] Building C object zephyr/drivers/spi/CMakeFiles/drivers__spi.dir/spi_nrfx_spim.c.obj
[119/177] Building C object modules/nrf/drivers/hw_cc310/CMakeFiles/..__nrf__drivers__hw_cc310.dir/hw_cc310.c.obj
[120/177] Linking C static library zephyr\drivers\console\libdrivers__console.a
[121/177] Linking C static library zephyr\drivers\clock_control\libdrivers__clock_control.a
[122/177] Linking C static library zephyr\libzephyr.a
[123/177] Linking C static library zephyr\drivers\gpio\libdrivers__gpio.a
[124/177] Linking C static library zephyr\drivers\serial\libdrivers__serial.a
[125/177] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
[126/177] Linking C static library zephyr\drivers\pinctrl\libdrivers__pinctrl.a
[127/177] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.1.1/modules/hal/nordic/nrfx/helpers/nrfx_flag32_allocator.c.obj
[128/177] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.1.1/modules/hal/nordic/nrfx/drivers/src/nrfx_clock.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: &amp;#39;c:\ncs\toolchains\v2.1.1\opt\bin\cmake.EXE&amp;#39; --build &amp;#39;c:\Users\M0146164\vs-workspace\ncs-spi-master-slave-example\build&amp;#39;

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Moreover, this example is not updated, it is using deprecated functions.&lt;/p&gt;
&lt;p&gt;I have did the overlay for nrf9160 but I am facing the same issues as nrf5340 board.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic SPI Zephyr example</title><link>https://devzone.nordicsemi.com/thread/412991?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 11:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0b2b56a-da07-4791-b1c6-a936d5cb354f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Check out:&amp;nbsp;&lt;a href="https://github.com/too1/ncs-spi-master-slave-example"&gt;https://github.com/too1/ncs-spi-master-slave-example&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s missing an .overlay file for the nRF9160DK, but you should be able to make that based on one of the other .overlay files that are there.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>