<?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 Implementation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37776/uart-implementation</link><description>I am using Nrf52 DK as a J link programmer to program Laird BL-652 which is connected to NXP LPC 1519 via RX/TX Pins. I am trying to send commands from BL652 to NXP via UART but the BL652 is some times sending the commands and most of the time its says</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Sep 2018 01:50:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37776/uart-implementation" /><item><title>RE: UART Implementation</title><link>https://devzone.nordicsemi.com/thread/149129?ContentTypeID=1</link><pubDate>Tue, 18 Sep 2018 01:50:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0957aded-e5c4-4ce1-b1f5-b8b9a1250171</guid><dc:creator>Muzammil</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;I have tried a couple of methods to get the data back using app_uart_get() but unfortunately i am only getting is FF(form feed). Can you show me an example where we can simply get the data and print on the terminal(putty).&lt;/p&gt;
&lt;p&gt;This is one of the way I have tried to get the data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/620x240/__key/communityserver-discussions-components-files/4/1PNG.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here is the terminal output-&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2018.2.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Implementation</title><link>https://devzone.nordicsemi.com/thread/146242?ContentTypeID=1</link><pubDate>Wed, 29 Aug 2018 08:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c7c5bd1-b20c-4bff-8274-95f345fb50b8</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The&amp;nbsp;&lt;a title="UART Example" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.1.0/uart_example.html?cp=4_0_0_4_5_48"&gt;UART Example&lt;/a&gt;&amp;nbsp;in the SDK show how you can use app_uart_put/app_uart_get to transmitt and receive bytes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Implementation</title><link>https://devzone.nordicsemi.com/thread/146188?ContentTypeID=1</link><pubDate>Tue, 28 Aug 2018 23:48:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2fa6150-847b-4105-88e6-979daaeeadcb</guid><dc:creator>Muzammil</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;I have managed to use the command -? and get a response back using a different UART response call but however according to the data sheet of LPC1519 in ISP commands when i am trying to send a &amp;quot;K&amp;quot; its just echoing me back with K. Can you give an example of how can i use app_uart_get()&amp;nbsp; to get a response back&amp;nbsp; of command K/J.&lt;/p&gt;
&lt;p&gt;(k-read boot code version)&lt;/p&gt;
&lt;p&gt;Here is where i am calling and getting a response back -&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;console_putc(63);
char ch;
for (int i = 0; i &amp;lt; 200; i++)
 {
    timer_util_msec_delay(30);
   // console_putc(63);
    if (ch) console_putc(ch);    
    ch = uGetc(CONSOLE_DEV);   
 }

for (int i = 0; i &amp;lt; 20; i++)
 {console_putc(75);
    timer_util_msec_delay(50);
   // console_putc(63);
    if (ch) console_putc(ch);    
    ch = uGetc(CONSOLE_DEV);   
 }

app_uart_flush();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is the response on putty-&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/520x440/__key/communityserver-discussions-components-files/4/pastedimage1535500027881v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Implementation</title><link>https://devzone.nordicsemi.com/thread/145957?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 13:58:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bfde2f4-9a07-49a7-a22b-3b5327633c21</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I still don&amp;#39;t understand what your error is. The line &amp;#39;app_uart_put(*cmd) == &amp;quot;?&amp;quot;;&amp;#39; does not make any sense. The function will return an error code, this will not correspond to &amp;quot;?&amp;quot;. If you want to write &amp;quot;?&amp;quot; to the UART, you can use &amp;#39;app_uart_put(&amp;#39;?&amp;#39;);&amp;#39;. If you expect a response, you need to call&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.1.0/group__app__uart.html#gacddb5b7b711ef104f9eb181a13bc4503"&gt;app_uart_get&lt;/a&gt;().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Implementation</title><link>https://devzone.nordicsemi.com/thread/145788?ContentTypeID=1</link><pubDate>Sun, 26 Aug 2018 22:03:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fb29097-45be-4d16-80ad-a4c28d33ea08</guid><dc:creator>Muzammil</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;NXP LPC1519 has its own command which when asked replies whit the corresponding command, (Like when asked ? it replies back with synchronized).&lt;/p&gt;
&lt;p&gt;So i am trying to ask NXP&amp;nbsp; the commands via UART of NRF, which i am not successful at this stage. For my understanding and research I came across &lt;strong&gt;app_uart_put()&lt;/strong&gt; , which is meant to put data on the UART TX pin and &lt;strong&gt;app_uart_get() , &lt;/strong&gt;to get UART response on RX pin.&lt;/p&gt;
&lt;p&gt;And sorry for - &lt;strong&gt;&amp;quot;app_uart_put(*cmd) == &amp;quot;?&amp;quot;;&amp;nbsp; &lt;/strong&gt; I had modified the code, So here is where i had defined it-&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void send_uart(char* cmd)
{
    while(app_uart_put(*cmd) == NRF_SUCCESS)
    {
     cmd++;
   }
    
}

void nxp_flashing(void)
{
 
    ret_code_t err_code;
    int* cmd;
   char rsp[5];
    uint8_t cr, i;
    uint8_t  ch;

        console_printf(&amp;quot;NXP flashing\n&amp;quot;);
        nrf_delay_ms(1000);

        nrf_gpio_pin_clear(NXP_BOOT_PIN_NUMBER);
        nrf_gpio_pin_clear(NXP_RESET_PIN_NUMBER);
        nrf_delay_ms(1000);
        nrf_gpio_pin_set(NXP_RESET_PIN_NUMBER);
        nrf_delay_ms(3000);
        nrf_gpio_pin_set(NXP_BOOT_PIN_NUMBER);
        nrf_delay_ms(3000);
 
        board_set_console_uart_baudrate(115200);
        
         app_uart_put(*cmd) == &amp;quot;?&amp;quot;;     
         app_uart_flush(); 
 //      send_uart(cmd);
       
  //     console_printf(app_uart_get, &amp;quot;output: \n&amp;quot; );
   }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The internal connections are as below-&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/CN102.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Is there any other way to ask NXP its commands via UART.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Implementation</title><link>https://devzone.nordicsemi.com/thread/145617?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 08:11:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ce505e1-9d9a-4cd3-8839-f7784ff491f1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you provide some more details on what you mean by &amp;quot;most of the time its says error&amp;quot;?&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What says error?&lt;/li&gt;
&lt;li&gt;What is the error?&lt;/li&gt;
&lt;li&gt;What is this line supposed to do: &amp;quot;app_uart_put(*cmd) == &amp;quot;?&amp;quot;;&amp;quot;? Where is cmd set?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>