<?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>crashing after adding a driver to dts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92124/crashing-after-adding-a-driver-to-dts</link><description>hello Nordic 
 
 i work with ncs 1.7.1, with nrf52832 soc 
 i tried to add a driver and for some reason i fail and i can not understand why 
 
 this is my dts 
 
 this is the fault 
 
 at the moment the driver .c is empty, this is the driver.yaml 
 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Sep 2022 10:32:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92124/crashing-after-adding-a-driver-to-dts" /><item><title>RE: crashing after adding a driver to dts</title><link>https://devzone.nordicsemi.com/thread/387451?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 10:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1ac3f72-024f-4364-a86e-d699b073f475</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;ok the problem for the seconde issue is that in the driver init function i forgot to bind the bus&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;spi_dev = device_get_binding(..bus_name)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;that, with the unused mosi set to 0xFF in dts,&amp;nbsp; solved the issu&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;best regards&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Ziv&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: crashing after adding a driver to dts</title><link>https://devzone.nordicsemi.com/thread/387117?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 14:06:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83b799a7-3726-406d-83e6-13700aa21943</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not entirely sure which driver you are trying to add to your project (existing or new one), maybe you can share your project and explain what driver you are trying to add that you have problem with?&lt;/p&gt;
&lt;p&gt;In general you can find that there are multiple tests and samples using drivers in zephyr, these show how you can implement a particular peripheral to your project:&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/tests/drivers"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/tests/drivers&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/drivers"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/drivers&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have in mind that if you are calling device_get_binding() in your project then it&amp;#39;s already initializing the spi driver (if used) and you need to use the spi zephyr api or sensor api, so that may be the reason why calling nrfx_spim_init() return EBUSY.&lt;/p&gt;
&lt;p&gt;If you want to use the nrfx_spi driver api directly, then you need to look at the below sample that show how to use nrfx_gpiote directly (similar approach can be done for nrfx_spi), have in mind that in this case you also need to add handling of the interrupt by using IRQ_CONNECT():&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/boards/nrf/nrfx"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/boards/nrf/nrfx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: crashing after adding a driver to dts</title><link>https://devzone.nordicsemi.com/thread/387021?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 08:53:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56163dc2-33f4-4ab1-b3c5-8602c508c6a1</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;ok the fix for the above issue is to set the unconnected MOSI to the value of&amp;nbsp;NRFX_SPIM_PIN_NOT_USED , which is 0xFF&lt;/p&gt;
&lt;p&gt;so it passes the driver init, however,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;when i try to init the spi&amp;nbsp; &amp;#39;nrfx_spim_init(..)&amp;#39;return -EBUSY and if i try to uninit first with &amp;#39;nrfx_spim_uninit(..)&amp;#39; then i get the following crash:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00003039] &amp;lt;err&amp;gt; os: ***** BUS FAULT *****
[00003040] &amp;lt;err&amp;gt; os:   Imprecise data bus error
[00003040] &amp;lt;err&amp;gt; os: r0/a1:  0x00020000  r1/a2:  0x0000000a  r2/a3:  0xe000e100
[00003041] &amp;lt;err&amp;gt; os: r3/a4:  0x0000005b r12/ip:  0x50000000 r14/lr:  0x0002db0f
[00003041] &amp;lt;err&amp;gt; os:  xpsr:  0x01000000
[00003041] &amp;lt;err&amp;gt; os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
[00003042] &amp;lt;err&amp;gt; os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
[00003042] &amp;lt;err&amp;gt; os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
[00003043] &amp;lt;err&amp;gt; os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
[00003043] &amp;lt;err&amp;gt; os: fpscr:  0x00000600
[00003043] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0002db18
[00003043] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00003044] &amp;lt;err&amp;gt; os: Current thread: 0x20004bf0 (unknown)
[00023698] &amp;lt;err&amp;gt; fatal_error: Resetting system
*** Booting Zephyr OS build v2.6.99-ncs1-1  ***&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;any ideas ?&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>