<?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>NRF_BREAKPOINT_COND - app_timer tutorial</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57993/nrf_breakpoint_cond---app_timer-tutorial</link><description>Hi, 
 I have performed Nordic&amp;#39;s &amp;quot;nRF52 SDK Application Timer Tutorial&amp;quot; found on this link . 
 I have followed everything step by step and have not encountered any build or link errors. 
 However, upon debugging, I encounter the NRF_BREAKPOINT_COND error</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Feb 2020 06:38:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57993/nrf_breakpoint_cond---app_timer-tutorial" /><item><title>RE: NRF_BREAKPOINT_COND - app_timer tutorial</title><link>https://devzone.nordicsemi.com/thread/235606?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 06:38:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a14e74a-f4aa-4e37-ada0-7ffa2176433b</guid><dc:creator>jdelapena</dc:creator><description>&lt;p&gt;Thank you! Seems to work now.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_BREAKPOINT_COND - app_timer tutorial</title><link>https://devzone.nordicsemi.com/thread/235406?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 10:44:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b14d5e58-dd78-46b6-9ebc-2f7ddbfea912</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The code is using the GPIOTE driver APIs to control the LED outputs without configuring any GPIOTE OUT channels first. This causes the assert check at line ~381 in nrfx_gpiote.c to fail.&amp;nbsp; I&amp;#39;m guessing that this check was not implemented in SDK 15.2.0.&lt;/p&gt;
&lt;p&gt;I suggest that you use the nrf_gpio_* functions instead as shown in the modified main.c file below. GPIOTE was not used to control the LEDs anyway.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * Copyright (c) 2014 - 2019, 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;stdbool.h&amp;gt;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;nrf_drv_gpiote.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_timer.h&amp;quot;
#include &amp;quot;nrf_drv_clock.h&amp;quot;

APP_TIMER_DEF(m_repeated_timer_id);


/**@brief Timeout event handler for the repeated timer.
 *
 */
 static void repeated_timer_1_handler(void * p_context)
 {
    nrf_gpio_pin_toggle(LED_1);
 }


/**@brief Button event handler function.
 *
 * @details Responsible for controlling LEDs based on button presses.
 */
void button_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
    ret_code_t err_code;

    switch (pin)
    {
    case BUTTON_1:
        //Start the repeated timer
        err_code = app_timer_start(m_repeated_timer_id,
                                   APP_TIMER_TICKS(200),
                                   NULL);
        APP_ERROR_CHECK(err_code);
        break;
    case BUTTON_2:
        //Stop the timer
        err_code = app_timer_stop(m_repeated_timer_id);
        APP_ERROR_CHECK(err_code);
        break;
    case BUTTON_3:
        // Turn on LED 2.
        nrf_gpio_pin_clear(LED_2);
        break;
    case BUTTON_4:
        // Turn off LED 2.
        nrf_gpio_pin_set(LED_2);
        break;
    default:
        break;
    }
}


/**@brief Function for initializing GPIO pins.
 */
static void gpio_config()
{
    ret_code_t err_code;

    // Initialize GPIOTE driver.
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);

    // Configure output pins for LEDs.
    nrf_gpio_range_cfg_output(LED_1, LED_2);

    // Set output pins (this will turn off the LEDs).
    nrf_gpio_pin_set(LED_1);
    nrf_gpio_pin_set(LED_2);

    // Make a configuration for input pints. This is suitable for both pins in this example.
    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
    in_config.pull = NRF_GPIO_PIN_PULLUP;

    // Configure input pins for 4 buttons, all using the same event handler.
    err_code = nrf_drv_gpiote_in_init(BUTTON_1, &amp;amp;in_config, button_event_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BUTTON_2, &amp;amp;in_config, button_event_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BUTTON_3, &amp;amp;in_config, button_event_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BUTTON_4, &amp;amp;in_config, button_event_handler);
    APP_ERROR_CHECK(err_code);

    // Enable input pins for buttons.
    nrf_drv_gpiote_in_event_enable(BUTTON_1, true);
    nrf_drv_gpiote_in_event_enable(BUTTON_2, true);
    nrf_drv_gpiote_in_event_enable(BUTTON_3, true);
    nrf_drv_gpiote_in_event_enable(BUTTON_4, true);
}


/**@brief Function for initializing logging.
 */
static void log_init(void)
{
    ret_code_t err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();
}

/**@brief Function for starting the internal LFCLK oscillator
          This is needed by RTC1 used by the application timer
 */
static void lfclk_request(void)
{
    ret_code_t err_code = nrf_drv_clock_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_clock_lfclk_request(NULL);
}

/**@brief Function to create a timer instance
 */
 static void create_timer()
 {
    ret_code_t err_code;

    //Create a timer
    err_code = app_timer_create(&amp;amp;m_repeated_timer_id,
                                APP_TIMER_MODE_REPEATED,
                                repeated_timer_1_handler);
    APP_ERROR_CHECK(err_code);
 }


/**@brief Main function.
 */
int main(void)
{
    lfclk_request();
    app_timer_init();
    create_timer();

    log_init();
    gpio_config();

    NRF_LOG_INFO(&amp;quot;Application timer tutorial example started.&amp;quot;);

    // Enter main loop.
    while (true)
    {
        __WFI();
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_BREAKPOINT_COND - app_timer tutorial</title><link>https://devzone.nordicsemi.com/thread/235390?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 10:09:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1262b164-6b60-41f8-bcb8-b71f219261d7</guid><dc:creator>jdelapena</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;&amp;nbsp;Please see this path for the project:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;pca10040/blank/ses/app_timer_tutorial_pca10040&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;By the way, I used the &amp;quot;nrfx_power.c&amp;quot; as the file originally added on the project does not exist on the SDK version I used (v16)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_BREAKPOINT_COND - app_timer tutorial</title><link>https://devzone.nordicsemi.com/thread/235336?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 08:19:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abbdae3a-c762-4e50-b9ae-f0765da3fc23</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which one of the projects in the attachment did you work on? The ones I tried did not compile because of missing dependencies such as app_timer.c.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>