<?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>Multiple Device Tree SPI definitions for a single hardware interface</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72939/multiple-device-tree-spi-definitions-for-a-single-hardware-interface</link><description>Hello, 
 I am in the process of porting application code from the old nRF 15.x SDK to the new zephyr based ncs 1.5.0 SDK and would like to do all hardware configurations in the device tree now that one is available. 
 My current hardware application utilizes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Mar 2021 13:32:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72939/multiple-device-tree-spi-definitions-for-a-single-hardware-interface" /><item><title>RE: Multiple Device Tree SPI definitions for a single hardware interface</title><link>https://devzone.nordicsemi.com/thread/300689?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 13:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07ff4c94-1300-4452-8144-cfc6b79dc3dd</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The main problem&amp;nbsp;here is that when using the&amp;nbsp;zephyr spi drivers, then the configuration is static during compilation. It&amp;#39;s not really been designed to dynamically adjust or update pins run-time. So if you need spi functionality on two set of pins, then you would need to use two instances of spi in zephyr. I believe&amp;nbsp;a good starting point for using the zephyr spi driver may be these pages:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/peripherals/posts/adding-a-peripheral-to-an-ncs-zephyr-project"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/peripherals/posts/adding-a-peripheral-to-an-ncs-zephyr-project&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70627/what-s-the-official-way-to-implement-a-simple-peripheral-spi-i2c-etc-with-ncs/290615#290615"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/70627/what-s-the-official-way-to-implement-a-simple-peripheral-spi-i2c-etc-with-ncs/290615#290615&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s possible to overcome&amp;nbsp;the above limitation by using nrfx_spim directly, then you can dynamically change this in run-time as on the old nRF5 SDK. You can find an example here on how to use nrfx_spim directly (also make sure to check the configuration in prj.conf):&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66488/using-spi-with-ppi-in-zephyr/272139#272139"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/66488/using-spi-with-ppi-in-zephyr/272139#272139&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>