<?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>undefined reference to device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111896/undefined-reference-to-device</link><description>Hello everyone, 
 for my project I had to develop a new driver for the Kinetic 2026 LED driver. 
 I have attached the driver to my project like this in the Device Tree like this: 
 
 I then tried to use the driver like this in the application: 
 
 For</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 14 Dec 2024 19:04:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111896/undefined-reference-to-device" /><item><title>RE: undefined reference to device</title><link>https://devzone.nordicsemi.com/thread/514992?ContentTypeID=1</link><pubDate>Sat, 14 Dec 2024 19:04:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcb8773c-6800-47ec-973d-9c1c621fdde5</guid><dc:creator>danny0007</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/bjoern-bialy"&gt;Bjoern Bialy&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;glad to read this thread, I encounter the similar issue.&lt;/p&gt;
&lt;p&gt;could you please share more info in detail how you solve this?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Danny&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: undefined reference to device</title><link>https://devzone.nordicsemi.com/thread/488337?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 12:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5d4ddf3-9d77-439f-8199-83fb27935cde</guid><dc:creator>Bjoern Bialy</dc:creator><description>&lt;p&gt;I found the error, sadly it was just a user error - I forgot to add one of the files to the CMake files. There were also some other C/C++ compatibility problems, but it works now. Thanks for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: undefined reference to device</title><link>https://devzone.nordicsemi.com/thread/488328?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 12:40:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9245f3a-015d-4ea5-a1b7-f2c1215d4e55</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Rico,&lt;/p&gt;
&lt;p&gt;You are correct, this is not a problem. I also found a device is normally defined as following, could this be the cause?&lt;/p&gt;
&lt;div&gt;&lt;span&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; device &lt;/span&gt;&lt;span&gt;&lt;span&gt;*dev=&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;DEVICE_DT_GET&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;DT_ALIAS&lt;/span&gt;&lt;span&gt;(sensor));&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I found&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/samples/drivers/led_lp5562/README.html"&gt;LP5562 RGB LED — Zephyr Project Documentation&lt;/a&gt;&amp;nbsp;is pretty similar with what ktd2026, you can just reuse the sample to test your device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: undefined reference to device</title><link>https://devzone.nordicsemi.com/thread/487899?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2024 12:23:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c71cbda6-093f-44c7-9833-fb56165f7892</guid><dc:creator>Bjoern Bialy</dc:creator><description>&lt;p&gt;I don&amp;#39;t think so, as the the dash is not used in code and gets converted to an underscore. If I change it like that, the error changes to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;C:/Users/.../ncs/zephyr/include/zephyr/device.h:84:41: error: &amp;#39;__device_dts_ord_DT_N_ALIAS_led&amp;#39; was not declared in this scope&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: undefined reference to device</title><link>https://devzone.nordicsemi.com/thread/487878?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2024 11:03:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8df7495-64e0-4310-a020-073c494f2d68</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Rico,&lt;/p&gt;
&lt;p&gt;Just have a quick check, I think DT_ALIAS(led_ktd2026) should be&amp;nbsp;&lt;span&gt;DT_ALIAS(led-ktd2026).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>