<?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>Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26398/can-i-use-app_timer-and-nrf_drv_timer-together</link><description>Hi, 
 I am having problems with using BLE along with gpiote and ppi for measuring the delay between two waveforms and sending the delay between them to an app using bluetooth.
I am measuring the delay using the nrf timer driver, which i&amp;#39;ve learnt that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Jul 2019 11:26:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26398/can-i-use-app_timer-and-nrf_drv_timer-together" /><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/196514?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 11:26:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0f91e60-3eb2-4295-a5d9-6023c2989391</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;ok.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/196505?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 11:03:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04be20ef-0b02-446f-8b0e-feb6b7eb3de8</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Could you please open a new devzone case? Also, could you use the Insert -&amp;gt; Insert Code functionality when you create that new case? It makes your question a lot easier to read.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/196386?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 06:21:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:691b2de3-12c8-4c95-84e8-c2e493eb29e0</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;Hello Bjorn , I am not able to solve the follwoing errors , I have included necessary c files and header files but still stuck with the following errors. Please help me with this.:&lt;/p&gt;
&lt;p&gt;Building &amp;lsquo;ble_app_uart_pca10040_s132&amp;rsquo; from solution &amp;lsquo;ble_app_uart_pca10040_s132&amp;rsquo; in configuration &amp;lsquo;Release&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;main.c&amp;rsquo;&lt;br /&gt;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/app_button.o: In function `app_button_init&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_create&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/bsp.o: In function `bsp_button_event_handler&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_start&amp;#39;&lt;br /&gt; undefined reference to `app_timer_stop&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/bsp.o: In function `bsp_led_indication&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_stop&amp;#39;&lt;br /&gt; undefined reference to `app_timer_stop&amp;#39;&lt;br /&gt; undefined reference to `app_timer_start&amp;#39;&lt;br /&gt; undefined reference to `app_timer_start&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/bsp.o: In function `bsp_init&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_create&amp;#39;&lt;br /&gt; undefined reference to `app_timer_create&amp;#39;&lt;br /&gt; undefined reference to `app_timer_create&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/main.o: In function `saadc_sampling_event_init&amp;#39;:&lt;br /&gt; undefined reference to `nrfx_timer_init&amp;#39;&lt;br /&gt; undefined reference to `nrfx_timer_extended_compare&amp;#39;&lt;br /&gt; undefined reference to `nrfx_timer_enable&amp;#39;&lt;br /&gt; undefined reference to `nrf_drv_saadc_task_address_get&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/main.o: In function `timers_init&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_init&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `conn_params_negotiation&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_start&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `on_write&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_stop&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `on_disconnect&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_stop&amp;#39;&lt;br /&gt; Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `ble_conn_params_init&amp;#39;:&lt;br /&gt; undefined reference to `app_timer_create&amp;#39;&lt;br /&gt;Build failed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/123543?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 05:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb3782d0-e67c-47c0-b902-fc6e1004db61</guid><dc:creator>Aijiapeng</dc:creator><description>&lt;p&gt;HI &lt;u&gt;&lt;span style="color:#0066cc;"&gt;fernandolns &lt;/span&gt;&lt;/u&gt;, thank you for your reply, i will try it!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/123531?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 02:15:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec96f94d-a758-4f41-b292-bbb70be55f77</guid><dc:creator>fernandolns</dc:creator><description>&lt;p&gt;Hi, sorry for taking long to answer, It&amp;#39;s been couple of months, but what I changed in order to make it work if I remember clearly was a line at main. There was a conflict with buttons and leds, then I removed it:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// buttons_leds_init(&amp;amp;erase_bonds);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(See if it works only by removing this line)&lt;/p&gt;
&lt;p&gt;(I found out by debugging)&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sure this was the problem. However I remember that I also tried changing something with the timers.&lt;/p&gt;
&lt;p&gt;Instead of channel 0, it&amp;nbsp;became channel 1 in this function being used in my main:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_drv_timer_capture_get(&amp;amp;m_timer, NRF_TIMER_CC_CHANNEL1)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;then at nrf_drv_config.h I changed this /*TIMER*/ part, to this:&lt;/p&gt;
&lt;p&gt;(changing the lines TIMER1_ENABLED 1 and &lt;span&gt;TIMER0_ENABLED 0&lt;/span&gt;)&lt;/p&gt;
&lt;p&gt;like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* TIMER */
#define TIMER0_ENABLED 0

#if (TIMER0_ENABLED == 1)
#define TIMER0_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
#define TIMER0_CONFIG_MODE         TIMER_MODE_MODE_Timer
#define TIMER0_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_32Bit
#define TIMER0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TIMER0_INSTANCE_INDEX      0
#endif

#define TIMER1_ENABLED 1

#if (TIMER1_ENABLED == 1)
#define TIMER1_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
#define TIMER1_CONFIG_MODE         TIMER_MODE_MODE_Timer
#define TIMER1_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
#define TIMER1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TIMER1_INSTANCE_INDEX      (TIMER0_ENABLED)
#endif
 
#define TIMER2_ENABLED 0

#if (TIMER2_ENABLED == 1)
#define TIMER2_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
#define TIMER2_CONFIG_MODE         TIMER_MODE_MODE_Timer
#define TIMER2_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
#define TIMER2_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TIMER2_INSTANCE_INDEX      (TIMER1_ENABLED+TIMER0_ENABLED)
#endif

#define TIMER3_ENABLED 0

#if (TIMER3_ENABLED == 1)
#define TIMER3_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
#define TIMER3_CONFIG_MODE         TIMER_MODE_MODE_Timer
#define TIMER3_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
#define TIMER3_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TIMER3_INSTANCE_INDEX      (TIMER2_ENABLED+TIMER1_ENABLED+TIMER0_ENABLED)
#endif

#define TIMER4_ENABLED 0

#if (TIMER4_ENABLED == 1)
#define TIMER4_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
#define TIMER4_CONFIG_MODE         TIMER_MODE_MODE_Timer
#define TIMER4_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
#define TIMER4_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

#define TIMER4_INSTANCE_INDEX      (TIMER3_ENABLED+TIMER2_ENABLED+TIMER1_ENABLED+TIMER0_ENABLED)
#endif


#define TIMER_COUNT (TIMER0_ENABLED+TIMER1_ENABLED+TIMER2_ENABLED+TIMER3_ENABLED+TIMER4_ENABLED)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also put this next part at nrf_drv_timer.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define TIMER0_INSTANCE_INDEX 0
#define TIMER1_INSTANCE_INDEX TIMER0_INSTANCE_INDEX+TIMER0_ENABLED
#define TIMER2_INSTANCE_INDEX TIMER1_INSTANCE_INDEX+TIMER1_ENABLED
#define TIMER3_INSTANCE_INDEX TIMER2_INSTANCE_INDEX+TIMER2_ENABLED
#define TIMER4_INSTANCE_INDEX TIMER3_INSTANCE_INDEX+TIMER3_ENABLED&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;becoming like this,&amp;nbsp;the beginnig of &lt;span&gt;nrf_drv_timer.h when adding that:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 */

/**@file
 * @addtogroup nrf_timer Timer HAL and driver
 * @ingroup    nrf_drivers
 * @brief      Timer APIs.
 * @details    The timer HAL provides basic APIs for accessing the registers
 *             of the timer. The timer driver provides APIs on a higher level.
 *
 * @defgroup   lib_driver_timer Timer driver
 * @{
 * @ingroup    nrf_timer
 * @brief      Multi-instance timer driver.
 */

#ifndef NRF_DRV_TIMER_H__
#define NRF_DRV_TIMER_H__

#include &amp;quot;nordic_common.h&amp;quot;
#include &amp;quot;nrf_drv_config.h&amp;quot;
#include &amp;quot;nrf_timer.h&amp;quot;
#include &amp;quot;sdk_errors.h&amp;quot;
#include &amp;quot;nrf_assert.h&amp;quot;

/**
 * @brief Timer driver instance data structure.
 */
typedef struct
{
    NRF_TIMER_Type * p_reg;            ///&amp;lt; Pointer to the structure with TIMER peripheral instance registers.
    uint8_t          instance_id;      ///&amp;lt; Driver instance index.
    uint8_t          cc_channel_count; ///&amp;lt; Number of capture/compare channels.
} nrf_drv_timer_t;

#define ENABLED_TIMER_COUNT (TIMER0_ENABLED+TIMER1_ENABLED+TIMER2_ENABLED+TIMER3_ENABLED+TIMER4_ENABLED)

#define TIMER0_INSTANCE_INDEX 0
#define TIMER1_INSTANCE_INDEX TIMER0_INSTANCE_INDEX+TIMER0_ENABLED
#define TIMER2_INSTANCE_INDEX TIMER1_INSTANCE_INDEX+TIMER1_ENABLED
#define TIMER3_INSTANCE_INDEX TIMER2_INSTANCE_INDEX+TIMER2_ENABLED
#define TIMER4_INSTANCE_INDEX TIMER3_INSTANCE_INDEX+TIMER3_ENABLED


/**
 * @brief Macro for creating a timer driver instance.
 */&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/122567?ContentTypeID=1</link><pubDate>Fri, 02 Mar 2018 08:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc6f70b5-0fdd-4ac6-99e8-cca20368c2d0</guid><dc:creator>Aijiapeng</dc:creator><description>&lt;p&gt;HI &lt;u&gt;&lt;span style="color:#0066cc;"&gt;fernandolns &lt;/span&gt;&lt;/u&gt;, i had the same problem as you ,could you tell me how to resolve it ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/103883?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 08:03:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34808c99-aec0-4fe3-9662-39b52eae1d72</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;cool! great to hear!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/103881?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2017 13:56:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54acd0c8-9846-4e97-bcdf-4e3e928ca550</guid><dc:creator>fernandolns</dc:creator><description>&lt;p&gt;the issue of the timers has been resolved, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/103882?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2017 13:12:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fb06b4b-4b5e-4709-9660-1f74758b12ed</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;So do you still have any issues with this or has the question been resolved?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/103884?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 17:43:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48056cff-d7cc-4cf0-9d41-113f5984ad09</guid><dc:creator>fernandolns</dc:creator><description>&lt;p&gt;I debbuged the code, and apparently the problem lies at &lt;code&gt;gpiote_init&lt;/code&gt; it seens like some sort of conflict, this where the 4 leds turn on, and it doens&amp;#39;t call any timer. I also managed to make the timers work by changing some of them, because of some conflicts with the softdevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use app_timer and nrf_drv_timer together?</title><link>https://devzone.nordicsemi.com/thread/103880?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 10:05:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fff2e148-31d1-42bc-b970-59f72f5dd1f9</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;What kind of error messages are you getting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>