<?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>USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41384/usb-uart-configuration-has-no-rx</link><description>We want to use nRF52840 as advanced USB - UART converter to control end device (see structure below). 
 We already checked that our end device is working fine by external USB - UART converter (just connects to RX/TX pins on our board while nRF52840 in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Dec 2018 08:05:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41384/usb-uart-configuration-has-no-rx" /><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/161119?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 08:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4c8d196-65a2-4486-acb2-f547c475e4b0</guid><dc:creator>awneil</dc:creator><description>[quote userid="75539" url="~/f/nordic-q-a/41384/usb-uart-configuration-has-no-rx/161100"]It&amp;#39;s strange that at the same time we got the RX data in buffer[/quote]
&lt;p&gt;Is it?&lt;/p&gt;
&lt;p&gt;You showed your UART configuration, and it had&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/group__nrf__uart__hal.html#ga64bc954123930f8167c2386a4dd58848" rel="noopener noreferrer" target="_blank"&gt;NRF_UART_HWFC_DISABLED&lt;/a&gt;&amp;nbsp;- so, &lt;em&gt;as far as the UART hardware is concerned&lt;/em&gt;, its hardware flow control &lt;em&gt;&lt;strong&gt;was&lt;/strong&gt;&lt;/em&gt; disabled.&lt;/p&gt;
&lt;p&gt;Therefore it is not surprising that the UART hardware &lt;em&gt;&lt;strong&gt;did&lt;/strong&gt;&lt;/em&gt; receive data.&lt;/p&gt;
&lt;p&gt;Presumably, as noted earlier, this &lt;strong&gt;HWFC&lt;/strong&gt; control must apply at some point f&lt;span&gt;urther &amp;quot;up&amp;quot; the chain - towards (or within) the USB stuff.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You could pursue that by browsing/searching for the uses of that&amp;nbsp;&lt;strong&gt;HWFC&lt;/strong&gt;&amp;nbsp;control ...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/161100?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 02:11:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fff8bfc-2a6c-4710-bb54-5c0878c5fc4a</guid><dc:creator>Vladimir RB</dc:creator><description>&lt;p&gt;We reviewed the code and found that hardwade flow control is used &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;After we changed next define we can send &amp;amp; receive data.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define HWFC           false&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s strange that at the same time we got the RX data in buffer...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/161066?ContentTypeID=1</link><pubDate>Mon, 10 Dec 2018 16:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93479ee3-41ce-455c-99bc-3daa50619cb4</guid><dc:creator>Vladimir RB</dc:creator><description>&lt;p&gt;You right, that if we received data from UART into buffer, that our problem has in another place &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Because we don&amp;#39;t change the example, we think that it should be an bug in initialization of USB UART. We still don&amp;#39;t found it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/160934?ContentTypeID=1</link><pubDate>Mon, 10 Dec 2018 10:28:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44d595e2-6a05-4c1d-92f9-5d7d95fa875a</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So you&amp;#39;re saying that you ran this in the debugger, and you &lt;em&gt;&lt;strong&gt;do&lt;/strong&gt; &lt;/em&gt;see the received data arriving in your UART handler?&lt;/p&gt;
&lt;p&gt;If so, then that does go to show that your UART and UART handler are working - so your problem lies Further &amp;quot;up&amp;quot; the chain - towards the USB stuff ...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you looked at the Segger Monitor Mode Debugging for the time-critical parts ... ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;eg,&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi"&gt;https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi&lt;/a&gt;&amp;nbsp;- and search for other discusions ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/160854?ContentTypeID=1</link><pubDate>Sun, 09 Dec 2018 17:50:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b97fd3f8-8d4f-4805-8298-94cc34496360</guid><dc:creator>Vladimir RB</dc:creator><description>&lt;p&gt;We checked our receiving handler.&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void nbiot_read(struct nrf_serial_s const * p_serial,
                       nrf_serial_event_t event)
{
    switch(event)
    {
      case NRF_SERIAL_EVENT_RX_DATA:
      {
          nrf_serial_read(&amp;amp;serial_uart, &amp;amp;NBIOT_BUF[cntas], 1, NULL, 1000);  // читаем принятый байт UART в массив NBIOT_BUF
          //size_t size = sprintf(m_tx_buffer, &amp;amp;NBIOT_BUF[cntas]);
          //if (usb_open)
          //{
              app_usbd_cdc_acm_write(&amp;amp;m_app_cdc_acm, &amp;amp;NBIOT_BUF[cntas], 1);
              //nbiot_clr_buf(); //чистим буфер
          //}
          break;
      }
      default: break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We got the message in &lt;strong&gt;NBIOT_BUF&lt;/strong&gt;.So our UART config should be correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/160853?ContentTypeID=1</link><pubDate>Sun, 09 Dec 2018 17:06:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:597aa3fc-b38c-40c1-a849-c4070828221d</guid><dc:creator>Vladimir RB</dc:creator><description>&lt;p&gt;We checked that we use correct flow and speed configuration: 9600, No Hardware flow.&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uart0_drv_config,
                      TXD_BC68, RXD_BC68,
                      NRF_UART_PSEL_DISCONNECTED, NRF_UART_PSEL_DISCONNECTED,
                      NRF_UART_HWFC_DISABLED, NRF_UART_PARITY_EXCLUDED,
                      NRF_UART_BAUDRATE_9600,
                      UART_DEFAULT_CONFIG_IRQ_PRIORITY);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="6462" url="~/f/nordic-q-a/41384/usb-uart-configuration-has-no-rx/160850"]No - each side has control of the other[/quote]
&lt;p&gt;Where we can check it? I see initialization in only one place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/160850?ContentTypeID=1</link><pubDate>Sun, 09 Dec 2018 12:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b7707fa-822b-4601-9cef-53a401897858</guid><dc:creator>awneil</dc:creator><description>[quote userid="75539" url="~/f/nordic-q-a/41384/usb-uart-configuration-has-no-rx/160849"]We doesn&amp;#39;t run the debugger because USB is the time critical protocol and it will be crashed when we going into point.[/quote]
&lt;p&gt;But you said that you have the same problem &lt;em&gt;without&lt;/em&gt; USB - so use the debugger in that case!&lt;/p&gt;
[quote userid="75539" url="~/f/nordic-q-a/41384/usb-uart-configuration-has-no-rx/160849"]We don&amp;#39;t use hardware control[/quote]
&lt;p&gt;I can see that.&lt;/p&gt;
&lt;p&gt;But have you correctly configured the UART to not use it?&lt;/p&gt;
&lt;p&gt;The Nordic examples are designed to work with the Segger VCP - and that does require it ...&lt;/p&gt;
[quote userid="75539" url="~/f/nordic-q-a/41384/usb-uart-configuration-has-no-rx/160849"]Data flow control, as I understand, affect on both RX &amp;amp; TX at the same time[/quote]
&lt;p&gt;No - each side has control of the other&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/160849?ContentTypeID=1</link><pubDate>Sun, 09 Dec 2018 11:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd2c380e-0b87-4652-bce6-c7a70522fb9a</guid><dc:creator>Vladimir RB</dc:creator><description>&lt;p&gt;We don&amp;#39;t use hardware control.&lt;/p&gt;
&lt;p&gt;We tried to connect the nRF UART directly to end device. Rusult was the same.&lt;/p&gt;
&lt;p&gt;We doesn&amp;#39;t run the debugger because USB is the time critical protocol and it will be crashed when we going into point.&lt;/p&gt;
&lt;p&gt;The main question there, as I understand, why after changing the pins we can&amp;#39;t receive the data, while we still can transfer. Data flow control, as I understand, affect on both RX &amp;amp; TX at the same time. So if we can send data, that configuration is correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&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: USB UART configuration has no RX</title><link>https://devzone.nordicsemi.com/thread/160848?ContentTypeID=1</link><pubDate>Sun, 09 Dec 2018 11:11:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8db19124-ac9a-48d6-adbe-985fc59d2db2</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Have you disabled hardware flow control?&lt;/p&gt;
&lt;p&gt;Have you tried just the nRF UART part - without any USB?&lt;/p&gt;
&lt;p&gt;Does the debugger show data being received by the nRF?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>