<?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>SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120317/sht4x-interface-with-nrf52840</link><description>Hi, 
 I am trying to integrate Sensirion SHT40 sensor with nRF52840. I am using the sensor sample app from 2.9.0 SDK. I am building with 2.6.1 SDK with toolchain 2.6.1. The build is ok, but when the app starts, it just get stuck as I can see in the console</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Apr 2025 06:11:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120317/sht4x-interface-with-nrf52840" /><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/530122?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 06:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfdf688b-2a8c-41d2-be8d-a09ba6503484</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure if you saw my previous comment. Anyway, this does appear to be an obvious bug. If you want, you can submit a PR to Zephyr to fix the delay.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is self-testing something you want to be performed on every boot? The datasheet suggests using during production tests. If not, you can remove the&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;enable-selftest&lt;/span&gt;&lt;span&gt;; property from the node in your DT and reduce the startup time of your app.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/530120?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 06:01:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bc2357d-adf3-46bc-9c53-61fea2854d95</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;ok managed to solve it by increasing the SGP40 test wait time from 250mS to 400mS. But this is not a good way of solving this as I am modifying the files in the SDK. I cant think of any way to do it in my code as this initialization is happening even before my code is executed.&lt;/p&gt;
&lt;p&gt;I can see from SGP40 datasheet Figure 9 shows that the wait from send self test command to&amp;nbsp;read the result should be 320mS, but the &amp;#39;SGP40_TEST_WAIT_MS&amp;#39; is 250mS. This explains why it works when I increase this time to 400mS. If this is correct, probably this is a bug in the driver code timing definitions.&lt;/p&gt;
&lt;p&gt;Any thoughts?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/530119?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 05:50:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2d8bf13-a785-4e0d-95fd-ccb085743ac5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;-5 translates to -EIO. Since this&amp;nbsp;happens while you&amp;#39;re attempting to read from the sensor, I suspect the sensor is responding with a NACK.&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t worked with this sensor before, but I had a look at the datasheet and the driver implementation, and I&amp;#39;m wondering if the delay between writing the test command and reading back the result is sufficient. Section 3.3 of the datasheet says it should be 320 ms, but it is 250 ms in the code:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/commit/0d7cb32c58dce7396315c7c6fb7f67749e5ee1b3#diff-0b4f8ce909416f09b98d94dafd9f360d5243bfa41a913d8eba3ce394ca2cb143R21"&gt;https://github.com/zephyrproject-rtos/zephyr/commit/0d7cb32c58dce7396315c7c6fb7f67749e5ee1b3#diff-0b4f8ce909416f09b98d94dafd9f360d5243bfa41a913d8eba3ce394ca2cb143R21&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try to increase this delay and see if it helps?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/530116?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 05:34:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8ce5043-5369-49af-b249-4ae1bc057428</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;ok now I can see the self test command correctly send to SGP40 using a logic analyzer. But the read of the result seems to fail with return code -5.&lt;/p&gt;
&lt;p&gt;Any idea?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/530113?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 05:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79e85c6c-066c-4619-8aed-ce13adb043fc</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;Strangely enough, when I restarted my computer, the above SGP40 issue disappeared !!&amp;nbsp;Now I can kconfig and see the SGP40 driver enable is active.&lt;/p&gt;
&lt;p&gt;I am now continuing the rest of the tests.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Kaushalya&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/530107?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 04:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a28eb789-d848-4369-961c-bc442c6f6d62</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;Strangely enough, when I restarted my computer, the above SGP40 issue disappeared !!&amp;nbsp;Now I can kconfig and see the SGP40 driver enable is active.&lt;/p&gt;
&lt;p&gt;Now I get the following errors when try to fetch data from SGP40.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.003,173] &amp;lt;inf&amp;gt; ieee802154_nrf5: nRF5 802154 radio initialized
[00:00:00.003,204] &amp;lt;dbg&amp;gt; temp_nrf5_mpsl: temp_nrf5_mpsl_init:


[00:00:00.253,540] &amp;lt;err&amp;gt; SGP40: Failed to read data sample.
[00:00:00.253,601] &amp;lt;err&amp;gt; SGP40: Selftest failed!
[00:00:00.260,437] &amp;lt;inf&amp;gt; fs_nvs: 8 Sectors of 4096 bytes
[00:00:00.260,467] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 0, e98
[00:00:00.260,467] &amp;lt;inf&amp;gt; fs_nvs: data wra: 0, 550
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
[00:00:00.281,524] &amp;lt;dbg&amp;gt; temp_nrf5_mpsl: temp_nrf5_mpsl_sample_fetch: sample: 115
[00:00:00.281,555] &amp;lt;dbg&amp;gt; temp_nrf5_mpsl: temp_nrf5_mpsl_channel_get: Temperature:28,750000
[00:00:00.281,677] &amp;lt;err&amp;gt; coap_client: Device sgp40@59 is not ready.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My code snippet is like this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;.
.
static void ADCscan_fn () {

int16_t temp16, hum16;

	// 17. SHT40 functionality
	if (sensor_sample_fetch(sht)) {
		LOG_INF(&amp;quot;Failed to fetch sample from SHT4X device\n&amp;quot;);
		return;
	}

	sensor_channel_get(sht, SENSOR_CHAN_AMBIENT_TEMP, &amp;amp;temp);
	sensor_channel_get(sht, SENSOR_CHAN_HUMIDITY, &amp;amp;hum);

#if CONFIG_APP_USE_HEATER
	struct sensor_value heater_p;
	struct sensor_value heater_d;

	heater_p.val1 = CONFIG_APP_HEATER_PULSE_POWER;
	heater_d.val1 = CONFIG_APP_HEATER_PULSE_DURATION;
	sensor_attr_set(sht, SENSOR_CHAN_ALL,
			SENSOR_ATTR_SHT4X_HEATER_POWER, &amp;amp;heater_p);
	sensor_attr_set(sht, SENSOR_CHAN_ALL,
			SENSOR_ATTR_SHT4X_HEATER_DURATION, &amp;amp;heater_d);
#endif

	LOG_INF(&amp;quot;SHT4X: %.2f Temp. [C] ; %0.2f RH [%%]&amp;quot;, sensor_value_to_float(&amp;amp;temp), sensor_value_to_float(&amp;amp;hum));

	#if CONFIG_APP_USE_HEATER
	/*
	 * Conditions in which it makes sense to activate the heater
	 * are application/environment specific.
	 *
	 * The heater should not be used above SHT4X_HEATER_MAX_TEMP (65 &amp;#176;C)
	 * as stated in the datasheet.
	 *
	 * The temperature data will not be updated here for obvious reasons.
	 **/
	if (hum.val1 &amp;gt; CONFIG_APP_HEATER_HUMIDITY_THRESH &amp;amp;&amp;amp;
			temp.val1 &amp;lt; SHT4X_HEATER_MAX_TEMP) {
		printf(&amp;quot;Activating heater.\n&amp;quot;);

		if (sht4x_fetch_with_heater(sht)) {
			printf(&amp;quot;Failed to fetch sample from SHT4X device\n&amp;quot;);
			return 0;
		}

		sensor_channel_get(sht, SENSOR_CHAN_HUMIDITY, &amp;amp;hum);
	}
#endif

#if CONFIG_APP_USE_COMPENSATION
		comp_t.val1 = temp.val1; /* Temp [&amp;#176;C] */
		comp_rh.val1 = hum.val1; /* RH [%] */
		sensor_attr_set(sgp,
				SENSOR_CHAN_GAS_RES,
				SENSOR_ATTR_SGP40_TEMPERATURE,
				&amp;amp;comp_t);
		sensor_attr_set(sgp,
				SENSOR_CHAN_GAS_RES,
				SENSOR_ATTR_SGP40_HUMIDITY,
				&amp;amp;comp_rh);
#endif

	if (sensor_sample_fetch(sgp)) {
		LOG_INF(&amp;quot;Failed to fetch sample from SGP40 device.\n&amp;quot;);
		return;
	}

	sensor_channel_get(sgp, SENSOR_CHAN_GAS_RES, &amp;amp;aq);
	LOG_INF(&amp;quot;SGP40: %d Gas [a.u.]\n&amp;quot;, aq.val1);
	// -----------------------

    .
    .
	k_work_schedule (&amp;amp;ADC_scan_work, K_MSEC(30000));	// schedule for next cycle
}

.
.
int main(void)
{
	int ret;

	if (!device_is_ready(sht)) {
		LOG_ERR(&amp;quot;Device %s is not ready.\n&amp;quot;, sht-&amp;gt;name);
		return 0;
	}
	if (!device_is_ready(sgp)) {
		LOG_ERR(&amp;quot;Device %s is not ready.\n&amp;quot;, sgp-&amp;gt;name);
		return 0;
	}
	k_work_schedule (&amp;amp;ADC_scan_work, K_NO_WAIT);	// just to test Sensiron SHT40/SGP40
    .
    .
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;1. From the console it seems a SGP40 read cycle and a self test has happened before checking device ready. But device read status check happens first thing in the main (). I tried debugging into it and also fount that device ready status check happened first and then main () returns as a fail of that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Why is &amp;quot;&lt;span&gt;device_is_ready&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;sgp&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&amp;quot; fails?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Kaushalya&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/530087?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 00:11:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0212e17-0f54-4724-b54a-0ffbad60426a</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;Hi Vidar, Your reply is much appreciated. Now that is sorted, I have another. I have two sensors on the same I2C bus, the Sensirion SHT40 and SGP40. The device nodes are defined in my overlay as&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;i2c0&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;clock-frequency&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;I2C_BITRATE_FAST&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sht4x&lt;/span&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;44&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;compatible&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;sensirion,sht4x&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;reg&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;0x44&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;repeatability&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sgp40&lt;/span&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;59&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;compatible&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;sensirion,sgp40&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;reg&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;0x59&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;enable-selftest&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;This is present in my zephyr.dts file as well.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;Now when I try to enable the driver using &amp;#39;&lt;span&gt;CONFIG_SGP40&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;#39; in prj.conf, it says &amp;quot;DT_HAS_SENSIRION_SGP40_ENABLED&amp;quot; is missing !! but when I check in the .config file it has&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&amp;quot;&lt;span&gt;CONFIG_SGP40&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;When I try to Kconfig the SGP40, it is disabled due to&amp;nbsp;DT_HAS_SENSIRION_SGP40_ENABLED being false.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;When I debug into the program, the &amp;quot;&lt;span&gt;device_is_ready&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;sgp&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;quot; fails because the dev-&amp;gt;state-&amp;gt;init_res is not 0 (it is 5)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;How come the SHT4x node gets detected and SGP40 node is not detected from the devicetree ?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Kaushalya&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/529894?ContentTypeID=1</link><pubDate>Tue, 01 Apr 2025 06:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90d7ad01-9279-4be3-815f-d225df85a479</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry, the last code snippet shows that you are correctly&amp;nbsp;fetching data from&amp;nbsp;your sht40 sensor. I just saw references to the&amp;nbsp; &amp;quot;temp_nrf5_mpsl&amp;quot; driver in the log you posted and assumed you may have selected the SoC&amp;#39;s built-in temperature sensor like in the &lt;a title="Get CPU die temperature data from a sensor using polling." href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/sensor/die_temp_polling/README.html#die_temp_polling"&gt;CPU die temperature polling&lt;/a&gt;&amp;nbsp;sample.&amp;nbsp;This internal temperature sensor is used by the clock calibration and the 15.4 radio driver and that is why it is enabled in your project.&lt;/p&gt;
&lt;p&gt;Regarding the assertion, the problem appears to be that&amp;nbsp;&lt;span&gt;CONFIG_COAP_CLIENT_THREAD_PRIORITY defaults&amp;nbsp;to&amp;nbsp;CONFIG_NUM_PREEMPT_PRIORITIES instead of&amp;nbsp;CONFIG_NUM_PREEMPT_PRIORITIES - 1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&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/pastedimage1743487810607v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/2eb8cfb7f5084d040725dc0f4c61b526fa40b8f0/subsys/net/lib/coap/Kconfig#L114"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/2eb8cfb7f5084d040725dc0f4c61b526fa40b8f0/subsys/net/lib/coap/Kconfig#L114&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will report this as a bug internally.&amp;nbsp;The fix for now is to assign an appropriate priority level for the coap thread in your prj.conf file. For example:&amp;nbsp;CONFIG_COAP_CLIENT_THREAD_PRIORITY=0.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/529883?ContentTypeID=1</link><pubDate>Tue, 01 Apr 2025 03:02:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:befb5c24-c055-4dc9-b8f5-7305aed7a61f</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;I can see &amp;quot;&lt;span&gt;CONFIG_TEMP_NRF5_MPSL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&amp;quot; in the .config file, which indicates use of internal temp sensor. When I do Menuconfig, I can see&amp;nbsp;TEMP_NRF5_MPSL is enabled under Device Drivers, but its readonly.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/529873?ContentTypeID=1</link><pubDate>Mon, 31 Mar 2025 23:03:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae69efd3-7568-4cf8-baec-06c36eada4c5</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Many thanks for lookin into this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thats interesting observation that I am using Temp peripheral. How do we enable Temp peripheral?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What I have done in my case is&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. Enable&amp;nbsp;&lt;span style="font-family:inherit;"&gt;Sensirion SHT4x node under I2C node in the device tree as follows.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	i2c0_default: i2c0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 15)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIM_SCL, 1, 13)&amp;gt;;
		};
	};

	i2c0_sleep: i2c0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 15)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIM_SCL, 1, 13)&amp;gt;;
			low-power-enable;
		};
	};
};

&amp;amp;i2c0 {
	status = &amp;quot;okay&amp;quot;;
	clock-frequency = &amp;lt;I2C_BITRATE_FAST&amp;gt;;
	sht4x@44 {
		status = &amp;quot;okay&amp;quot;;
		compatible = &amp;quot;sensirion,sht4x&amp;quot;;
		reg = &amp;lt;0x44&amp;gt;;
		repeatability = &amp;lt;2&amp;gt;;
	};
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;2. Access it from coap_client.c as follows.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;const struct device *const sht = DEVICE_DT_GET_ANY(sensirion_sht4x);
struct sensor_value temp, hum;

#if !DT_HAS_COMPAT_STATUS_OKAY(sensirion_sht4x)		// Feature 17
#error &amp;quot;No sensirion,sgp40 compatible node found in the device tree&amp;quot;
#endif
.
.
void ADCscan () {
	if (sensor_sample_fetch(sht)) {
		LOG_INF(&amp;quot;Failed to fetch sample from SHT4X device\n&amp;quot;);
		return;
	}
	sensor_channel_get(sht, SENSOR_CHAN_AMBIENT_TEMP, &amp;amp;temp);
	sensor_channel_get(sht, SENSOR_CHAN_HUMIDITY, &amp;amp;hum);

	LOG_INF(&amp;quot;SHT4X: %.2f Temp. [C] ; %0.2f RH [%%]&amp;quot;,
		sensor_value_to_float(&amp;amp;temp),
		sensor_value_to_float(&amp;amp;hum));
 
    .
    .
}

int main () {
	if (!device_is_ready(sht)) {
		LOG_INF(&amp;quot;Device %s is not ready.\n&amp;quot;, sht-&amp;gt;name);
		return 0;
	}
	ADCscan ();
	.
	.
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Is there anything you see I have not done correctly here for getting data from SHT40?&amp;nbsp;&lt;strong&gt;I get both temperature and humidity readings in my case and both values seems to change with environmental conditions. Furthermore I can see the I2C signals on bus as well. So seems like the data is originating from the SGT40 sensor.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/120317/sht4x-interface-with-nrf52840/529789"]&amp;nbsp;CONFIG_MAIN_THREAD_PRIORITY is set to &amp;#39;0&amp;#39; in both cases.[/quote]
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;I checked that in both cases of&amp;nbsp;&lt;span&gt;CONFIG_COAP_CLIENT, the&amp;nbsp;CONFIG_MAIN_THREAD_PRIORITY&amp;nbsp; is 0, but when&amp;nbsp;CONFIG_COAP_CLIENT is enabled it crashes as before.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;This is my .config file.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5734_2E00_.config.zip"&gt;devzone.nordicsemi.com/.../5734_2E00_.config.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/529789?ContentTypeID=1</link><pubDate>Mon, 31 Mar 2025 12:15:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80ca4807-0a0c-498f-a5a7-7c65a4e41eba</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello &lt;span&gt;Kaushalya&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;The log shows you are reading the temperature from the nRF52&amp;#39;s&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/temp.html"&gt;TEMP&lt;/a&gt;&amp;nbsp;peripheral, not the external sht40 sensor. Maybe you selected the wrong sensor device in your app?&lt;/p&gt;
&lt;p&gt;Regarding the assertion, it appears to be raised for the main thread if I&amp;#39;m the crash log correctly, but I don&amp;#39;t see why&amp;nbsp;this would happen when enabling the&amp;nbsp;&lt;span&gt;CONFIG_COAP_CLIENT symbol. Please check the generated configuration file (.config) for your application located in the build directory and check if the&amp;nbsp;CONFIG_MAIN_THREAD_PRIORITY is set to &amp;#39;0&amp;#39; in both cases.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SHT4x interface with nRF52840</title><link>https://devzone.nordicsemi.com/thread/529674?ContentTypeID=1</link><pubDate>Mon, 31 Mar 2025 04:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84d66ecf-3b34-4af9-82b4-6b8d2d53816a</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;Hi, I think with&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_COAP_CLIENT&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I can go ahead. What I saw as program getting stuck in the first occurrence, is not actually a stuck, just the console getting disabled to preserve battery power.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;But I am still curious to know what does the&amp;nbsp; &amp;#39;CONFIG_COAP_CLIENT&amp;#39; do and why the issue with thread priority.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Kaushalya&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>