<?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 LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33057/uart-log-backend-constantly-sends-datas</link><description>Hi everyone, I have configured the LOG module to use it with the UART in view of debugging. I don&amp;#39;t send anything in my loop but the UART send constantly these data : 
 &amp;lt;info&amp;gt; uart: TX req id:2 length: 38. &amp;lt;info&amp;gt; uart: TX req id:2 length: 38. &amp;lt;info&amp;gt; uart</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Apr 2018 13:46:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33057/uart-log-backend-constantly-sends-datas" /><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127643?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 13:46:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a02dde5-7678-4946-9298-efef89241e6c</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;The behavior come from this define :&lt;/p&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;e&amp;gt; UART_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef UART_CONFIG_LOG_ENABLED
#define UART_CONFIG_LOG_ENABLED 1
#endif&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The UART CONFIG LOG need to be disable to remove the configuration info of the UART ... &lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127627?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 13:13:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42ee4991-0b6f-4636-b50c-28dd078e62e1</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;I copied my main program and the sdk_config into the &amp;quot;gpiote&amp;quot; example and I added the libraries for nrf logging and uart drv.&lt;br /&gt;&lt;br /&gt;And the result is the same behavior.&lt;br /&gt;&lt;br /&gt;Here&amp;#39;s the project :&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pin_5F00_change_5F00_int-_2D00_-copie.zip"&gt;devzone.nordicsemi.com/.../pin_5F00_change_5F00_int-_2D00_-copie.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note that I use Segger as compiler ...&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Sylvain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127623?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 12:54:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cfdd892-28e2-4092-bb0a-a2fefa9349e8</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;Do you see (&amp;quot;\r\nUART debugging is working&amp;quot;) on your hyperterminal ?&lt;/p&gt;
&lt;p&gt;Because in this example the uart logging isn&amp;#39;t configured ...&lt;/p&gt;
&lt;p&gt;My project is based on the Pin_Change example.&lt;/p&gt;
&lt;p&gt;Yes I have the same mistake on normal Run and on debug&lt;/p&gt;
&lt;p&gt;King regards,&lt;/p&gt;
&lt;p&gt;Sylvain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127618?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 12:37:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7023e55f-6714-41b4-9755-1fcaac9f364b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I copied your code into the examples/peripheral/gpiote example, and ran it on my pca10056, and I did not see anything bad in terms of reset or assertions.&lt;/p&gt;
&lt;p&gt;Does it behave like this both when debugging and when just running the example normally?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127412?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 11:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:772e6975-63d2-490d-9abf-36bed9ae7cf8</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;I&amp;#39;m using Segger Embedded Studio and the optimization level is set on &amp;quot;none&amp;quot;...&lt;/p&gt;
&lt;p&gt;here&amp;#39;s my main code :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_drv_gpiote.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;nrf_drv_timer.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_log_default_backends.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;


#define PIN_IN 33 //BUTTON_1 

#define PIN_OUT BSP_LED_0

const nrf_drv_timer_t TIMER = NRF_DRV_TIMER_INSTANCE(1);
uint8_t state = 0;
uint16_t captured_value = 0;

void in_pin_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
    state^=1;

    if (state==1){
      nrf_drv_timer_enable(&amp;amp;TIMER);
    }
    else{
      captured_value = nrf_drv_timer_capture (&amp;amp;TIMER,0);
      nrf_drv_timer_disable(&amp;amp;TIMER);
      nrf_drv_timer_clear(&amp;amp;TIMER);
    }
}

void timer_event_handler(nrf_timer_event_t event_type, void* p_context)
{
}

/**
 * @brief Function for configuring: input PIN, output PIN,
 * and configures GPIOTE to give an interrupt on pin change.
 */
static void gpio_init(void)
{
    ret_code_t err_code;

    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);

    err_code = nrf_drv_gpiote_out_init(PIN_OUT, &amp;amp;out_config);
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
    in_config.pull = NRF_GPIO_PIN_PULLUP;

    err_code = nrf_drv_gpiote_in_init(PIN_IN, &amp;amp;in_config, in_pin_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_in_event_enable(PIN_IN, true);
}

static void timer_init (void){
    
    ret_code_t err_code;

    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    err_code = nrf_drv_timer_init (&amp;amp;TIMER, &amp;amp;timer_cfg, timer_event_handler);
    APP_ERROR_CHECK(err_code);
}


int main(void)
{
    float frequency = 0.0;

    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();

    NRF_LOG_INFO(&amp;quot;\r\nUART debugging is working&amp;quot;);

    /*Macro for processing all log entries from the buffer.
    It blocks until all buffered entries are processed by the backend.*/
    NRF_LOG_FLUSH();
        
    timer_init();
    gpio_init();

    while (true)
    {
      nrf_delay_ms (500);
      frequency = 16000000/captured_value;
     // NRF_LOG_INFO(&amp;quot;Frequency: &amp;quot; NRF_LOG_FLOAT_MARKER &amp;quot; Hertz.&amp;quot;, NRF_LOG_FLOAT(frequency));
     // NRF_LOG_FLUSH();
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the support,&lt;/p&gt;
&lt;p&gt;Sylvain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127402?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 10:46:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:248390d4-7796-43fe-b799-6c42125d0e85</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Depending on what compiler/IDE you use, the optimization level is set differently. If you are using gcc+makefiles, it is set by changing from &amp;quot;-O3&amp;quot; to &amp;quot;-O0&amp;quot;. In keil, you have to enter project settings -&amp;gt; C/C++ and there&amp;#39;s a drop-down menu you can set the level to &amp;#39;0&amp;#39;.&lt;/p&gt;
&lt;p&gt;Could you post more of your code so I can have a look at what your other functions are doing?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127067?ContentTypeID=1</link><pubDate>Thu, 05 Apr 2018 13:39:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5789caf-d747-49b4-858e-c5eced9b8f7e</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;1) I&amp;#39;ve added DEBUG to the preprocessor but nothing change.&lt;/p&gt;
&lt;p&gt;2) I put a breakpoint to &amp;quot;app_error.c::app_error_handler()&amp;quot; but it is never reach&lt;/p&gt;
&lt;p&gt;3) I&amp;#39;m not sure to understand what&amp;#39;s the optimization level 0 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART LOG BACKEND constantly sends datas</title><link>https://devzone.nordicsemi.com/thread/127050?ContentTypeID=1</link><pubDate>Thu, 05 Apr 2018 12:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84e2751a-d7fd-41b5-8ce3-5b77149b162f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Looks like NRF_LOG is configured to output &amp;quot;INFO&amp;quot; level on nrf_drv_uart.c, as this info-print is present in nrf_drv_uart.c::nrf_drv_uart_tx_for_uarte().&lt;/p&gt;
&lt;p&gt;If this line is outputted continuously, it indicates that an assertion (default behavior is a soft-reset, add preprocessor define &amp;quot;DEBUG&amp;quot; to your project to enable blocking assertions) is occurring somewhere in your application.&lt;/p&gt;
&lt;p&gt;Could you try setting the optimization level to 0 and add a breakpoint in &amp;quot;app_error.c::app_error_handler()&amp;quot; to see if this hits?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>