<?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>nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61725/nrf52840-nus-and-uart</link><description>Hi, 
 Iam working on a nrf52840 and trying to achieve data flow from BLE device using NUS and transfer this data through UART.Uart is configured as (TX:P1.01,RX:P1.02).Iam receiving data in 
 nus_data_handler, and expecting app_uart_put will send data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 May 2020 20:44:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61725/nrf52840-nus-and-uart" /><item><title>RE: nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/thread/252047?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 20:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5394a80-e2be-40f5-842d-3f6bbaf5e146</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again Syam,&lt;/p&gt;
&lt;p&gt;[quote user="samkrish"][/quote]&lt;/p&gt;
&lt;p&gt;Yes its a custom module.&lt;span&gt;app_uart _put&amp;nbsp; seems to be ok .yet&amp;nbsp;&amp;nbsp;to check&amp;nbsp;&amp;nbsp;ble_nus_data_send in custom device ,with NRF52840 DK,its fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please close this ticket.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Great! I am glad to hear that the issue is resolved.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to create a new ticket if you should encounter any questions or issues in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/thread/251932?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 11:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0478bbaa-fd43-485e-b626-a1f08d652eea</guid><dc:creator>syamkrishnan</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Yes its a custom module.&lt;span&gt;app_uart _put&amp;nbsp; seems to be ok .yet&amp;nbsp;&amp;nbsp;to check&amp;nbsp;&amp;nbsp;ble_nus_data_send in custom device ,with NRF52840 DK,its fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please close this ticket.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Syam&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/thread/251865?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 08:59:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db210472-e3dc-4a67-886d-1f1306e3d6aa</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Syam,&lt;/p&gt;
[quote user="samkrish"]I may not be able to change this configuration,as this is a third party hardware ,and Iam trying to create exact setup using NRF52840 DK and ESP.I will confirm it with the hardware contact regarding the pins.[/quote]
&lt;p&gt;The nRF52840 SoC allows you to configure all the pins as you would like - however there might be an issue with what pinsout are available on your third party hardware. Is it a custom module you are working with, or one from a retailer/manufacturer?&lt;/p&gt;
[quote user="samkrish"]I was not getting the app_uart _put data in the TX of receiver. Imeant &amp;quot;&lt;span&gt;I am not getting the same now&amp;quot; by this.I will do more on this by debugging.&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;I still do not understand what you are telling me here. Are you saying that when you call app_uart_put, you are not seeing anything being transmitted on the TX pin of the device? If so, could you tell me how you are reading the TX pin - are you using a Logic analyzer, is it connected to another device, or is it connected to a serial COM port terminal?&lt;br /&gt;&amp;nbsp;&lt;br /&gt;[quote user="samkrish"][/quote]&lt;/p&gt;
&lt;p&gt;&amp;quot;&amp;nbsp; TODO:&amp;quot; is for ihandshaking to ask sender to send data when connection is established function is as below.Is it&amp;nbsp; right way to do this?&lt;/p&gt;
&lt;p&gt;void SendData(void)&lt;br /&gt;{&lt;br /&gt;ret_code_t err_code ;&lt;br /&gt; NRF_LOG_INFO(&amp;quot;SENDING DATA&amp;quot;);&lt;br /&gt;char buf[6];&lt;br /&gt; snprintf(buf, sizeof(buf), &amp;quot;START&amp;quot;);&lt;br /&gt; static uint16_t length = sizeof(buf);&lt;br /&gt; err_code = ble_nus_data_send(&amp;amp;m_nus, buf, &amp;amp;length, m_conn_handle);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That depends if you using the Nordic UART central or peripheral example. The central uses the function&amp;nbsp;ble_nus_c_string_send while the peripheral example uses ble_nus_data_send.&lt;br /&gt;If you are using the peripheral example, your approach seems correct. Are you experiencing any problems or unexpected behavior when doing this?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/thread/251678?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 10:38:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86d402fd-3bd6-4f6e-8ec9-f5913e1a59ff</guid><dc:creator>syamkrishnan</dc:creator><description>&lt;p&gt;Hello Karl,&lt;/p&gt;
&lt;p&gt;I may not be able to change this configuration,as this is a third party hardware ,and Iam trying to create exact setup using NRF52840 DK and ESP.I will confirm it with the hardware contact regarding the pins.&lt;/p&gt;
&lt;p&gt;&amp;quot;&amp;nbsp; TODO:&amp;quot; is for ihandshaking to ask sender to send data when connection is established function is as below.Is it&amp;nbsp; right way to do this?&lt;/p&gt;
&lt;p&gt;void SendData(void)&lt;br /&gt;{&lt;br /&gt;ret_code_t err_code ;&lt;br /&gt; NRF_LOG_INFO(&amp;quot;SENDING DATA&amp;quot;);&lt;br /&gt;char buf[6];&lt;br /&gt; snprintf(buf, sizeof(buf), &amp;quot;START&amp;quot;);&lt;br /&gt; static uint16_t length = sizeof(buf);&lt;br /&gt; err_code = ble_nus_data_send(&amp;amp;m_nus, buf, &amp;amp;length, m_conn_handle);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;I was not getting the app_uart _put data in the TX of receiver. Imeant &amp;quot;&lt;span&gt;I am not getting the same now&amp;quot; by this.I will do more on this by debugging.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Syam&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/thread/251660?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 09:42:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e3bd528-eb33-4258-ad7c-25c623cb38e4</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Syam,&lt;/p&gt;
[quote user="samkrish"].rx_pin_no = NRF_GPIO_PIN_MAP(1, 1),&lt;br /&gt; .tx_pin_no = NRF_GPIO_PIN_MAP(1, 2),[/quote]
&lt;p&gt;Be advised that according to the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpin.html"&gt;Pin Assignment&lt;/a&gt;&amp;nbsp;P1.01 and P1.02 are designated as low-frequency(&amp;lt; 10 kHz) pins, to avoid degrading radio performance.&lt;/p&gt;
[quote user="samkrish"]Iam able to get BLE NUS data ,would like to know the&amp;nbsp;&lt;span&gt;app_uart_put(app_uart_put(p_evt-&amp;gt;params.rx_data.p_data[i]); will send the data to Uart connected device or whether it will send it to&amp;nbsp;.tx_pin_no,so that RX of receiver&amp;nbsp; will get it.Iam not getting the same now.&amp;nbsp;&lt;/span&gt;[/quote]
&lt;p&gt;The data from app_uart_put will be outputted to the Tx pin, and app_uart_get will read from the Rx pin.&lt;br /&gt;My previous comment regarding the Virtual port is only applicable if you were using the pins that are connected to the interface MCU(the default configuration).&lt;br /&gt;&lt;br /&gt;Have you made any modifications to the uart peripheral example other than what you have included above?&lt;br /&gt;I am not sure I understand what the &amp;quot;TODO&amp;quot; and &amp;quot;SendData()&amp;quot; is aimed at, but if you loopback your Tx pin to your Rx pin, then the BLE received data will be sent back to the central, without having to make a separate function for this.&lt;br /&gt;&lt;br /&gt;What do you mean by that last part, &amp;quot;I am not getting the same now&amp;quot;?&lt;br /&gt;Could you please elaborate more on what behavior you are seeing, and how it is different from what you would have expected?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/thread/251454?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 11:12:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e637177d-a88e-48fe-b0fb-856b5b3d8831</guid><dc:creator>syamkrishnan</dc:creator><description>&lt;p&gt;Iam trying to use&amp;nbsp;&amp;nbsp;Nordic peripheral example to route the incoming NUS BLE data through hardware UART for which&amp;nbsp; Iam using pin configuration as explained.&lt;/p&gt;
&lt;p&gt;.rx_pin_no = NRF_GPIO_PIN_MAP(1, 1),&lt;br /&gt; .tx_pin_no = NRF_GPIO_PIN_MAP(1, 2),&lt;/p&gt;
&lt;p&gt;Iam able to get BLE NUS data ,would like to know the&amp;nbsp;&lt;span&gt;app_uart_put(app_uart_put(p_evt-&amp;gt;params.rx_data.p_data[i]); will send the data to Uart connected device or whether it will send it to&amp;nbsp;.tx_pin_no,so that RX of receiver&amp;nbsp; will get it.Iam not getting the same now.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 NUS and UART</title><link>https://devzone.nordicsemi.com/thread/251409?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 08:46:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4da5bf63-5a25-4962-a061-f0108a9dcf1a</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Syam,&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;Iam receiving data in&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;nus_data_handler, and expecting app_uart_put will send data to TX which can be received by UART connected device&amp;nbsp;&amp;nbsp;RX.I can see that data is looping back to sender.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Please advice whether and how can I use this.[/quote]
&lt;p&gt;I am not sure I understand what you are asking me about.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From your description above, it seems to me that you are using the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_nus_c.html"&gt;Nordic UART central&lt;/a&gt; and &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_nus_eval.html"&gt;Nordic UART peripheral example&lt;/a&gt;&amp;nbsp;to successfully transfer data between two devices. Furthermore, you have connected the peripheral device in loopback mode, where the UART data received is set to be transmitted back again to the central. From your description, it sounds like the loopback test is also successful, but in that case I am not sure what you are having trouble with.&lt;br /&gt;&lt;br /&gt;Are you having trouble seeing the loopbacked data in your central device again?&lt;br /&gt;If so, please make sure that you have not opened &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/nrf52840_DK/vir_com_port.html"&gt;the virtual com port&lt;/a&gt;&amp;nbsp;on the peripheral device - because this will route the UART data to your terminal, rather than to your TX.&lt;br /&gt;&lt;br /&gt;If this is not what you are having trouble with, please elaborate on what you are attempting to do, and how the results differ from your expectations.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>