<?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>SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101907/sht31-readout-on-nrf5340-using-the-zephyr-sample</link><description>Hi everyone, 
 I am trying to get the Zephyr SHT31 sample running on a nRF7002-DK (nrf5340), but I only get &amp;quot;Device SHT3XD is not ready&amp;quot;. 
 I ran a debug session, and it is failing due to zephyr/kernel/device.c::z_device_is_ready funcition returning false</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Apr 2024 13:58:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101907/sht31-readout-on-nrf5340-using-the-zephyr-sample" /><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/479261?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2024 13:58:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15296161-8740-4426-8147-597e3715486b</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Verified Answer is equivalent to Closed, so that is good.&lt;br /&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/479237?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2024 13:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a53516c-39bd-4fb0-ba0a-c72febae8a26</guid><dc:creator>makoto.inoue</dc:creator><description>&lt;p&gt;Dear Nordic team, I think this ticket can be closed.&lt;/p&gt;
&lt;p&gt;I realized that I have few more tickets that probably should be closed (they have &amp;quot;Verified Answer&amp;quot; check).&lt;/p&gt;
&lt;p&gt;Do I ask it to be closed, or just let it go? Just curious what it should be...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/437571?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2023 05:57:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d4cff0c-05eb-4173-b817-f13a7834950d</guid><dc:creator>makoto.inoue</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I can confirm that level shifter for the I2C solved the problem! I am getting the sensor readings now.&lt;/p&gt;
&lt;p&gt;The board overlay file ended up being:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c1 {
    sht3xd@44 {
		compatible = &amp;quot;sensirion,sht3xd&amp;quot;;
		reg = &amp;lt;0x44&amp;gt;;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As a side note, I did have to try two different level shifters. Somehow PCA9306 based level shifter didn&amp;#39;t work (maybe I got a dud one), but FXMA2102 based level shifter worked...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Anyway, thank you for your help!&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Makoto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/437396?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 07:11:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f04b85b8-9633-45ae-a647-fdb45cdb88a2</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Ah yes, I agree.&lt;br /&gt;This is likely the issue here.&lt;/p&gt;
&lt;p&gt;Good find!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/437395?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 07:01:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66276e2d-0bcb-4bd2-81ab-bf4001beb3fd</guid><dc:creator>makoto.inoue</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;Thank you for the info.&lt;/p&gt;
&lt;p&gt;Last night I realized a critical error I made - nRF7002DK VDD is 1.8v (I assumed 3v). nRF52840DK is 3v. the SHT31-D board I am using requires at least 2.4v to turn on. This likely explains why nRF52840DK worked and nRF7002DK does not.&lt;/p&gt;
&lt;p&gt;I ordered a level shifter today, so whenever I receive it I will test it out and post the result&amp;nbsp;here.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/437393?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 06:31:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d31d185-86c9-4c42-a8ae-504664ddfdf4</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="makoto.inoue"] When I try to change from i2c1 to i2c0 it starts showing me a red squiggly underline in nRF Connect for VS code stating it needs more parameters to be configured (ex. &amp;quot;pinctrl-0 is requried&amp;quot;). [/quote]
&lt;p&gt;This is because the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dtsi#L154-L155"&gt;i2c1 dts definition&lt;/a&gt; has pinctrl, while i2c0 has not yet been defined for the nRF5340DK cpuapp.&lt;br /&gt;Still, just keep on using i2c1 if that is the default, we should be able to make that one work.&lt;/p&gt;
&lt;p&gt;Maybe some of your pins are used by another resource, and this is why the i2c1 will not work?&lt;br /&gt;You can check this either by looking at build/zephyr/zephyr.dts or by using the VS Code visual dts editor:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dts_5F00_visual_5F00_editor.mp4"&gt;devzone.nordicsemi.com/.../dts_5F00_visual_5F00_editor.mp4&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/437036?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 13:15:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad8eb072-b92c-44e9-8e23-e573cc768063</guid><dc:creator>makoto.inoue</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I have not gotten the i2c0 that builds yet (not with nrf7002dk_nrf5340_cpuapp board). When I try to change from i2c1 to i2c0 it starts showing me a red squiggly underline in nRF Connect for VS code stating it needs more parameters to be configured (ex. &amp;quot;pinctrl-0 is requried&amp;quot;). It is not important to me whether I use i2c0 or i2c1, I&amp;#39;m just looking for a configuration that works.&lt;/p&gt;
&lt;p&gt;From what I can tell, GPIO output current levels are same for both nRF52840 and nRF5340. Since I can get the example working for nRF52840, I think that there is no need for extra GPIO setup for nRF5340. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/436948?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 09:37:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39e00d22-2130-49c4-b6f1-830536b81a9a</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The nRF5340 is not pin-locked. You can use any pins you want for I2C, but see &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/pin.html?cp=4_0_0_8_0"&gt;pin assignements&lt;/a&gt; for some notes.&lt;br /&gt;To change pins used for either i2c0 or i2c1, see &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/pin_control.html"&gt;Pin Control&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The i2c0 and i2c1 both should work though. But if it builds fine for i2c0 for you, maybe no need to figure out why i2c1 does not work?&lt;/p&gt;
[quote user="makoto.inoue"]Does an i2c current drive level differ on nRF5340 than nRF52840? I remember in when interfacing a particular kind of a touch LCD with nRF52840, I needed to increase the SPI&amp;#39;s current drive level (needed an extra GPIO configuration). Maybe something similar is required for nRF5340 when interfacing older i2c devices...?[/quote]
&lt;p&gt;For drive current, see &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/gpio.html?cp=4_0_0_6_12_5#unique_240033257"&gt;GPIO electrical specification&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/436927?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 08:54:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edf2fe45-53cf-4003-bfb2-b8e74847dc30</guid><dc:creator>makoto.inoue</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried the suggested edits/configuration, but it still does not work.&lt;/p&gt;
&lt;p&gt;The reason I&amp;#39;m using i2c1 instead of i2c0 is because the Arduino pin layout for SCL and SDA are mapped to:&lt;/p&gt;
&lt;p&gt;SCL -&amp;gt;&amp;nbsp;P1.03&lt;/p&gt;
&lt;p&gt;SDA-&amp;gt; P1.02&lt;/p&gt;
&lt;p&gt;of the nRF5340. I have wired my SHT31-D board&amp;#39;s SCL and SDA to those pins. Hence I thought it needed to use port1 instead of port 0, so i2c1 instead of i2c0. Maybe this is configurable/flexible and I don&amp;#39;t have to insist on using i2c1.&lt;/p&gt;
&lt;p&gt;Does an i2c current drive level differ on nRF5340 than nRF52840? I remember in when interfacing a particular kind of a touch LCD with nRF52840, I needed to increase the SPI&amp;#39;s current drive level (needed an extra GPIO configuration). Maybe something similar is required for nRF5340 when interfacing older i2c devices...?&lt;/p&gt;
&lt;p&gt;Also note that I checked the SHT31-D board, and it has pull-up resisters for both SCL and SDA, so that is taken care.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/436886?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 06:38:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ce7ec47-18f0-480f-8e0a-2cb91168e42c</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is the i2c1 which needs to be enabled:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c1 {
	status = &amp;quot;okay&amp;quot;;
	sht3xd@44 {
		compatible = &amp;quot;sensirion,sht3xd&amp;quot;;
		reg = &amp;lt;0x44&amp;gt;;
		label = &amp;quot;SHT3XD&amp;quot;;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;By the way, is there a reason to why you use i2c1 instead of i2c0?&lt;/p&gt;
[quote user="makoto.inoue"]&lt;span&gt;Would I need pull-up resistors when working with nRF7002DK board (nRF52840DK works with the same setup)?&lt;/span&gt;[/quote]
&lt;p&gt;As long as the nRF7002DK does not have pull-ups on the Development Kit on the pins you use, you need those, yes.&lt;br /&gt;And I do not believe it has. To verify this, you can check its &lt;a href="https://www.nordicsemi.com/Products/Development-hardware/nRF7002-DK/Download?lang=en#infotabs"&gt;hardware files&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/436856?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2023 23:52:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:658decef-cd26-4cd3-a518-9f37a05188b7</guid><dc:creator>makoto.inoue</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;Yes, I have enabled I2C in prj.conf. Below is my prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried with status = &amp;quot;okay&amp;quot;; added to the overlay file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c1 {
	sht3xd@44 {
		compatible = &amp;quot;sensirion,sht3xd&amp;quot;;
		status = &amp;quot;okay&amp;quot;;
		reg = &amp;lt;0x44&amp;gt;;
		label = &amp;quot;SHT3XD&amp;quot;;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But I still get the same problem in device.c (line 103):&amp;nbsp;&lt;span&gt;dev-&amp;gt;state-&amp;gt;init_res = 5&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;FYI the same hardware setup works (I get both temperature and humidity readouts) with nRF52840DK.&lt;/p&gt;
&lt;p&gt;Also I am using the code from here:&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/sensor/sht3xd/README.rst"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/sensor/sht3xd/README.rst&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the above documentation, I see an entry:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;Depending on the baseboard used, the &lt;/span&gt;&lt;strong&gt;SDA&lt;/strong&gt;&lt;span&gt; and &lt;/span&gt;&lt;strong&gt;SCL&lt;/strong&gt;&lt;span&gt; lines require Pull-Up resistors.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Would I need pull-up resistors when working with nRF7002DK board (nRF52840DK works with the same setup)?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Makoto&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT31 readout on nRF5340 using the Zephyr Sample</title><link>https://devzone.nordicsemi.com/thread/436805?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2023 14:45:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92820973-f3ca-43c2-ada4-a9bda52e1646</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you enabled I2C in prj.conf?&lt;/p&gt;
&lt;p&gt;Your driver should be enabled in the devicetree overlay with&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;status = &amp;quot;okay&amp;quot;;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>