<?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>NCS 1.9.99:  How to set sda and scl pins for I2C</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87790/ncs-1-9-99-how-to-set-sda-and-scl-pins-for-i2c</link><description>With an earlier version of NCS I could set the sda and scl pins using an overlay file: 
 boards/nrf52840dk_nrf52840.overlay: 
 
 
 With NCS 1.9.99 I get this error: 
 
 
 How do I change the sda and scl pin assignments using NCS 1.9.99? Thanks, 
 Jan</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 May 2022 20:58:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87790/ncs-1-9-99-how-to-set-sda-and-scl-pins-for-i2c" /><item><title>RE: NCS 1.9.99:  How to set sda and scl pins for I2C</title><link>https://devzone.nordicsemi.com/thread/367715?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 20:58:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65b4fd63-da26-4e1a-b2d9-bf08a844d275</guid><dc:creator>Jan_Erik</dc:creator><description>&lt;p&gt;Thanks,&amp;nbsp; &amp;Oslash;ivind.&amp;nbsp; I followed your suggestion of putting the pinctrl-* fields outside of the sht3xd block.&amp;nbsp; I also needed to specify the pin numbers using the new convention instead of the old. In the old system port 1, pin 13&amp;nbsp; was pin 45 and port 1, pin 15 was pin 47 (pin was specified as pin number plus 0 for port 0 or plus 32 for port 1). Under pinctrl, the port and pin are separated so port 1, pin 13 should be specified as &amp;lt;NRF_PSEL(TWIM_SDA, 1, 13)&amp;gt;&amp;nbsp; not &amp;nbsp;&amp;lt;NRF_PSEL(TWIM_SDA, 0, 45)&amp;gt;.&amp;nbsp; You know all this, I&amp;#39;m just elaborating for someone else who might stumble upon this thread.&lt;/p&gt;
&lt;p&gt;The v1.9.99 SHT3XD sample now builds and runs correctly for me on the nrf52840dk with my target pins.&lt;/p&gt;
&lt;p&gt;I added nrf52840dk_nrf52840.overlay to the boards directory:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
   i2c0_default_alt: i2c0_default_alt {
      group1 {
         psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 13)&amp;gt;,
                 &amp;lt;NRF_PSEL(TWIM_SCL, 1, 15)&amp;gt;;
      };
   };
   i2c0_sleep_alt: i2c0_sleep_alt {
      group1 {
         psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 13)&amp;gt;,
                 &amp;lt;NRF_PSEL(TWIM_SCL, 1, 15)&amp;gt;;
         low-power-enable;
      };
   };
};

&amp;amp;i2c0 {
    pinctrl-0 = &amp;lt;&amp;amp;i2c0_default_alt&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;i2c0_sleep_alt&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	sht3xd: sht3xd@45 {
        status = &amp;quot;okay&amp;quot;;
		compatible = &amp;quot;sensirion,sht3xd&amp;quot;;
		reg = &amp;lt;0x45&amp;gt;;
		label = &amp;quot;SHT3XD&amp;quot;;
		alert-gpios = &amp;lt;&amp;amp;gpio1 10 GPIO_ACTIVE_HIGH&amp;gt;;
	};
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also made two changes to the main.c file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;14d13
&amp;lt; #define SHT3XD DT_NODELABEL(sht3xd)
29c28
&amp;lt; 	const struct device *dev = DEVICE_DT_GET(SHT3XD);
---
&amp;gt; 	const struct device *dev = device_get_binding(&amp;quot;SHT3XD&amp;quot;);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 1.9.99:  How to set sda and scl pins for I2C</title><link>https://devzone.nordicsemi.com/thread/367594?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 11:56:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edea1afd-2cbe-4abe-b181-bd9eb7f7e9c1</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Try putting the pinctrl-* fields outside of the sht3xd block. If that doesn&amp;#39;t work, there should be a file at build/zephyr/include/generated called devicetree_unfixed.dts. Attach that here with Insert-&amp;gt;Image/video/file and I&amp;#39;ll take a look.&lt;/p&gt;
&lt;p&gt;Ok, so that&amp;#39;s why you are looking into 1.9.99, makes sense. Make a ticket specifically for the openthread issues if you are unable to solve them, and we will do our best to assist you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 1.9.99:  How to set sda and scl pins for I2C</title><link>https://devzone.nordicsemi.com/thread/367501?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 02:03:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b34b4f34-0e99-47f5-8eee-827eee7b93c0</guid><dc:creator>Jan_Erik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m developing an environmental control system using openthread and zephyr COAP. The system works but intermittently the openthread connection detaches, then becomes leader, but won&amp;#39;t rejoin the existing network. This will be challenging to debug as I haven&amp;#39;t found a way to trigger the problem. As a first step in trouble shooting I wanted to use more recent versions of the libraries to see if the problem persists. I chose 1.9.99 since it will have the most recent versions of zephyr, openthread, and COAP.&lt;/p&gt;
&lt;p&gt;As you point out, the way pins are set was changed to pinctrl. I was able to get the sht3xd example to compile with this overlay below but it doesn&amp;#39;t connect with the device.&amp;nbsp; I&amp;#39;ll see if my original problem is solved with v1.9.1&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
   i2c0_default_alt: i2c0_default_alt {
      group1 {
         psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 45)&amp;gt;,
                 &amp;lt;NRF_PSEL(TWIM_SCL, 0, 47)&amp;gt;;
      };
   };
   i2c0_sleep_alt: i2c0_sleep_alt {
      group1 {
         psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 45)&amp;gt;,
                 &amp;lt;NRF_PSEL(TWIM_SCL, 0, 47)&amp;gt;;
         low-power-enable;
      };
   };
};

&amp;amp;i2c0 {
	sht3xd@45 {
        status = &amp;quot;okay&amp;quot;;
		compatible = &amp;quot;sensirion,sht3xd&amp;quot;;
        pinctrl-0 = &amp;lt;&amp;amp;i2c0_default_alt&amp;gt;;
        pinctrl-1 = &amp;lt;&amp;amp;i2c0_sleep_alt&amp;gt;;
        pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
		reg = &amp;lt;0x45&amp;gt;;
		label = &amp;quot;SHT3XD&amp;quot;;
		alert-gpios = &amp;lt;&amp;amp;gpio1 10 GPIO_ACTIVE_HIGH&amp;gt;;
	};
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 1.9.99:  How to set sda and scl pins for I2C</title><link>https://devzone.nordicsemi.com/thread/367467?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 15:30:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88d9c103-4028-4b06-add0-269ab3af0b86</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The way pins are set has been changed for future releases, and this change is present on the devtag 1.9.99.&lt;/p&gt;
&lt;p&gt;Is there a reason that you are using 1.9.99, and not 1.9.1?&lt;br /&gt;On 1.9.1 you would not see these errors.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 1.9.99:  How to set sda and scl pins for I2C</title><link>https://devzone.nordicsemi.com/thread/367297?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 06:35:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ae9357b-3b20-4082-9c0a-be05dadb3830</guid><dc:creator>yoyou</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;please try:&lt;/p&gt;
&lt;p&gt;check the entire overlay file for blue line conflicts&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1652250430458v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;remove build, and add new&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1652250798273v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>