<?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>UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84168/uart0-uart1-and-i2c0-utilization-and-initialization</link><description>Hi, I need to use UART0, UART1 and I2C0 in my application. I initialized these in overlay file (attached). When, debug is run, it is observed that the I2C binding is not successful see attached image file. I am using UART0 and UART1 in asynchrounous mode</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Mar 2022 08:10:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84168/uart0-uart1-and-i2c0-utilization-and-initialization" /><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/356192?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 08:10:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:070b086a-bd7c-4865-ba1b-38e0ee347fdf</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I ran your sample, and I see your issue.&lt;/p&gt;
&lt;p&gt;But I just found the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/zephyr/samples/boards/nrf/nrfx_prs/README.html"&gt;nrfx peripheral resource sharing example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It explains your problem and show a way to fix it.&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><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/356120?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 16:02:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d14799f6-6158-4fd9-9990-8fd0b30859db</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Hi, the build and Compile is successful, but whrn Debug, then &lt;strong&gt;Get_Device_binding(I2C0)&lt;/strong&gt; fails. Plesae, test the program at your end, sent in just previous reply one earlier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/355935?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 07:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b011a7a-8ba8-4073-a322-265342235c61</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Please post the error message you get.&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><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/355900?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 17:24:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e4417f6-bbb8-4142-8138-41bf626e5e46</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Hello, I tried after adding the configurations in prj.conf, but I2C0 binding is not successful.&lt;/p&gt;
&lt;p&gt;Please, test the following Code:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/peripheral.txt"&gt;devzone.nordicsemi.com/.../peripheral.txt&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/355869?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 15:12:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7488da36-03a2-4d98-848a-3996e3d986cc</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Could you post the error message you receive?&lt;/p&gt;
&lt;p&gt;To get more debug information, set the following configurations in prj.conf:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_LOG=y
CONFIG_THREAD_NAME=y&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><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/355520?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 11:46:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d621972-3a33-4da9-b6de-2c0a0c2315d4</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Yes, I tried to&amp;nbsp;initializae the I2C0 peripheral using&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;void init_i2c_master()&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; dev_i2c = device_get_binding(&amp;quot;I2C_0&amp;quot;);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; if (dev_i2c == NULL) {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; printk(&amp;quot;Failed to get I2C0 binding\n&amp;quot;);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; return; &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; }&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;} &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;after disable of UART1 using&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;void disable_uart1(){&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; NRF_UARTE0-&amp;gt;TASKS_STOPTX = 1;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; NRF_UARTE0-&amp;gt;TASKS_STOPRX = 1;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;but, I2C initilaize fail, when run Debug .. though build and Compile is successful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/355513?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 11:16:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ade8af4-3dab-4a55-968c-8235e27e49cc</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you tried to disable UART1 in software when using I2C0?&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><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/355498?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 10:46:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13776aa8-0d64-4c87-80b6-5771643a25b8</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Hello, I studied about Peripheral Resource Sharing. I could not find method to switch shared resources between competetive peripherals alernatively. UART1 and I2C0 share same address space and only one should be enabled at a time. Did, you find any ways to multiplex such pripherals ? I need to send the data to UART1 and to I2C0 alternatively and never need both at time. What is metod to use these alteranatively ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/350380?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 10:03:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58ca8fa4-30ef-4047-b151-ec758d3f7843</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have not been able to find any such API.&lt;/p&gt;
&lt;p&gt;Likely you will have to disable and enable the peripherals manually when you change between them.&lt;/p&gt;
&lt;p&gt;You might also need to enable the PERIPHERAL_RESOURCE_SHARING_ENABLED, see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19229/how-to-switch-peripheral-use-at-runtime"&gt;This DevZone case&lt;/a&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><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/350220?ContentTypeID=1</link><pubDate>Fri, 28 Jan 2022 13:48:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3969f57e-8565-4717-9911-d16c31fb0594</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Hi Hellsvik, I looking for Zephyr API etc to enable / disbale peripherals woth shared ID and Address space so as to implement in nRF Connect SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/350200?ContentTypeID=1</link><pubDate>Fri, 28 Jan 2022 12:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25646498-daf3-4345-9146-5f102ca60ac6</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You should be able to do enable multiple peripherals with the same ID and switch between them in your code.&lt;/p&gt;
&lt;p&gt;On how to do this, see &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/peripheral_interface.html?cp=3_0_0_6_0_1#concept_shared_id"&gt;nRF5340 Documentation on Peripherals with shared ID&lt;/a&gt; and the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrfx/nrfx_api/prs.html"&gt;Peripheral Resource Sharing (PRS)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Is this what you were looking for?&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><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/350196?ContentTypeID=1</link><pubDate>Fri, 28 Jan 2022 12:25:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6384b0ce-aee0-4921-9008-1dc264de5231</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Dear Hellesvik, you pointed through the links that TWIM and UARTE have same ID and address space. Therefore, how to do instantiaiton of such Peripherals ? Should instantiaiton be done in Kernel or Programitacally ? If say UART0 has been instantiated in Kernel, then how to disable it and enable I2C0 programitically ? After completiotion of I2C0 transmit/ receive task, how to enabke UART0 again ? I2C0 is to be used as TWIM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART0, UART1 and I2C0 utilization and Initialization</title><link>https://devzone.nordicsemi.com/thread/350188?ContentTypeID=1</link><pubDate>Fri, 28 Jan 2022 11:57:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13b52c98-84e2-4582-8c71-afee6ac2f2ff</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/83142/using-mutiple-protocol-in-a-project"&gt;this answer&lt;/a&gt; and &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/memory/appmem.html?cp=3_0_0_4_2_0#instantiation"&gt;nRF5340 application core Peripheral instantiation&lt;/a&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>