<?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>Delay between SPI clock and Data bytes in Zephyr nRF52832 - spi_transceive_dt()</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118467/delay-between-spi-clock-and-data-bytes-in-zephyr-nrf52832---spi_transceive_dt</link><description>Hello Everyone, 
 
 I have configured SPI1 at 1MHz, to receive data with a sensor. Basically i am reading data from a sensor device. So calling spi_transceive_dt() with 4 Tx byte and 4 Rx bytes (Initially tried with 3 Tx bytes and 3 Rx bytes as sensor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jan 2025 11:36:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118467/delay-between-spi-clock-and-data-bytes-in-zephyr-nrf52832---spi_transceive_dt" /><item><title>RE: Delay between SPI clock and Data bytes in Zephyr nRF52832 - spi_transceive_dt()</title><link>https://devzone.nordicsemi.com/thread/520687?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 11:36:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a436deac-5313-4509-9b3f-a669cb3e610e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your spi1 instance uses the non-DMA capable &amp;quot;nordic,nrf-spi&amp;quot;, so you will see a delay between transactions.&lt;/p&gt;
&lt;p&gt;Please see my former answer on how to use &amp;quot;nordic,nrf-spi&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;m&lt;/strong&gt;&lt;/span&gt;&amp;quot; (and its errata), which is the DMA capable peripheral.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;H&amp;aring;kon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay between SPI clock and Data bytes in Zephyr nRF52832 - spi_transceive_dt()</title><link>https://devzone.nordicsemi.com/thread/520682?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 10:41:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62e93482-d64a-4d87-8336-ad5e386aa25d</guid><dc:creator>pradeep8892</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please find the zephyr.dts file attached.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0511.zephyr.dts"&gt;devzone.nordicsemi.com/.../0511.zephyr.dts&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Warm regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Pradeep&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay between SPI clock and Data bytes in Zephyr nRF52832 - spi_transceive_dt()</title><link>https://devzone.nordicsemi.com/thread/520680?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 10:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e00cb65-c23b-4b7c-b92d-761387df2c5f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you share your build/app-name/zephyr/zephyr.dts file?&lt;/p&gt;
&lt;p&gt;By default, spi1 is using the non-DMA capable NRF_SPI peripheral:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts#L200"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts#L200&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you change it to &amp;quot;nrf-spim&amp;quot; instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;spi1_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;spi1_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It will use DMA.&lt;/p&gt;
&lt;p&gt;Please note that&amp;nbsp;nRF52832 has a critical errata with SPIM:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/errata_nRF52832_Rev1/page/ERR/nRF52832/Rev1/latest/anomaly_832_58.html"&gt;https://docs.nordicsemi.com/bundle/errata_nRF52832_Rev1/page/ERR/nRF52832/Rev1/latest/anomaly_832_58.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If your device is not affected by this errata, you can set &amp;quot;CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y&amp;quot; to override it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>