<?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>Serial communication in different modes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56583/serial-communication-in-different-modes</link><description>I&amp;#39;m implementing communication with an MCU via UART. There are two types of communication – messages, and MCU DFU data. Messages are &amp;lt;256 bytes of data. MCU DFU is &amp;gt;50kb data and is already implemented on the MCU using XModem. When a DFU start message</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Jan 2020 15:15:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56583/serial-communication-in-different-modes" /><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229675?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 15:15:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29bb7a2b-0945-4f82-b57e-09a21966248a</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;Ah yes, so it does, I got confused with the parameters. That is probably why the IRQ priority issue has gone under the radar.&lt;/p&gt;
&lt;p&gt;Calling nrf_libuarte_async_enable twice was a mistake, but the function does not check if the instance has already been enabled, so the resulting error is confusing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229671?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 15:07:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cb6674c-3567-4235-a516-ebbd0e70b7c0</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;Yes. libuarte is just what I needed, thanks. It would have saved me a lot of time if there was a summary of the different UART libraries and their intended use cases. It seems like the serial library could be deprecated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229483?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 18:27:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3f31214-f769-4044-a846-1818123dca80</guid><dc:creator>H&amp;#229;kon</dc:creator><description>&lt;p&gt;Which SDK are you using?&lt;br /&gt;In SDK 16.0.0, the example in perhipheral/libuarte uses RTC by default for timeout. The selection is done in line 60&amp;nbsp; in main.c&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NRF_LIBUARTE_ASYNC_DEFINE&lt;/span&gt;&lt;span&gt;(libuarte,&amp;nbsp;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;,&amp;nbsp;NRF_LIBUARTE_PERIPHERAL_NOT_USED,&amp;nbsp;&lt;/span&gt;&lt;span&gt;255&lt;/span&gt;&lt;span&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&gt;3&lt;/span&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;However, a timer is used as well for counting bytes.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;I was under the impression that nrf_libuarte_async_unitnit(...) would&amp;nbsp;free up all used peripherals. Did you uninitialize using this function before trying to init again?&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229479?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 17:52:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36a2482c-80a0-4e75-947a-db40c1cd5c2f</guid><dc:creator>H&amp;#229;kon</dc:creator><description>&lt;p&gt;This is strange, and needs to be looked into. Thanks for your findings so far. Does it seem to work for you now with this modification?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229476?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 17:41:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db8cb6a1-1c00-4eee-b472-5da8fbe88d00</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;It was confusing because it logged priority must be lowest 6, but the priority was 6 already. I had to change the libuarte priority to 5 (which is different from libuarte example, perhaps the example is broken as APP_TIMER_CONFIG_IRQ_PRIORITY is 6 in the example too and the example uses app_timer)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229475?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 17:38:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:442c1603-8109-4c37-868c-2f53866b076d</guid><dc:creator>H&amp;#229;kon</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;I am not sure why our SDK team has done it this way, but indeed it seems odd. &lt;br /&gt;I&amp;#39;ll forward this to them and let you know their response.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229432?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 14:02:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f72508f-ef24-4daf-9499-5bf0799488db</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;Bug report: In nrf_libuarte_async.c, line 389.&lt;/p&gt;
&lt;p&gt;Prints lowest priority as APP_IRQ_PRIORITY_LOW, but if app_timer is used then lowest priority is APP_TIMER_CONFIG_IRQ_PRIORITY - 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229431?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 14:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2a41ef5-82e2-472f-a865-652e77200b53</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;I was calling nrf_libuarte_async_enable twice, there should probably be a check in nrf_libuarte_async_enable for this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229425?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 13:46:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faf63ef0-526f-4277-adca-dac93a6f75a5</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;Is there an example using libuarte with RTC and timer instead of app timer? It&amp;#39;s hitting the ASSERT in nrfx_timer.c:143&lt;/p&gt;
&lt;p&gt;m_cb[p_instance-&amp;gt;instance_id].state == NRFX_DRV_STATE_INITIALIZED&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229313?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2020 22:32:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5939c63-c662-470b-a6e5-e26319787812</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;Thanks, I&amp;rsquo;ll have a go at this.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial communication in different modes</title><link>https://devzone.nordicsemi.com/thread/229301?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2020 20:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78eeaa66-bd27-4a91-8fe3-a8bfcc525ac2</guid><dc:creator>H&amp;#229;kon</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;To me it looks like the nrf_libuarte_async is a good fit for your use case and the MIN protocol, since messages are sent async and the MIN protocol&amp;nbsp;supports messages of different length.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am not sure I understand what you mean when you say you would like to switch to synchronous operation. To me it looks like the synchronous operation required by the XModem protocol is something that must be implemented in your application.&amp;nbsp;Since you know the&amp;nbsp;amount of bytes being sent and (N)ACKs returned it sounds like you can manage without the async timeout handling while in MCU DFU mode. It is possible to uninit the libarute_async and initialize e.g. the libarte_drv lib, then switch back to libuarte_async when done in the MCU DFU mode.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regard,&lt;br /&gt;H&amp;aring;kon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>