<?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>Adding another I2C node causes undefined reference to `__device_dts_ord_XXX&amp;#39;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103909/adding-another-i2c-node-causes-undefined-reference-to-__device_dts_ord_xxx</link><description>Hello! 
 I am trying to merge two simple Zephyr applications that both use I2C. I have an application that uses the SBC_OLED01 display. I followed these instructions . The second application uses the LISH3DH accelerometer with the nordic example LIS2DH</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Oct 2023 12:24:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103909/adding-another-i2c-node-causes-undefined-reference-to-__device_dts_ord_xxx" /><item><title>RE: Adding another I2C node causes undefined reference to `__device_dts_ord_XXX'</title><link>https://devzone.nordicsemi.com/thread/449817?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 12:24:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5a9c772-d93b-449f-84ce-16a6dfd138ef</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;And thank you for your patience.&lt;/p&gt;
&lt;p&gt;Now I have gone through your project and the link which you have posted.&lt;/p&gt;
&lt;p&gt;So basically, the screen (device) from solomon supports both the i2c and the spi interface.&lt;/p&gt;
&lt;p&gt;But previously we were configuring it wrong in the overlay.&lt;/p&gt;
&lt;p&gt;Now you have removed that part from the overlay, and I see that you were using &amp;quot;SHIELD=ssd...&amp;quot; parameter in building, and thats solomon device gets correctly configured in the DTS.&lt;/p&gt;
&lt;p&gt;When I modify the overlay based on the ssd-shield overlay, and I add config for this device (and its dependency) [CONFIG_SSD1306 and CONFIG_DISPLAY], then it is working good.&lt;/p&gt;
&lt;p&gt;So I think previously our overlay was not good, and also we need to enable driver for this device in the config.&lt;/p&gt;
&lt;p&gt;Below is the output snapshot like the previous one:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697026743949v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;And the project is attached just for reference:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/tocustomer.rar"&gt;devzone.nordicsemi.com/.../tocustomer.rar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And whatever you have said about the prj.conf is probably not true. Kconfig is to define config options, ranges, dependencies, selections and default values, while the prj.conf is to use specific values for those configs for the application.&lt;/p&gt;
&lt;p&gt;You can read more on the zephyr about how build system works, and also the information in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/79660/kconfig-and-prj-conf-question"&gt;this ticket &lt;/a&gt;might be helpful for that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR, Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding another I2C node causes undefined reference to `__device_dts_ord_XXX'</title><link>https://devzone.nordicsemi.com/thread/447908?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2023 10:30:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ddcf15a-96f9-40e2-a1fb-054e071d9775</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
[quote user="J0sh1101"]I&amp;#39;ve identified a solution to my issue[/quote]
&lt;p&gt;Great to know that you have made progress and have found a solution to your issue.&lt;/p&gt;
[quote user="J0sh1101"]Maybe, you can help me to understand why is this now working?[/quote]
&lt;p&gt;As I am working on another task, I will look at it next week and will respond to you accordingly.&lt;/p&gt;
&lt;p&gt;Appreciate your patience.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding another I2C node causes undefined reference to `__device_dts_ord_XXX'</title><link>https://devzone.nordicsemi.com/thread/447074?ContentTypeID=1</link><pubDate>Thu, 21 Sep 2023 12:31:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b6414cd-7a2e-473c-8a5e-74a2360feb89</guid><dc:creator>J0sh1101</dc:creator><description>&lt;p&gt;Hi;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I believe I&amp;#39;ve identified a solution to my issue, yet I&amp;#39;m puzzled by the underlying reason.&lt;/span&gt;&lt;/p&gt;
[quote userid="119245" url="~/f/nordic-q-a/103909/adding-another-i2c-node-causes-undefined-reference-to-__device_dts_ord_xxx/446927"]&lt;p&gt;However, this will not work for the SOLOMON device.&lt;/p&gt;
&lt;p&gt;The reason is that the solomon,ssd1306fb is a spi device with spi.yaml bindings&lt;/p&gt;[/quote]
&lt;p&gt;Strange!!! I got it working on my nrf52840 board with the SOLOMON device.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="119245" url="~/f/nordic-q-a/103909/adding-another-i2c-node-causes-undefined-reference-to-__device_dts_ord_xxx/446927"]&lt;p&gt;Project is attached for reference. Regards, Naeem&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/case314823.zip"&gt;case314823.zip&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Cool!!! I took your project and made it work for both thessd1306 and lis2dh12. Below is the console output and the project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1695299569467v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Project:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/case314823_5F00_2.zip"&gt;devzone.nordicsemi.com/.../case314823_5F00_2.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Maybe, you can help me to understand why is this now working? I am also quite new to the Zephyr ecosystem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As for my problem in my project, I found the &amp;quot;solution&amp;quot; after seeing and reading this &lt;a style="font-family:inherit;" href="https://github.com/zephyrproject-rtos/zephyr/issues/41677"&gt;Github post&lt;/a&gt;&lt;span style="font-family:inherit;"&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;When I set I2C to y in my driver kconfig, my project was surprisingly compiled and passed, and there will be no previous problems.&lt;/span&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;So I did the same and the project compiled confusingly. I had a Kconfig that I updated as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;menu &amp;quot;NRF DM&amp;quot;

config I2C
        default y

config SENSOR
        default y

config LIS2DH
        default y

config PRINT_OUT_RESULT
	bool &amp;quot;enable or disable printing the result out&amp;quot;
	default n

endmenu
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I believe when you add a Kconfig file to the project, it does not listen to the proj.conf file.In your project where you did not have a Kconfig file, it worked because it was not blocked by Kconfig file.&lt;/p&gt;
&lt;p&gt;The world of Zepyhr is quite strange.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks again for your help!!!&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding another I2C node causes undefined reference to `__device_dts_ord_XXX'</title><link>https://devzone.nordicsemi.com/thread/446927?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2023 15:09:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:913707f4-5ee0-4329-b94a-8d188741594e</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
&lt;p&gt;Thank you for your patience.&lt;/p&gt;
&lt;p&gt;Based on the information you have provided, I have included following project configs:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_LIS2DH=y

CONFIG_LIS2DH_TRIGGER_GLOBAL_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And I am using this overlay where I have one ssd1306 on i2c0 and the lis2dh12 on the i2c1&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;

&amp;amp;i2c0{
        compatible = &amp;quot;nordic,nrf-twim&amp;quot;;
        #address-cells = &amp;lt; 0x1 &amp;gt;;
        #size-cells = &amp;lt; 0x0 &amp;gt;;
        reg = &amp;lt; 0x40003000 0x1000 &amp;gt;;
        clock-frequency = &amp;lt; 0x61a80 &amp;gt;;
        interrupts = &amp;lt; 0x3 0x1 &amp;gt;;
        status = &amp;quot;okay&amp;quot;;
        pinctrl-0 = &amp;lt; &amp;amp;i2c0_default &amp;gt;;
        pinctrl-1 = &amp;lt; &amp;amp;i2c0_sleep &amp;gt;;
        pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
        zephyr,concat-buf-size = &amp;lt; 0x1000 &amp;gt;;
        ssd1306_ssd1306_128x32: ssd1306@3c {
                compatible = &amp;quot;solomon,ssd1306fb&amp;quot;;
                status = &amp;quot;okay&amp;quot;;
		reg = &amp;lt; 0x3c &amp;gt;;
		width = &amp;lt; 0x80 &amp;gt;;
		height = &amp;lt; 0x20 &amp;gt;;
		segment-offset = &amp;lt; 0x0 &amp;gt;;
		page-offset = &amp;lt; 0x0 &amp;gt;;
		display-offset = &amp;lt; 0x0 &amp;gt;;
		multiplex-ratio = &amp;lt; 0x1f &amp;gt;;
		segment-remap;
		com-invdir;
		com-sequential;
		prechargep = &amp;lt; 0x22 &amp;gt;;
	};
};


&amp;amp;i2c1{
        compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
        status = &amp;quot;okay&amp;quot;;
        pinctrl-0 = &amp;lt; &amp;amp;i2c1_default &amp;gt;;
        pinctrl-1 = &amp;lt; &amp;amp;i2c1_sleep &amp;gt;;
        pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
        lis2dh12: lis2dh12@18 {
                compatible = &amp;quot;st,lis2dh12&amp;quot;, &amp;quot;st,lis2dh&amp;quot;;
                reg = &amp;lt; 0x18 &amp;gt;;
                irq-gpios = &amp;lt; &amp;amp;gpio0 0x1c 0x0 &amp;gt;, &amp;lt; &amp;amp;gpio0 0x1e 0x0 &amp;gt;;
                disconnect-sdo-sa0-pull-up;
        };
};


&amp;amp;spi0 {
        status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;spi1 {
        status = &amp;quot;disabled&amp;quot;;
};

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the main, I can access both I2C controllers like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;const struct device *devi2c0 = DEVICE_DT_GET(DT_NODELABEL(i2c0));
const struct device *devi2c1 = DEVICE_DT_GET(DT_NODELABEL(i2c1));

printk(&amp;quot;devi2c0 = is %p, name is %s\n&amp;quot;, devi2c0, devi2c0-&amp;gt;name);
printk(&amp;quot;devi2c1 = is %p, name is %s\n&amp;quot;, devi2c1, devi2c1-&amp;gt;name);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can also access the LIS2DH12 sensor by using DEVICE_DT_GET_ONE() macro&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;const struct device *devlis = DEVICE_DT_GET_ONE(st_lis2dh12);
printk(&amp;quot;devLIS = is %p, name is %s\n&amp;quot;, devlis, devlis-&amp;gt;name);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, this will not work for the SOLOMON device.&lt;/p&gt;
&lt;p&gt;The reason is that the solomon,ssd1306fb is a spi device with spi.yaml bindings&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1695222400230v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Project is attached for reference. Regards, Naeem&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/case314823.zip"&gt;devzone.nordicsemi.com/.../case314823.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding another I2C node causes undefined reference to `__device_dts_ord_XXX'</title><link>https://devzone.nordicsemi.com/thread/446729?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2023 18:19:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:056045f9-2bf6-4455-b88a-71dcd9b433e1</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Thank you for contacting DevZone at NordicSemi. I have been assigned this ticket, however I did not get a chance to look at it today. I will look into this tomorrow.&lt;/p&gt;
&lt;p&gt;BR, Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding another I2C node causes undefined reference to `__device_dts_ord_XXX'</title><link>https://devzone.nordicsemi.com/thread/446680?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2023 13:29:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e37e0e4-2274-4ba8-8688-0c7c7933b54f</guid><dc:creator>J0sh1101</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;I get the following error message:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1695129147966v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;The ordinal number 132 in the device_generated.h corresponds to lisdh12:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1695129247157v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;This means that the Python script does not generate the part of the code corresponding to lisdh12. A look at the prj.conf file shows that the LISDH sensor is set as follows:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pastedimage1695129701515v9.png" /&gt;&lt;/p&gt;
&lt;p&gt;However, looking into the autoconf.h file, the macro is not generated:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1695129936424v10.png" /&gt;&lt;/p&gt;
&lt;p&gt;I do not know why is this the case, because I did set the flags in the prj.conf files. In the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.99-dev1/kconfig/CONFIG_LIS2DH.html"&gt;documentation &lt;/a&gt;it says&amp;nbsp; it only needs/depends on (&lt;span style="font-family:monospace;"&gt;I2C&lt;/span&gt;&amp;nbsp;|| &lt;span style="font-family:monospace;"&gt;SPI&lt;/span&gt;) &amp;amp;&amp;amp; &lt;span style="font-family:monospace;"&gt;SENSOR.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What am I missing here?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>