<?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>nRF52840 with MCP2515</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85872/nrf52840-with-mcp2515</link><description>We are currently evaluating using the nRF52840 device in conjunction with an MCP2515 to provide CAN to the microcontroller. I have updated both the device tree overlay and the project file to add in the configuration but I am getting compilation errors</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Mar 2022 09:10:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85872/nrf52840-with-mcp2515" /><item><title>RE: nRF52840 with MCP2515</title><link>https://devzone.nordicsemi.com/thread/358564?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 09:10:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01f9d4a7-d98d-4739-82ed-d6c3c023b3dc</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Lance&lt;/p&gt;
&lt;p&gt;Fair point, if you want to implement it similar to the samples you should be able to do it like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define CAN1_NODE DT_ALIAS(can1)
#if DT_NODE_HAS_STATUS(CAN1_NODE, okay)
#define CAN1	DT_LABEL(CAN1_NODE)
#else
#error &amp;quot;CAN not present!&amp;quot;
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Just note that you need to refer to CAN1 rather than CAN1_NODE later on, when you acquire the device binding etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 with MCP2515</title><link>https://devzone.nordicsemi.com/thread/358493?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 17:05:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b66f633d-5a90-401c-9c9b-3cd3c50ef5ac</guid><dc:creator>lance-f1</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When doing that the&amp;nbsp;&lt;code&gt;#if DT_NODE_HAS_STATUS(CAN1_NODE, okay) in main.c no longer can see CAN1_NODE (i.e. it thinks it is not defined).&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define CAN1_NODE DT_LABEL(DT_ALIAS(can1))
// #define CAN1_NODE DT_ALIAS(can1) // DT_NODELABEL(can1)

#if DT_NODE_HAS_STATUS(CAN1_NODE, okay)
#else
#error &amp;quot;Unsupported board: can0 devicetree alias is not defined&amp;quot;
#endif&lt;/pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 with MCP2515</title><link>https://devzone.nordicsemi.com/thread/358489?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 16:08:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:121757e2-3725-41b3-98a7-205c65680576</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Lance&lt;/p&gt;
&lt;p&gt;What if you also use the DT_LABEL macro, like this?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;#define CAN1_NODE DT_LABEL(DT_ALIAS(can1))&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>