<?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>nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108537/nrf52811-in-spi-slave-mode</link><description>Hello Team, 
 i have created a custom board of nrf52811 Soc and want to use nrf52811 in slave mode with STM32 SPI masater. 
 i have created pinctrl.dtsi and dts file as per below images. is this a correct way to configure SPI0 in salve mode? 
 I am using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Feb 2024 14:38:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108537/nrf52811-in-spi-slave-mode" /><item><title>RE: nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/thread/471357?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2024 14:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b30fc227-d06e-4341-a9f5-032cf73ce349</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Can you upload your generated devicetree file (build/zephyr/zephyr.dts)? This should show if the pin configs are included correctly in the project.&lt;/p&gt;
&lt;p&gt;Did you check the pins with a logic analyzer/scope, to see if some/all pins are toggling as expected? If CS/SCK/MOSI toggles correctly, is there any response from the slave on the MISO pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/thread/470980?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 10:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb5f6410-0230-4576-9c18-7bd56c9b4c48</guid><dc:creator>PRAVIN_@yash</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i added &amp;amp;uicr in my devicetree but still the control not comes to&amp;nbsp;&lt;span&gt;spi_slave_write_test_msg() function&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;signaled value is 0 always&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;did i configure&amp;nbsp; pinctrl.dtsi file&amp;nbsp; correct?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;did you find anything wrong in code ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/uicr_5F00_added.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/signaled_5F00_value_5F00_0.JPG" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/thread/470975?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 10:23:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85548f74-80cc-455c-8008-44e31fcd72f9</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;GPIOs P0.09 and P0.10 are by default assigned to the NFCT peripherals, as these are the dedicated antenna pins. To use these as GPIOs, you need to &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.2/zephyr/releases/migration-guide-3.5.html#recommended-changes"&gt;configure this in your devicetree&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uicr {
    nfct-pins-as-gpios;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/thread/470824?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 16:31:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbf0d1bc-2d05-4ebb-ab5d-1e5be2bac4c8</guid><dc:creator>PRAVIN_@yash</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am able to resolve the error.&lt;/p&gt;
&lt;p&gt;i am not able to get control at&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;spi_slave_write_test_msg()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The master code is tested and is working with NRF52811 in slave mode using&amp;nbsp; NRFX_SPI_DRIVER&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;In master code, SPI mode 0 is used with 1MHz frequency&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;what could be the wrong in dts file or main file&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;My SPI slave configuration is:&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;SPIS_SCK = p0.6&lt;br /&gt;SPIS_MOSI=&amp;nbsp; p0.9&lt;/p&gt;
&lt;p&gt;SPIS_MISO = P0.10&lt;br /&gt;SPIS_CSN = P0.12&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5684.main.c"&gt;devzone.nordicsemi.com/.../5684.main.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/emg_5F00_nrf52811_2D00_pinctrl.dtsi"&gt;devzone.nordicsemi.com/.../emg_5F00_nrf52811_2D00_pinctrl.dtsi&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/emg_5F00_nrf52811.dts"&gt;devzone.nordicsemi.com/.../emg_5F00_nrf52811.dts&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6254.prj.conf"&gt;devzone.nordicsemi.com/.../6254.prj.conf&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/thread/470756?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 13:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c01cb4f2-8489-41ef-a263-aeb81a003f50</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;From the error message, it looks like the pins are not configured for the SPIS in your devicetree. When using the Zephyr driver, you will need to define the pins in devicetree/overlay,&lt;/p&gt;
&lt;p&gt;Can you post the overlay file you are using when building your project?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/thread/470575?ContentTypeID=1</link><pubDate>Sun, 25 Feb 2024 17:06:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf9f83f1-7689-4909-8cad-82e43bcc9beb</guid><dc:creator>PRAVIN_@yash</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;i am using zephyr driver to configure SPI peripheral in slave mode&lt;/p&gt;
&lt;p&gt;I am getting an build error for above configuration (pinctrl.dtsi) and dts file&amp;nbsp;&lt;/p&gt;
&lt;p&gt;what are the configuration missed here ?&lt;/p&gt;
&lt;p&gt;I am using custom board having spi interface only&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/zephyr_5F00_spi_5F00_init.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:348: undefined reference to `pinctrl_lookup_state&amp;#39;&lt;/p&gt;
&lt;p&gt;c:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/spi/libdrivers__spi.a(spi_nrfx_spis.c.obj): in function `pinctrl_apply_state_direct&amp;#39;:&lt;/p&gt;
&lt;p&gt;C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:329: undefined reference to `pinctrl_configure_pins&amp;#39;&lt;/p&gt;
&lt;p&gt;collect2.exe: error: ld returned 1 exit status&lt;/p&gt;
&lt;p&gt;ninja: build stopped: subcommand failed.&lt;/p&gt;
&lt;p&gt;FAILED: images/EMG_APP-prefix/src/EMG_APP-stamp/EMG_APP-build&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;FATAL ERROR: command exited with status 1:&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52811 in SPI slave mode</title><link>https://devzone.nordicsemi.com/thread/470304?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 15:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7aea0361-807b-4500-b749-ceca6c45e393</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]1. CS pin whether i can use cs pin in pinctrl file or i have to use it as a gpio? if yes how to configure it (GPIO PIN or GPIOTE pin)&amp;nbsp;[/quote]
&lt;p&gt;The CS pin must be assigned in the SPIS HW peripheral when the SPI Master&amp;nbsp;initiates a transfer, see the description of&amp;nbsp;&lt;a title="SPI slave operation" href="https://infocenter.nordicsemi.com/topic/ps_nrf52811/spis.html?cp=5_4_0_5_19_2#concept_abk_lbf_wr"&gt;SPI slave operation&lt;/a&gt;&amp;nbsp;in the nRF52811 Product Specifications.&lt;/p&gt;
&lt;p&gt;If you are using the nrfx_spis driver to configure the SPIS peripheral, it is not required to configure the CS pin in the devicetree/pinctrl, since the pin is set in the driver configuration struct. The devicetree/pinctrl nodes is used when Zephyr drivers are used to configure the peripheral.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have control of both sides of the SPI bus, you can technically configure the CS pin as a GPIO interrupt and send a &amp;quot;dummy&amp;quot; packet from the SPI Master to tell the slave to initialize the SPIS peripheral, but the current consumption by SPIS when CS pin is not asserted should not be quite low.&lt;/p&gt;
[quote user=""]2. how to enable interrupt in spi slave mode to detect master has sent data[/quote]
&lt;p&gt;When you are using the nrfx_spis driver, the driver should enable the appropriate interrupts for you. Once a transfer have been completed, the driver will pass an event to the application event handler that was set during initialization.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>