<?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>UART function switching runtime on nRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107135/uart-function-switching-runtime-on-nrf5340</link><description>Hi, 
 In our projects, all of the digital interfaces have been assigned to different functions. 
 (2 group of I2C port with multiple sensors, 1 UART port for RS485 communication, 1 UART port for debug console) 
 But we still need one extra UART port to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Jan 2024 10:42:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107135/uart-function-switching-runtime-on-nrf5340" /><item><title>RE: UART function switching runtime on nRF5340</title><link>https://devzone.nordicsemi.com/thread/463105?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 10:42:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0785f19c-0a1f-499f-9bba-8190fb1aa644</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jacob,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Our UART peripheral hardware does support changing the GPIO pins dynamically. And I believe nrfx library support it as well. However the higher level in Zephyr still mark it as not supported.&amp;nbsp;&lt;br /&gt;We can&amp;#39;t give guarantee for something that haven&amp;#39;t fully tested.&amp;nbsp;&lt;br /&gt;But from what I can see in the code nrfx does disable UART when you suspend the device via pm.&amp;nbsp;Your&amp;nbsp;approach would work I think. But as I mentioned, it&amp;#39;s on your own to test the stability as this is not supported by Zephyr.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART function switching runtime on nRF5340</title><link>https://devzone.nordicsemi.com/thread/463043?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 01:28:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6726285-f2ab-4873-aabd-5296f9204bf8</guid><dc:creator>Jacob Lee</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;nRF-5340 only can run 4 digital interfaces simultaneously.&lt;/p&gt;
&lt;p&gt;We have assigned two I2C and two uart on different features.&lt;/p&gt;
&lt;p&gt;The digital interfaces are not enough and that&amp;#39;s why I have to use this bad way to switch uart function dynamically.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have tried it on a test program and it seems to work.&lt;/p&gt;
&lt;p&gt;The uart device is put in suspend state that means it won&amp;#39;t be running during pin switching.&lt;/p&gt;
&lt;p&gt;Then I can write the different psel into the register by&amp;nbsp;NRF_PSEL_UART.&lt;/p&gt;
&lt;p&gt;My main concern is the stability, since this approach is not officially supported by NCS.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jacob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART function switching runtime on nRF5340</title><link>https://devzone.nordicsemi.com/thread/462883?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 12:44:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:727306d3-3393-49b0-a5a9-2f84081855c0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jacob,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Could you let me know&amp;nbsp;if you have implemented your planning steps or it&amp;#39;s that you are asking if it&amp;#39;s feasible ?&amp;nbsp;&lt;br /&gt;As far as I know Zephyr doesn&amp;#39;t support pin re-configuration at run time after the peripheral has been initialized. Please take a look here:&amp;nbsp;&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/pinctrl/index.html#dynamic-pin-control"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/pinctrl/index.html#dynamic-pin-control&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;em&gt;Dynamic pin control should only be used on devices that have not been initialized. Changing pin configurations while a device is operating may lead to unexpected behavior. Since Zephyr does not support device de-initialization yet, this functionality should only be used during early boot stages.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Have you consider using an extra UART, for example UART1 on the other pins ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>