<?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>nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88502/nrf9160-mcp2515-spi-bus-not-ready</link><description>I am trying to use the MCP2515 SPI2CAN adapter with the nRF9160 DK. 
 I started by trying to get the Zephyr socket_can sample to work. My efforts are based on this thread. 
 The problem is, that I am always getting an &amp;quot;SPI bus not ready&amp;quot; error from the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Mar 2023 12:10:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88502/nrf9160-mcp2515-spi-bus-not-ready" /><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/415171?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 12:10:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4e2a409-ee94-45c6-a87f-98cb7dfeb48a</guid><dc:creator>Midhunjac</dc:creator><description>&lt;p&gt;Thanks for replying. I hope they will attend this thread once again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/415167?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 12:07:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3215272-e411-4cb9-bb5d-fbee556ffb1b</guid><dc:creator>yavordobrev</dc:creator><description>&lt;p&gt;I gave up on trying to get it to work and used a small microcontroller for interfacing SPI to CAN instead. I&amp;nbsp;have not contacted Zephyr support as was suggested.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/415161?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 11:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c156d875-a9b7-46bf-b3f3-2a2055a9e3a8</guid><dc:creator>Midhunjac</dc:creator><description>&lt;p&gt;Is this issue solved ? I have the same problem now with nrf52840. I am using a custom board with mcp2518FD. I have modified the dts and added bindings and the build is successful. If I do not have can bus definition in dts, I have no problem in initializing the SPI bus. (have not checked the communication though). As soon as I bring in the CAN transciever, SPI bus will not be initialized. Any ideas of what might be going wrong ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/371586?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 08:37:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6de6bd6c-b60c-4c85-af63-88aa778dcd8a</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Yavor, &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I’m honestly running out of ideas here. At this stage, I would recommend you get in touch with the Zephyr support. They have an own &lt;a href="https://discord.com/channels/720317445772017664/875420258851246090"&gt;#can-bus&lt;/a&gt; channel on &lt;a href="https://discord.com/"&gt;Discord&lt;/a&gt;.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I suggest we leave this ticket open for possible follow-up questions, but I expect that Zephyr can provide you with more detailed input as they are owning the functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/371280?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2022 07:21:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e574a4bb-c0bf-459b-be21-892c183ba7af</guid><dc:creator>yavordobrev</dc:creator><description>&lt;p&gt;The hard fault occurs with the non-secure target.&lt;/p&gt;
&lt;p&gt;With the secure target I get the stack overflow, which was described earlier.&lt;/p&gt;
&lt;p&gt;I tried physically attaching a CAN bus, but it makes no difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/371277?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2022 07:10:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c93ffa92-a889-4a0c-a997-c5a84dbc674d</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Yavor,&lt;/span&gt;&lt;span&gt; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="yavordobrev"]Do you have any suggestions what I could try?[/quote]
&lt;p&gt;&lt;span&gt;Are you currently using the secure or none-secure target?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/371123?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2022 11:54:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48d622e1-0e7f-4683-826a-e0cf945138b4</guid><dc:creator>yavordobrev</dc:creator><description>&lt;p&gt;Hi Markus,&lt;/p&gt;
&lt;p&gt;I tested a little more but I couldn&amp;#39;t find the reason for the hard fault.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Stepping through the program leads me to line 124 in mutex.c, where the hard fault occurs.&lt;/p&gt;
&lt;p&gt;Do you have any suggestions what I could try?&lt;/p&gt;
&lt;p&gt;Regards&lt;br /&gt;Yavor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370850?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 11:09:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d5d149e-d840-4aab-b8ec-ecfecb1a20ea</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>[quote user="yavordobrev"]&lt;p&gt;I managed to get a little further. First of all I&amp;nbsp;resolved the &amp;quot;SPI bus not ready&amp;quot;-error in the ns-build by adding&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SPI_INIT_PRIORITY&lt;/span&gt;&lt;span&gt;=20&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;&lt;span&gt;Thanks for the feedback, Yavor!&lt;/span&gt;&lt;span&gt; I tested the other way round, lowering CONFIG_CAN_INIT_PRIORITY to 80, but ended up in a hard fault as well.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="yavordobrev"]Why this is different in the secure build I can&amp;#39;t say.[/quote]
&lt;p&gt;&lt;span&gt;I’m not expecting this to happen neither, since the none-secure part actually should be initialised first.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370820?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 08:32:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b68e9f3c-8f75-42d5-aaf8-1efde1c7d391</guid><dc:creator>yavordobrev</dc:creator><description>&lt;p&gt;Hi Markus,&lt;/p&gt;
&lt;p&gt;I managed to get a little further. First of all I&amp;nbsp;resolved the &amp;quot;SPI bus not ready&amp;quot;-error in the ns-build by adding&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SPI_INIT_PRIORITY&lt;/span&gt;&lt;span&gt;=20&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;to the prj.conf. This way the SPI is initialized before the MCP2515. Why this is different in the secure build I can&amp;#39;t say.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Then I had to apply the patches from&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82695/sample-net_sockets_can-does-not-start-correctly"&gt;this thread&lt;/a&gt;, but all I get in the end is a Hard Fault.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I will continue testing on Tuesday...&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370795?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 06:39:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cadd001-a46d-45d6-895a-4aedc7a99655</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;The faulting instruction address is 0xaaaaaaaa, which is outside of memory. I’m not sure if this is due to missing CAN bus, or that non-secure domain actually is required to run network socket operations on the nRF9160.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you physically connect a CAN bus, would that make any difference?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370727?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 13:45:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7b613cb-e8ba-4fb0-ad6f-a17924b5ee04</guid><dc:creator>yavordobrev</dc:creator><description>&lt;p&gt;I can confirm that building as a secure target does not cause the &amp;quot;SPI not ready&amp;quot; problem.&lt;/p&gt;
&lt;p&gt;However I end up getting a stack overflow. It happens in the recvfrom function (line 208 in main.c).&lt;/p&gt;
&lt;p&gt;There is no real CAN bus currently attached, only the MCP2515.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/ksnip_5F00_20220602_2D00_153718.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370691?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 12:24:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acc38acd-d4b5-4268-b58b-668b63f5bfed</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>[quote user="yavordobrev"]Could it be that the mcp2515 driver is trying to use spi before it is actually initialized?&amp;nbsp;[/quote]
&lt;p&gt;&lt;span&gt;Yes, that appears to be the case. If I run the sample as a secure target (nrf9160dk_nrf9160), the output looks a little bit different.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.7.99-ncs1-1  *** 

[00:00:02.288,177] &amp;lt;dbg&amp;gt; net_sock_can.can_register_filters: (main): Registering 1 filters 
[00:00:02.298,980] &amp;lt;dbg&amp;gt; net_sock_can.can_register_receiver: (main): Max 1 receivers 
[00:00:02.309,448] &amp;lt;dbg&amp;gt; net_socket_can_sample.setup_socket: Started socket CAN TX thread 
[00:00:02.320,220] &amp;lt;inf&amp;gt; net_socket_can_sample: 1st RX fd 0 
[00:00:02.328,430] &amp;lt;dbg&amp;gt; net_socket_can_sample.rx: [0] Waiting CAN data... 
[00:00:03.309,509] &amp;lt;dbg&amp;gt; net_socket_can_sample.tx: Sending CAN data... 
[00:00:06.420,379] &amp;lt;dbg&amp;gt; mcp2515_can.socket_can_send: Cannot send socket CAN msg (-11) &lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you test this as well and confirm that it works?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In that case: I assume this is a timing issue with the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/libraries/others/spm.html#secure-partition-manager-spm"&gt;Secure Partition Manager&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370632?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 09:35:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62f2a89e-d608-4b2e-8475-d1f70a773d39</guid><dc:creator>yavordobrev</dc:creator><description>&lt;p&gt;I just tried what you proposed and the board just hangs in the&amp;nbsp;spi_nrfx_transceive function. The logic analyzer shows there is also no activity on the pins.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could it be that the mcp2515 driver is trying to use spi before it is actually initialized?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370626?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 09:12:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8d433a3-4fcc-4ef5-ba01-a60817895cf9</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>[quote user="yavordobrev"]&lt;p&gt;I am using NCS v1.9.1. The build errors have been resolved in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/81754/nrf9160dk_nrf9160-v0-9-0-v1-7-1-mcp2515-canbus-build-problems"&gt;this thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is suggested to edit zephyr/drivers/can/can_mcp2515.c, line 970, and replace the 1 with a 0.&lt;/p&gt;[/quote]
&lt;p&gt;&lt;span&gt;Ok, thanks Yavor! That being said, I should have read through the whole thread first ;-)&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The sample is failing at this &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/zephyr-v3.0.0/drivers/can/can_mcp2515.c#L852"&gt;point&lt;/a&gt;.&lt;/span&gt;&lt;span&gt; When I debug into the function, the line below gives me the reason why it is failing.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span style="font-size:11pt;line-height:19.425px;" lang="SV-SE"&gt;&lt;/span&gt;&lt;span style="height:117px;width:486px;"&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/480x240/__key/communityserver-discussions-components-files/4/8132.pastedimage1654161093011v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I’m not sure why &amp;#39;initialised&amp;#39; would be false here, as the devicetree should be configured correctly. But I do not have a MCP2515 available which I can connect to my DK, so possibly this might be required. &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Otherwise, just for fault tracing, if you toggle the following lines:&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// if (!spi_is_ready(&amp;amp;dev_cfg-&amp;gt;bus)) { 
// LOG_ERR(&amp;quot;SPI bus %s not ready&amp;quot;, dev_cfg-&amp;gt;bus.bus-&amp;gt;name); 
// return -ENODEV; 
// } &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Does that make communication work, or do you end up in another fault?&lt;/span&gt;&lt;span&gt; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370610?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 08:18:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54446c54-6a4a-44dc-a3a3-48fbd8a9e651</guid><dc:creator>yavordobrev</dc:creator><description>&lt;p&gt;Hello Markus,&lt;/p&gt;
&lt;p&gt;I am using NCS v1.9.1. The build errors have been resolved in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/81754/nrf9160dk_nrf9160-v0-9-0-v1-7-1-mcp2515-canbus-build-problems"&gt;this thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is suggested to edit zephyr/drivers/can/can_mcp2515.c, line 970, and replace the 1 with a 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: MCP2515 SPI bus not ready</title><link>https://devzone.nordicsemi.com/thread/370602?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 07:57:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c468bf9-04f5-4a00-9240-94e080010650</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Yavor,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;which NCS version are you currently operating with? I’m asking because the&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/samples/net/sockets/can/README.html#socket-can"&gt; Socket CAN&lt;/a&gt; sample with your overlay file won&amp;#39;t even build for me in NCS v1.9.1.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;In file included from /home/user/ncs/zephyr/include/toolchain/gcc.h:72,
                 from /home/user/ncs/zephyr/include/toolchain.h:50,
                 from /home/user/ncs/zephyr/include/kernel_includes.h:19,
                 from /home/user/ncs/zephyr/include/kernel.h:17,
                 from /home/user/ncs/zephyr/drivers/can/can_mcp2515.c:9:
/home/user/ncs/zephyr/drivers/can/can_mcp2515.c: In function &amp;#39;socket_can_init&amp;#39;:
/home/user/ncs/zephyr/include/device.h:96:39: error: &amp;#39;__device_dts_ord_DT_N_INST_1_microchip_mcp2515_ORD&amp;#39; undeclared (first use in this function)
   96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
      |                                       ^~~~~~~~~
/home/user/ncs/zephyr/include/toolchain/common.h:132:26: note: in definition of macro &amp;#39;_DO_CONCAT&amp;#39;
  132 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/home/user/ncs/zephyr/include/device.h:96:31: note: in expansion of macro &amp;#39;_CONCAT&amp;#39;
   96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
      |                               ^~~~~~~
/home/user/ncs/zephyr/include/device.h:291:37: note: in expansion of macro &amp;#39;DEVICE_NAME_GET&amp;#39;
  291 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_NAME(node_id))
      |                                     ^~~~~~~~~~~~~~~
/home/user/ncs/zephyr/include/device.h:311:34: note: in expansion of macro &amp;#39;DEVICE_DT_NAME_GET&amp;#39;
  311 | #define DEVICE_DT_GET(node_id) (&amp;amp;DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
/home/user/ncs/zephyr/include/device.h:323:34: note: in expansion of macro &amp;#39;DEVICE_DT_GET&amp;#39;
  323 | #define DEVICE_DT_INST_GET(inst) DEVICE_DT_GET(DT_DRV_INST(inst))
      |                                  ^~~~~~~~~~~~~
/home/user/ncs/zephyr/drivers/can/can_mcp2515.c:945:33: note: in expansion of macro &amp;#39;DEVICE_DT_INST_GET&amp;#39;
  945 |  const struct device *can_dev = DEVICE_DT_INST_GET(1);
      |                                 ^~~~~~~~~~~~~~~~~~
/home/user/ncs/zephyr/include/device.h:96:39: note: each undeclared identifier is reported only once for each function it appears in
   96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
      |                                       ^~~~~~~~~
/home/user/ncs/zephyr/include/toolchain/common.h:132:26: note: in definition of macro &amp;#39;_DO_CONCAT&amp;#39;
  132 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/home/user/ncs/zephyr/include/device.h:96:31: note: in expansion of macro &amp;#39;_CONCAT&amp;#39;
   96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
      |                               ^~~~~~~
/home/user/ncs/zephyr/include/device.h:291:37: note: in expansion of macro &amp;#39;DEVICE_NAME_GET&amp;#39;
  291 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_NAME(node_id))
      |                                     ^~~~~~~~~~~~~~~
/home/user/ncs/zephyr/include/device.h:311:34: note: in expansion of macro &amp;#39;DEVICE_DT_NAME_GET&amp;#39;
  311 | #define DEVICE_DT_GET(node_id) (&amp;amp;DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
/home/user/ncs/zephyr/include/device.h:323:34: note: in expansion of macro &amp;#39;DEVICE_DT_GET&amp;#39;
  323 | #define DEVICE_DT_INST_GET(inst) DEVICE_DT_GET(DT_DRV_INST(inst))
      |                                  ^~~~~~~~~~~~~
/home/user/ncs/zephyr/drivers/can/can_mcp2515.c:945:33: note: in expansion of macro &amp;#39;DEVICE_DT_INST_GET&amp;#39;
  945 |  const struct device *can_dev = DEVICE_DT_INST_GET(1);
      |                                 ^~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/user/work/VSCode/can_app/build
The terminal process terminated with exit code: &lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I’m not sure why the compiler throws this error, because the overlay file you are using appears to be correct to me.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>