<?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>i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109067/i2c_write_dt-returns--5-en0dev</link><description>Hello, I am trying example one of the devacademy tutorial about i2c. I have &amp;quot;converted&amp;quot; it to the nrf52832 and instead of the shield I use two MC34X9 accelerometers. I currently am connected to a logic analyzer so the adresses and stuf doesn&amp;#39;t matter</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Mar 2024 13:32:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109067/i2c_write_dt-returns--5-en0dev" /><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473449?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 13:32:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41bad8d1-b76e-431f-b435-501c986ec013</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Niels,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Great to hear that the issue was solved. Hope you have a wonderful day!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473446?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 13:29:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f7de560-2c40-4976-b455-21e446678f49</guid><dc:creator>Niels Redegeld</dc:creator><description>&lt;p&gt;Okay so it works now, cause on the custom Sensor pcb the pins were labelled wrong. I tried switching the pins before and it didn&amp;acute;t work. So I am pretty sure the internal pullup resistor did the job at fixing the problem.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks for your time&lt;br /&gt;&lt;br /&gt;Kind reagrds,&lt;/p&gt;
&lt;p&gt;Niels Redegeld&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473437?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 13:11:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4743c554-92c7-4c71-a536-7e12870fd03f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Niels,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It will still give a -5, because there is no sensor attached.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a logic analyzer scope, when pull-up has been enabled on SDA/SCL pins, tested with the firmware that you attached:&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/pastedimage1710249040289v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473409?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 12:08:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:325e83bc-a979-44df-8d34-9fb37fec0969</guid><dc:creator>Niels Redegeld</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I did not have a pullup resistor, so I added that. Thanks.&lt;br /&gt;However the problem is still not solved, it gives the same error.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;&lt;br /&gt;Niels Redegeld&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473406?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 11:59:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0018e46b-615a-4b63-9ad8-5cff28cd95a4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Niels,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any external pull-up resistors present on these pins?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If not, can you please add this to the overlay?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	i2c0_default: i2c0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 26)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIM_SCL, 0, 27)&amp;gt;;
			bias-pull-up;
		};
	};
};

&amp;amp;i2c0 {
    status = &amp;quot;okay&amp;quot;;    
    mysensor: mysensor@4c{
        compatible = &amp;quot;st,stts751&amp;quot;;
        reg = &amp;lt; 0x4c &amp;gt;;
    };
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473378?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 09:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a568d2a7-11d3-403c-9302-2c6dd87f7030</guid><dc:creator>Niels Redegeld</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Yes the state does not change at all. The pins that are defined are pin 26 SCL and pin 27 SDA&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Niels Redegeld&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473376?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 09:36:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea90cb03-a891-4d5f-984e-6ac41223f5a9</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Niels,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you mean that the SDA/SDC does not change state at all?&lt;/p&gt;
&lt;p&gt;Which pins are you using? Ie. what is the pins defined in &amp;quot;i2c0_default&amp;quot;?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473371?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 09:33:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d22310e-8966-47f2-a958-2f1a21a6ac41</guid><dc:creator>Niels Redegeld</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Thank you for your reply, it seems fairly logical but the ack would be received after the MCU sent something. Which means that when i put the I2C bus on the logic analyser I would&amp;#39;ve seen something at the start. But nothing got sent at all. This makes me think that the error comes from deeper with in cause i already tried before with the sensor already connected.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Niels Redegeld&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c_write_dt returns -5 EN0DEV</title><link>https://devzone.nordicsemi.com/thread/473202?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2024 13:36:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca2d21a7-0c3b-4f48-adba-9f11baa0164e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I currently am connected to a logic analyzer so the adresses and stuf doesn&amp;#39;t matter. When i flash the code i2c_write_dt returns -5 (EN0DEV) And I am wondering what this actually means.[/quote]
&lt;p&gt;If there is no sensors connected to the I2C SDA/SCL pins, then you will not get an ACK from a sensor, and thus the API will report -EIO (-5) back.&lt;/p&gt;
&lt;p&gt;This is expected behavior when there&amp;#39;s no ACK received over the bus.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>