<?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>Printing to an I2C OLED display / error: &amp;#39;__device_dts_ord_DT_CHOSEN_zephyr_display_ORD&amp;#39; undeclared (first use in this function)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98548/printing-to-an-i2c-oled-display-error-__device_dts_ord_dt_chosen_zephyr_display_ord-undeclared-first-use-in-this-function</link><description>Hello, 
 
 I followed the following tutorial and I encounter an error while compiling with ncs v2.2.0. 
 Printing to an I2C OLED display using nRF Connect SDK : devzone.nordicsemi.com/.../small-i2c-oled-displays-using-nrf-connect-sdk 
 
 In file included</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Apr 2023 14:17:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98548/printing-to-an-i2c-oled-display-error-__device_dts_ord_dt_chosen_zephyr_display_ord-undeclared-first-use-in-this-function" /><item><title>RE: Printing to an I2C OLED display / error: '__device_dts_ord_DT_CHOSEN_zephyr_display_ORD' undeclared (first use in this function)</title><link>https://devzone.nordicsemi.com/thread/420292?ContentTypeID=1</link><pubDate>Thu, 13 Apr 2023 14:17:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19bf2cdd-f9e3-4268-bf49-a68bccf42d22</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for adding your build log!&lt;/p&gt;
&lt;p&gt;The warning at line 41 of the log has revealed the issue. In step 4 of the &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/small-i2c-oled-displays-using-nrf-connect-sdk"&gt;guide&lt;/a&gt; (I&amp;#39;m assuming you&amp;#39;re at part 1), you are asked to edit CMakeLists.txt to add a &amp;quot;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/zephyr/hardware/porting/shields.html?highlight=shields#shield-activation"&gt;shield&lt;/a&gt;&amp;quot; to the configuration. This &lt;em&gt;has&lt;/em&gt; to be done before the &amp;quot;&lt;a href="https://cmake.org/cmake/help/latest/command/find_package.html"&gt;&lt;code&gt;find_package&lt;/code&gt;&lt;/a&gt;&amp;quot; CMake command, otherwise it won&amp;#39;t work. Unfortunately I don&amp;#39;t understand CMake well enough to explain why.&lt;/p&gt;
&lt;p&gt;So, as stated in the tutorial, the line&lt;/p&gt;
&lt;p&gt;&lt;code&gt;set(SHIELD ssd1306_128x32)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;should be added right after the line&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;code&gt;&lt;span style="font-family:inherit;"&gt;&lt;span style="font-style:normal;font-weight:normal;"&gt;cmake_minimum_required(VERSION 3.20.0)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;and no later. If I follow that on my machine, this fixes the issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;By the way, the tutorial has an associated GitHub repo that you could use to check if you did things correctly: &lt;a href="https://github.com/hx91/oled-ssd1306-lvgl/tree/main/part-1"&gt;https://github.com/hx91/oled-ssd1306-lvgl/tree/main/part-1&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Raoul&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>