<?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>Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50350/want-to-send-static-data-in-serial-program</link><description>I want to send static data from nrf52 to esp8266. I have used serial Program from examples. I am able to send data dynamically from the serial monitor.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Jul 2019 16:28:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50350/want-to-send-static-data-in-serial-program" /><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/201053?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 16:28:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e1ab0b4-cf7f-47b5-8bd7-ac3d81bfbe3a</guid><dc:creator>hkarthik97</dc:creator><description>&lt;p&gt;It worked now actually i kept a delay and executed the code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/200990?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 13:43:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1046f3d8-428b-4050-b4ba-8d4d572dcc2c</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So what debugging have &lt;em&gt;&lt;strong&gt;you&lt;/strong&gt; &lt;/em&gt;done to find why it works with &amp;#39;&lt;strong&gt;tx_message&lt;/strong&gt;&amp;#39;, but not with &amp;#39;&lt;strong&gt;k&lt;/strong&gt;&amp;#39; ?&lt;/p&gt;
&lt;p&gt;Are you sure that your terminal doesn&amp;#39;t depend on there being&amp;nbsp; a CR and/or LF on the end?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/200988?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 13:37:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e595a6f6-4137-4b07-ad5a-e0ac4884ca66</guid><dc:creator>hkarthik97</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
    static char tx_message[] = &amp;quot;Hello nrf_serial!\n\r&amp;quot;;
    static char k[] = &amp;quot;jio&amp;quot;;

    ret = nrf_serial_write(&amp;amp;serial_uart,
                           k,
                           strlen(k),
                           NULL,
                           NRF_SERIAL_MAX_TIMEOUT);
    APP_ERROR_CHECK(ret);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;No this part is not working I tried&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/200931?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 10:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42e42b07-4113-4df8-8b22-b0ba5806e493</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So it&amp;#39;s not &lt;strong&gt;static&lt;/strong&gt; data, then - is it?&lt;/p&gt;
&lt;p&gt;But you have the code right here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    ret = nrf_serial_write( &amp;amp;serial_uart,
                            tx_message,
                            strlen(tx_message),
                            NULL,
                            NRF_SERIAL_MAX_TIMEOUT) ;
    APP_ERROR_CHECK(ret);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;nrf_serial_write() function just sends &lt;em&gt;data&lt;/em&gt; - it neither knows nor cares where that data comes from, nor whether it is &amp;quot;static&amp;quot; or not.&lt;/p&gt;
&lt;p&gt;You just give it a pointer to (the start of) the data you want to send, and tell it the length of that data.&lt;/p&gt;
&lt;p&gt;Simples!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/200929?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 10:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90f8dcc1-562d-46c5-917f-d5e4f170fda7</guid><dc:creator>hkarthik97</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Untitled-Diagram.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the process that i want to do .&lt;/p&gt;
&lt;p&gt;I got the sensor data i want to send this data to ESP8266 how should i do that&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/200926?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 09:42:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b85c84a9-4f2e-4a2e-a594-f63eca10a0af</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Still confused!&lt;/p&gt;
&lt;p&gt;Your code shows that you &lt;em&gt;&lt;strong&gt;do&lt;/strong&gt;&lt;/em&gt; have a static string:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    static char tx_message[] = &amp;quot;Hello nrf_serial!\n\r&amp;quot;;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and your terminal screenshot seems to show that you &lt;em&gt;&lt;strong&gt;can&lt;/strong&gt;&lt;/em&gt; send it!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So I&amp;#39;m still unclear what the actual problem is!&lt;/p&gt;
&lt;p&gt;BTW&lt;/p&gt;
&lt;p&gt;Note that it is usual to have the Carriage Return (CR) &lt;em&gt;first&lt;/em&gt; - ie, &amp;quot;\r\n&amp;quot; - giving CRLF&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/200925?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 09:37:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f47898c1-3db9-4a69-831c-3d1e75e81057</guid><dc:creator>hkarthik97</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stddef.h&amp;gt;

#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_drv_clock.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_drv_power.h&amp;quot;
#include &amp;quot;nrf_serial.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;


#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;app_util.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;

/** @file
 * @defgroup nrf_serial_example main.c
 * @{
 * @ingroup nrf_serial_example
 * @brief Example of @ref nrf_serial usage. Simple loopback.
 *
 */

#define OP_QUEUES_SIZE          3
#define APP_TIMER_PRESCALER     NRF_SERIAL_APP_TIMER_PRESCALER

static void sleep_handler(void)
{
    __WFE();
    __SEV();
    __WFE();
}

NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uart0_drv_config,
                      RX_PIN_NUMBER, TX_PIN_NUMBER,
                      RTS_PIN_NUMBER, CTS_PIN_NUMBER,
                      NRF_UART_HWFC_ENABLED, NRF_UART_PARITY_EXCLUDED,
                      NRF_UART_BAUDRATE_115200,
                      UART_DEFAULT_CONFIG_IRQ_PRIORITY);

#define SERIAL_FIFO_TX_SIZE 32
#define SERIAL_FIFO_RX_SIZE 32

NRF_SERIAL_QUEUES_DEF(serial_queues, SERIAL_FIFO_TX_SIZE, SERIAL_FIFO_RX_SIZE);


#define SERIAL_BUFF_TX_SIZE 1
#define SERIAL_BUFF_RX_SIZE 1

NRF_SERIAL_BUFFERS_DEF(serial_buffs, SERIAL_BUFF_TX_SIZE, SERIAL_BUFF_RX_SIZE);

NRF_SERIAL_CONFIG_DEF(serial_config, NRF_SERIAL_MODE_IRQ,
                      &amp;amp;serial_queues, &amp;amp;serial_buffs, NULL, sleep_handler);


NRF_SERIAL_UART_DEF(serial_uart, 0);

int main(void)
{
    ret_code_t ret;

    ret = nrf_drv_clock_init();
    APP_ERROR_CHECK(ret);
    ret = nrf_drv_power_init(NULL);
    APP_ERROR_CHECK(ret);

    nrf_drv_clock_lfclk_request(NULL);
    ret = app_timer_init();
    APP_ERROR_CHECK(ret);

    // Initialize LEDs and buttons.
    bsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);

    ret = nrf_serial_init(&amp;amp;serial_uart, &amp;amp;m_uart0_drv_config, &amp;amp;serial_config);
    APP_ERROR_CHECK(ret);

    static char tx_message[] = &amp;quot;Hello nrf_serial!\n\r&amp;quot;;

    ret = nrf_serial_write(&amp;amp;serial_uart,
                           tx_message,
                           strlen(tx_message),
                           NULL,
                           NRF_SERIAL_MAX_TIMEOUT);
    APP_ERROR_CHECK(ret);

    while (true)
    {
        char c,d;
        ret = nrf_serial_read(&amp;amp;serial_uart, &amp;amp;c, sizeof(c), NULL, 1000);
        if (ret != NRF_SUCCESS)
        {
            continue;
        }
        (void)nrf_serial_write(&amp;amp;serial_uart, &amp;amp;c, sizeof(c), NULL, 0);
        (void)nrf_serial_flush(&amp;amp;serial_uart, 0);

    }
}

/** @} */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is my code i am able to send the data from nrf52 dk to esp8266 through the serial monitor&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot-2019_2D00_07_2D00_29-at-3.01.05-PM.png" /&gt;&lt;/p&gt;
&lt;p&gt;In the above image I sent a string from nrf52 to esp8266 through the serial monitor .&lt;/p&gt;
&lt;p&gt;I want to declare a static string and keep on sending it to esp8266.&lt;/p&gt;
&lt;p&gt;Eg:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am connecting a temperature sensor to nrf52 dk and I am sending the temperature data to esp8266 so that i can store it in cloud .&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to send static data in Serial Program</title><link>https://devzone.nordicsemi.com/thread/200917?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 09:20:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c539d72-3dc4-47c8-a970-df5f62d5d334</guid><dc:creator>awneil</dc:creator><description>[quote userid="77477" url="~/f/nordic-q-a/50350/want-to-send-static-data-in-serial-program"]I want to send static data from nrf52 to esp8266. [/quote]
&lt;p&gt;I don&amp;#39;t understand what you mean by that!&lt;/p&gt;
&lt;p&gt;What have you tried?&lt;/p&gt;
&lt;p&gt;Where are you stuck?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/6052._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>