<?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>App timer in mesh</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37186/app-timer-in-mesh</link><description>Hi everyone. 
 In mesh light switch example., i try to add timer0 (or any timer). 
 After initialize timer, application always jump to timeout event, and i don&amp;#39;t know why. 
 My code working perfectly in nRF SDK v15, but not working in Mesh SDK. 
 Any</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Feb 2019 08:25:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37186/app-timer-in-mesh" /><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/168991?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 08:25:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1f199b6-d5ba-42ec-a172-86056c4c6255</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;If you post this question on the case you are referring to (&lt;a href="https://devzone.nordicsemi.com/support-private/support/220698"&gt;220698&lt;/a&gt;), Bjørn will take a look at it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/168988?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 08:01:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa99e82a-27aa-4ad2-9e51-a3738697d4b8</guid><dc:creator>Nikunj Patel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;attached the above working code nrfx_timer.c file is missing.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using BLE MESH SDK3.0 I want to send data client to server based on timer every 5 second but I got and app weak error. can you help me what is the reason.&lt;/p&gt;
&lt;p&gt;if I print string every second and client send msg to server on button pressed this scenario works fine&lt;/p&gt;
&lt;p&gt;but if client send data on timer based got and app weak error.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/42338/ble-mesh-stack-3-0---message-send-on-timer-issue"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/42338/ble-mesh-stack-3-0---message-send-on-timer-issue&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Nikunj&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/154704?ContentTypeID=1</link><pubDate>Fri, 26 Oct 2018 14:40:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0f2e324-10ad-4f0a-a573-d61f443b2552</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I was preparing a long answer, to give you an intuition of how the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Ftimer.html&amp;amp;cp=2_1_0_23&amp;amp;anchor=concept_xbd_hqp_sr"&gt;TIMER peripheral&lt;/a&gt;/&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__nrfx__timer.html"&gt;TIMER driver&lt;/a&gt; works, but it seems like you found the core of the problem. However, I will provide the answer anyways:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Ftimer.html&amp;amp;cp=2_1_0_23&amp;amp;anchor=concept_xbd_hqp_sr"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the code I provided the&amp;nbsp;TIMER is in Timer mode, and in Timer mode the TIMER&amp;#39;s counter&amp;nbsp;register will be incremented for every tick generated by the timer. The TIMER peripheral also has compare registers, which can be set to a value. Then, by comparing the counter register to this value, a&amp;nbsp;COMPARE event can be triggered.&lt;/p&gt;
&lt;p&gt;But&amp;nbsp;what decides how often a tick is generated? The frequency f_timer decides this (ticks/second), which can be calculated in the following manner(if f_timer is above 1 MHz):&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-b73a80c94a4847dfbb42af6a91ce5b8c/TIMER.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;When calling&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__nrf__drv__timer.html&amp;amp;anchor=gaeae34df314565707368e374007b80df3"&gt;nrf_drv_timer_init(..)&lt;/a&gt;&amp;nbsp;the frequency will be sent in as an argument (&lt;em&gt;timer_cfg.frequency&amp;nbsp;&lt;/em&gt;in the code provided), then the PRESCALER will be set accordingly such that f_timer corresponds to that frequency.&amp;nbsp;This function requires an argument of type&amp;nbsp;&lt;em&gt;nrf_drv_timer_config_t&lt;/em&gt;, which can be set through&amp;nbsp;NRF_DRV_TIMER_DEFAULT_CONFIG, which will fetch the values used in the &lt;em&gt;sdk_config.h&amp;nbsp;&lt;/em&gt;file. Then it is important to check if&amp;nbsp; these values&amp;nbsp;is according to your needs. For example the bit width, which was the cause of your problem.&amp;nbsp;If this is not set to 32 bits, then the whole compare register wont be used, and the compare value might be different from what intended.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the next step, the following code is executed:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;time_ticks = nrf_drv_timer_ms_to_ticks(&amp;amp;TIMER_PROXY, time_ms);

nrf_drv_timer_extended_compare(&amp;amp;TIMER_PROXY,
                    NRF_TIMER_CC_CHANNEL1,
                    time_ticks,
                    NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK,
                    true);
nrf_drv_timer_enable(&amp;amp;TIMER_PROXY);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The function&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__nrf__drv__timer.html&amp;amp;anchor=ga3ab129d216fa13ea46f41b5945e0c721"&gt;nrf_drv_timer_ms_to_ticks(..)&lt;/a&gt;&amp;nbsp;will convert&amp;nbsp;milliseconds to ticks, by using the formula provided above. Then the compare register will be set to the calculated ticks through the function&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__nrf__drv__timer.html&amp;amp;anchor=ga4326e1dbd1703a0f779184543c8e12f1"&gt;nrf_drv_timer_extended_compare(..)&lt;/a&gt;. Eventually the timer is enabled through&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__nrf__drv__timer.html&amp;amp;anchor=ga7573a5092ef28e2dbc947c30a162cff6"&gt;nrf_drv_timer_enable(..)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards, Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/154635?ContentTypeID=1</link><pubDate>Fri, 26 Oct 2018 09:06:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8e632df-9662-4ef1-9e74-beef2a0b8b21</guid><dc:creator>Paulo.Zacarias</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I changed the&amp;nbsp;NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH value to 32 bit. It&amp;#39;s working fine now!&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/154580?ContentTypeID=1</link><pubDate>Thu, 25 Oct 2018 21:43:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b018518a-65da-40dd-a321-1703058f6336</guid><dc:creator>Paulo.Zacarias</dc:creator><description>&lt;p&gt;Hi Simon,&lt;br /&gt;&lt;br /&gt;I tried to change the lines as you proposed.&amp;nbsp;Still not working well.&lt;br /&gt;&lt;br /&gt;Now there is a change when I use different timeout values, but without relation with the value used.&lt;br /&gt;&lt;br /&gt;For example if I use 5000 ms the LED takes 1/2 seconds to blink, if I use 10000 ms it takes 2/3 seconds to blink, and if I use 50000 ms it doesn&amp;#39;t seem to change much from 10000 ms.&lt;/p&gt;
&lt;p&gt;Any clue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/153792?ContentTypeID=1</link><pubDate>Mon, 22 Oct 2018 12:09:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0c72534-0bd5-4d5e-8208-2fef241ecc12</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Try to swap these lines:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfx_timer_compare(&amp;amp;TIMER_PROVISION,
                    NRF_TIMER_CC_CHANNEL1,
                    time_ms,
                    true);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;With these lines:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;time_ticks = nrf_drv_timer_ms_to_ticks(&amp;amp;TIMER_PROVISION, time_ms);

nrf_drv_timer_extended_compare(&amp;amp;TIMER_PROVISION,
                    NRF_TIMER_CC_CHANNEL1,
                    time_ticks,
                    NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK,
                    true);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/153345?ContentTypeID=1</link><pubDate>Wed, 17 Oct 2018 20:02:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:822d3329-355a-46d4-a03c-90ae9fccf969</guid><dc:creator>Paulo.Zacarias</dc:creator><description>&lt;p&gt;Hi Simon,&lt;br /&gt;&lt;br /&gt;I tried to implement your code but it&amp;#39;s not working for me.&lt;br /&gt;&lt;br /&gt;No matter what value I use when calling&amp;nbsp;&lt;strong&gt;timeout_config()&lt;/strong&gt;&amp;nbsp;it always takes 3/4 seconds to change the LED status. I tried with 1000 and 10000, with absolutely no changes.&lt;br /&gt;&lt;br /&gt;Could you please tell me what could possible be wrong? I&amp;#39;m using Mesh SDK 2.1.1.&lt;br /&gt;&lt;br /&gt;Any help is much appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/143644?ContentTypeID=1</link><pubDate>Fri, 10 Aug 2018 02:16:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d9af98f-70fe-4c7a-90ed-7a195f5efa2b</guid><dc:creator>huybk213</dc:creator><description>&lt;p&gt;Thank you Simon!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/143322?ContentTypeID=1</link><pubDate>Wed, 08 Aug 2018 09:22:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0e24d3f-b785-4f10-a5bf-8008b6a64440</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I am able to make the timer work with the light switch example and the proxy_server. I have attached the working code.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-b73a80c94a4847dfbb42af6a91ce5b8c/proxy_5F00_server.rar"&gt;devzone.nordicsemi.com/.../proxy_5F00_server.rar&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/143285?ContentTypeID=1</link><pubDate>Wed, 08 Aug 2018 03:23:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae0f3d1e-ca3d-4e1c-833c-a16f76f053fd</guid><dc:creator>huybk213</dc:creator><description>&lt;p&gt;Thanks Simon.&lt;/p&gt;
&lt;p&gt;But I&amp;#39;ve try other timer, problem did not resolved. Program always jump to timer interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer in mesh</title><link>https://devzone.nordicsemi.com/thread/143055?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 14:16:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4330ceb-34bd-4860-b492-d93fa5e3fa54</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Timer 0 is required by the softdevice to ensure that the application doesn&amp;#39;t use the peripherals any longer than the radio&amp;nbsp;timeslot length, and is specified in the &lt;a href="http://infocenter.nordicsemi.com/pdf/S132_SDS_v6.0.pdf"&gt;SoftDevice Specification&lt;/a&gt;. Using timer 1 will probably solve the problem.&lt;/p&gt;
&lt;p&gt;Best regards Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>