<?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>How can I use AT COMMAND via UART on nRF52840?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54533/how-can-i-use-at-command-via-uart-on-nrf52840</link><description>Hi Devzone! 
 
 I&amp;#39;m using UART for sending AT COMMAND and receive the response from lte modem. 
 I use LM5 which is LTE modem made by m2mnet. 
 
 I thought It can be implemented by app uart, so started the project named &amp;#39;ble_app_uart&amp;#39;. 
 but when I send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Nov 2019 11:27:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54533/how-can-i-use-at-command-via-uart-on-nrf52840" /><item><title>RE: How can I use AT COMMAND via UART on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/220797?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 11:27:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a83304a2-92af-4175-a390-d04ceb211553</guid><dc:creator>zester926</dc:creator><description>&lt;p&gt;Thank you Eugene Yu!! I forgot that the size of int pointer is 4byte kk,,,, Thanks a lot!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I use AT COMMAND via UART on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/220692?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 23:50:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24221383-15d8-4400-b926-2616b31ca0fb</guid><dc:creator>Eugene Yu</dc:creator><description>&lt;p&gt;Hi Zester926,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Getting the size of data is wrong in the lm5_send().&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;data_len = sizeof(data);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You cannot get the length of array with this correctly.&amp;nbsp;It will just return 4bytes pointer size.&lt;/p&gt;
&lt;p&gt;Try to change your code as below or other way to get the size correctly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void lm5_send(uint8_t * data, uint16_t size)
{
    ret_code_t ret_val;
    
    for (uint32_t i = 0; i &amp;lt; size; i++)
    {
        do
        {
            ret_val = app_uart_put(data[i]);
            if ((ret_val != NRF_SUCCESS) &amp;amp;&amp;amp; (ret_val != NRF_ERROR_BUSY))
            {
                NRF_LOG_ERROR(&amp;quot;app_uart_put failed for index 0x%04x.&amp;quot;, i);
                APP_ERROR_CHECK(ret_val);
            }
        } while (ret_val == NRF_ERROR_BUSY);
    }
//    if (data[data_len-1] == &amp;#39;\r&amp;#39;)
//    {
//        while (app_uart_put(&amp;#39;\n&amp;#39;) == NRF_ERROR_BUSY);
//    }
}

int main(void)
{
    bool erase_bonds;
    uint8_t send_data[] = {&amp;#39;A&amp;#39;,&amp;#39;T&amp;#39;,&amp;#39;I&amp;#39;,&amp;#39;\r&amp;#39;,&amp;#39;\n&amp;#39;};
    lm5_send(send_data,sizeof(send_data));
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>