<?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>How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44939/how-to-implement-i2c-on-nrf9160</link><description>I have tried to use I2C but it does&amp;#39;t work out. nRF9160 doesn&amp;#39;t start booting after executing &amp;quot;build and run&amp;quot; and pushing the reset button. 
 
 I open secure_boot project first and build and run. Then I open this project. 
 build and run is successful</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Aug 2021 15:57:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44939/how-to-implement-i2c-on-nrf9160" /><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/325364?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 15:57:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6a2fe6f-579c-43ba-b9ee-1ff7967ddad8</guid><dc:creator>MichaelXlivnenko</dc:creator><description>&lt;p&gt;The link is invalid,&amp;nbsp;could you please share a valid version?&lt;br /&gt;Thanks)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/217067?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 12:34:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78680f2f-2938-421e-ac57-9efa28cd01b1</guid><dc:creator>talha</dc:creator><description>&lt;p&gt;The compatible line did the trick. it works. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/217063?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 12:27:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52b7389d-e2f7-497c-bf1a-1f39b63c7800</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;No problem.&lt;/p&gt;
&lt;p&gt;For reference, here is the project I used to test it:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/i2c.zip"&gt;devzone.nordicsemi.com/.../i2c.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I built it with &amp;quot;west build -b nrf9160_pca10090ns -d my_build_folder&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/217060?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 12:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3059b56-98ae-42e0-b0c1-950f0141e75d</guid><dc:creator>talha</dc:creator><description>&lt;p&gt;&amp;nbsp;I tried doing it before the status, i will try it like this.&lt;br /&gt;Thank you. :)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/217055?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 12:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efe14948-2bb6-4c44-87be-7ffc51c4ab1d</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/talha"&gt;talha&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;To fix this issue, please add&amp;nbsp;compatible = &amp;quot;nordic,nrf-twim&amp;quot;; to the overlay. I.e., so it looks like this:&lt;/p&gt;
&lt;p&gt;nrf9160_pca10090ns.overlay&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c3 {
	status = &amp;quot;okay&amp;quot;;
	compatible = &amp;quot;nordic,nrf-twim&amp;quot;;
	sda-pin = &amp;lt; 12 &amp;gt;;
	scl-pin = &amp;lt; 11 &amp;gt;;
    clock-frequency = &amp;lt;I2C_BITRATE_STANDARD&amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/217029?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 10:03:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10f9dc4d-9c73-4ce6-a725-1fc13ce7d39f</guid><dc:creator>talha</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt; : i am trying to run the i2c sensor example from the master branch of your repo.&lt;br /&gt;&lt;br /&gt;I am having the following error with latest version of the tools. (ran a west update)&lt;br /&gt;Can you please help with this ?&amp;nbsp;&lt;br /&gt;Thank you.&lt;br /&gt;Seems like it cannot recognize the i2c3 some how ?&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;2&amp;gt; Compiling ‘i2c_nrfx_twim.c’
2&amp;gt; In file included from C:/Nord/ncs/zephyr/include/toolchain.h:39:0,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/kernel_includes.h:19,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/kernel.h:17,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/device.h:11,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/drivers/i2c.h:23,
2&amp;gt;                  from C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:8:
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:221:4: error: &amp;#39;DT_NORDIC_NRF_TWIM_I2C_3_CLOCK_FREQUENCY&amp;#39; undeclared here (not in a function); did you mean &amp;#39;DT_NORDIC_NRF_TWIM_I2C_2_CLOCK_FREQUENCY&amp;#39;?
2&amp;gt; C:/Nord/ncs/zephyr/include/toolchain/gcc.h:63:52: note: in definition of macro &amp;#39;BUILD_ASSERT_MSG&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:220:3: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_FREQUENCY&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:213:3: error: expression in static assertion is not an integer
2&amp;gt; C:/Nord/ncs/zephyr/include/toolchain/gcc.h:63:52: note: in definition of macro &amp;#39;BUILD_ASSERT_MSG&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:220:3: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_FREQUENCY&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
2&amp;gt; In file included from C:/Nord/ncs/zephyr/include/arch/arm/irq.h:18:0,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/arch/arm/arch.h:26,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/arch/cpu.h:17,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/kernel_includes.h:34,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/kernel.h:17,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/device.h:11,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/drivers/i2c.h:23,
2&amp;gt;                  from C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:8:
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:226:15: error: &amp;#39;DT_NORDIC_NRF_TWIM_I2C_3_IRQ_0&amp;#39; undeclared (first use in this function); did you mean &amp;#39;DT_NORDIC_NRF_TWIM_I2C_2_IRQ_0&amp;#39;?
2&amp;gt; C:/Nord/ncs/zephyr/include/sw_isr_table.h:70:5: note: in definition of macro &amp;#39;Z_ISR_DECLARE&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/include/irq.h:51:2: note: in expansion of macro &amp;#39;Z_ARCH_IRQ_CONNECT&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:226:3: note: in expansion of macro &amp;#39;IRQ_CONNECT&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:226:15: note: each undeclared identifier is reported only once for each function it appears in
2&amp;gt; C:/Nord/ncs/zephyr/include/sw_isr_table.h:70:5: note: in definition of macro &amp;#39;Z_ISR_DECLARE&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/include/irq.h:51:2: note: in expansion of macro &amp;#39;Z_ARCH_IRQ_CONNECT&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:226:3: note: in expansion of macro &amp;#39;IRQ_CONNECT&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
2&amp;gt; In file included from C:/Nord/ncs/zephyr/include/arch/arm/arch.h:26:0,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/arch/cpu.h:17,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/kernel_includes.h:34,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/kernel.h:17,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/device.h:11,
2&amp;gt;                  from C:/Nord/ncs/zephyr/include/drivers/i2c.h:23,
2&amp;gt;                  from C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:8:
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:227:8: error: &amp;#39;DT_NORDIC_NRF_TWIM_I2C_3_IRQ_0_PRIORITY&amp;#39; undeclared (first use in this function); did you mean &amp;#39;DT_NORDIC_NRF_TWIM_I2C_2_IRQ_0_PRIORITY&amp;#39;?
2&amp;gt; C:/Nord/ncs/zephyr/include/arch/arm/irq.h:82:32: note: in definition of macro &amp;#39;Z_ARCH_IRQ_CONNECT&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:226:3: note: in expansion of macro &amp;#39;IRQ_CONNECT&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:240:17: error: &amp;#39;DT_NORDIC_NRF_TWIM_I2C_3_SCL_PIN&amp;#39; undeclared here (not in a function); did you mean &amp;#39;DT_NORDIC_NRF_TWIM_I2C_2_SCL_PIN&amp;#39;?
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:241:17: error: &amp;#39;DT_NORDIC_NRF_TWIM_I2C_3_SDA_PIN&amp;#39; undeclared here (not in a function); did you mean &amp;#39;DT_NORDIC_NRF_TWIM_I2C_2_SDA_PIN&amp;#39;?
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
2&amp;gt; In file included from C:/Nord/ncs/zephyr/include/drivers/i2c.h:23:0,
2&amp;gt;                  from C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:8:
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:247:9: error: &amp;#39;DT_NORDIC_NRF_TWIM_I2C_3_LABEL&amp;#39; undeclared here (not in a function); did you mean &amp;#39;DT_NORDIC_NRF_TWIM_I2C_2_LABEL&amp;#39;?
2&amp;gt; C:/Nord/ncs/zephyr/include/device.h:107:11: note: in definition of macro &amp;#39;DEVICE_AND_API_INIT&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:246:2: note: in expansion of macro &amp;#39;DEVICE_DEFINE&amp;#39;
2&amp;gt; C:/Nord/ncs/zephyr/drivers/i2c/i2c_nrfx_twim.c:269:1: note: in expansion of macro &amp;#39;I2C_NRFX_TWIM_DEVICE&amp;#39;
Build failed
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/177655?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 15:43:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f311884a-e5ef-4381-9428-bd66aba8a077</guid><dc:creator>Yusuke</dc:creator><description>&lt;p&gt;Thank you so much!&lt;/p&gt;
&lt;p&gt;I copied your project and it works.&lt;/p&gt;
&lt;p&gt;I used to copy asset_tracker project and overwrite code on main.c because I don&amp;#39;t know how to make a project from scratch. This caused the problem. I copy secure_boot project and copy your code then I2c works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/177505?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 09:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:735137b8-31a0-44af-8a0d-d2b20293fc56</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/sigurdnev/fw-nrfconnect-nrf/tree/i2c/samples/nrf9160/i2c_scanner"&gt;This sample&lt;/a&gt; runs fine for me on the nRF9160, i.e. the programs starts. Note that I have not tested it by connecting a&amp;nbsp;I2C slave to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/177055?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 13:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c7ba93e-d496-4576-8995-6c53a18e7fab</guid><dc:creator>Yusuke</dc:creator><description>&lt;p&gt;Hi, Sigurd. Thank you very much for your advice.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;Are you on the master branch, or are you on the 0.3.0 tag ?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Yes. I followed the instruction of Getting Started Assistant and run this command.&lt;br /&gt;cd &amp;lt;sourcecode_root&amp;gt;/ncs/nrf ; git checkout tags/v0.3.0&lt;br /&gt;&lt;br /&gt;&amp;gt;&lt;span&gt;What commands do you use to build the project?&lt;/span&gt;&lt;br /&gt;I click &amp;quot;Build&amp;quot; &amp;gt; &amp;quot;Build and run&amp;quot; on SEGGER Embedded Studio. I don&amp;#39;t know other ways to build.&lt;br /&gt;&lt;br /&gt;&amp;gt;&lt;span&gt;Also note that the peripheral(I2C, or TWIM in this case) need to be configured as non-secure in secure_boot sample. On the master branch, at least&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/samples/nrf9160/secure_boot/src/main.c#L312"&gt;&lt;span&gt;NRF_TWIM2 is configured to non-secure by default.&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;So, when I start to develop a new firmware, what should I do? Should I copy secure_boot sample and modify it? I usually copy asset_tracker sample and modify it.&lt;br /&gt;I really appreciate it if you show me any example code using I2C with nRF9160.&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement I2C on nRF9160?</title><link>https://devzone.nordicsemi.com/thread/176898?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 09:03:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69880035-36d2-46e9-a028-3f84dde2d9b5</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you on the master branch, or are you on the 0.3.0 tag ?&lt;/p&gt;
&lt;p&gt;What commands do you use to build the project? If you are on master branch, you can use the commands shown in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44879/build-nrf-connect-sdk-project-via-command-line"&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also note that the peripheral(I2C, or TWIM in this case) need to be configured as non-secure in secure_boot sample. On the master branch, at least&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/samples/nrf9160/secure_boot/src/main.c#L312"&gt;&lt;span&gt;NRF_TWIM2 is configured to non-secure by default.&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>