<?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>Failed to add a user-defined device.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111918/failed-to-add-a-user-defined-device</link><description>I tried to add a chip of our own design to NCS, but when I tried to write the device description file, I ran into two problems: 
 1.Even if the chip description file is compiled successfully, the prompt &amp;quot;unknown node type&amp;quot; and &amp;quot;Only spi nodes accepted</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Jun 2024 06:36:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111918/failed-to-add-a-user-defined-device" /><item><title>RE: Failed to add a user-defined device.</title><link>https://devzone.nordicsemi.com/thread/488215?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 06:36:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9999f13c-3efe-42dc-8a79-73997ad8f92a</guid><dc:creator>carefree</dc:creator><description>&lt;p&gt;I have solved it, thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to add a user-defined device.</title><link>https://devzone.nordicsemi.com/thread/488207?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 03:51:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b22ef3c8-7dd6-4fa9-a0e0-3e325a389998</guid><dc:creator>carefree</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/code1.zip"&gt;devzone.nordicsemi.com/.../code1.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to add a user-defined device.</title><link>https://devzone.nordicsemi.com/thread/488205?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 03:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbc82b44-c71a-4b83-8087-cee786347be2</guid><dc:creator>carefree</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I followed the method above the link you sent, and then I modified a number of files myself and successfully compiled the driver into it.&lt;br /&gt;But there are still questions:&lt;br /&gt;1. The device tree still fails to identify the device description file in the dts.&lt;br /&gt;2. Replacing &amp;#39;headstage0&amp;#39; with &amp;#39;headstage&amp;#39; is invalid, the variable will be assigned to 0, but the device_is_ready function will return false.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to add a user-defined device.</title><link>https://devzone.nordicsemi.com/thread/488124?ContentTypeID=1</link><pubDate>Mon, 10 Jun 2024 12:12:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5e5241d-d09b-40a8-90aa-0ff8777e3f0b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Please see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/107193/why-doesn-t-the-build-include-driver-files/464345"&gt;Håkon&amp;#39;s reply in this ticket&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested it on your sample by doing steps 1 and 2, copied here for convenience:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. in CMakeLists.txt, add this&amp;nbsp;&lt;/span&gt;&lt;strong&gt;before&lt;/strong&gt;&lt;span&gt;&amp;nbsp;find_package(...):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;list(APPEND ZEPHYR_EXTRA_MODULES
  ${CMAKE_CURRENT_SOURCE_DIR}/drivers
)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. create file driver/zephyr/module.yml, containing:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;build:
  cmake: .
  kconfig: Kconfig&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Then make sure to &lt;b&gt;delete &lt;/b&gt;your old&lt;b&gt;&amp;nbsp;&lt;/b&gt;build folder, and generate a new build configuration (just like you did before).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One final thing is that in main.c, line 15, use this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bmstim2216 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(headstage));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(remove the &amp;#39;0&amp;#39; in &amp;quot;headstage0&amp;quot;).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then it built fine on my computer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to add a user-defined device.</title><link>https://devzone.nordicsemi.com/thread/487890?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2024 11:53:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd2451e4-462c-46a3-bf36-7713ccb13ad5</guid><dc:creator>carefree</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2642.code.zip"&gt;devzone.nordicsemi.com/.../2642.code.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>