<?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>Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20681/restarted-timer-is-not-executed-for-long-time-s132</link><description>Hey, 
 SHORT VERSION: 
Timer (every Second) gets started when connecting (BLE with nRF Connect) to my DK (SDK12.2, Softdevice S132). Timer gets stopped when disconnecting. After reconnecting it takes more than 15Sec for the Timer to call the handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Mar 2017 11:17:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20681/restarted-timer-is-not-executed-for-long-time-s132" /><item><title>RE: Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/thread/80645?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 11:17:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5137d742-69a5-45ab-9c57-f488440cd347</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Yes, I agree. In ble_app_template, services_init() should be placed before advertising_init() to take into account the cases where custom UUIDs are being used. In ble_app_uart, it is done like that. I will report it for improvement internally.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know why the explicit setting for vendor specific UUIDs is removed in SDK 13, since almost all the other settings are kept. It could have been mentioned in the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fmigration.html&amp;amp;cp=4_0_0_1_7"&gt;migration note&lt;/a&gt;..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/thread/80644?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 12:10:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4edb0f71-9c66-4e71-9ed6-9050198c7037</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;Thanks. Everyting works now. But I have one question and one suggestion.In your main you do advertising_init(); and then services_init();  If you have custom uuids you adv. the other way around is better. &lt;a href="https://devzone.nordicsemi.com/question/60188/advertising-custom-service-ble_advertising_init-err_code-0x7/?answer=62373#post-id-62373"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; mentioned here. Maybe you can include that in the SDK13 examples. Or is there an explicit reason why you did it the other way around?&lt;/p&gt;
&lt;p&gt;The other part is regarding the ble_stack_init(); Took me some time, to figure out I had to explicitely set ble_cfg.common_cfg.vs_uuid_cfg.vs_uuid_count = 1; otherwise I get a NRF_ERROR_NO_MEM In  sd_ble_uuid_vs_add. In the SDK 12 example you didnt have to do that, and the code looks quite different. Is the only difference you dont get the default parameters and configure everything yourself?&lt;/p&gt;
&lt;p&gt;Thanks a lot for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/thread/80649?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 12:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:708bb5d1-ae9a-47b8-aa6f-92910486346c</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;Ok I edited my post. Thanks for your help!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/open?id=0B7DY23RhOjEkZXZsek5JWlk5cHM"&gt;drive.google.com/open&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/thread/80648?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 12:58:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:915352ee-0637-4e70-8f14-73e5bb873993</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;doesnt work one moment please Im uploading it to google drive&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/thread/80647?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 12:57:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ba22d0b-bdba-4153-85fa-48a45ae24ab4</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The project is not uploaded..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/thread/80646?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 12:55:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9d07113-3f37-4414-8b5a-31d7ceb38285</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;Hey, thanks for your answer. I ported my project to Keil, since I use Segger. Everything worked so far, but I couldn&amp;#39;t test the NRF_LOG part, because of the code Limitations. I already activated it and saved so you should be good to go. I use S132 V3.0.&lt;/p&gt;
&lt;p&gt;All I do in my code at the moment is, increase an uint32_t by one everytime the handler is called and send that as a notification.
If you disconnect and connect again it should instantly send the notifications again, sometimes it does. Today I waited over a minute one time till I got my notifications again.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/open?id=0B7DY23RhOjEkZXZsek5JWlk5cHM"&gt;drive.google.com/open&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restarted Timer is not executed for long time(S132)</title><link>https://devzone.nordicsemi.com/thread/80643?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 07:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4389b71d-48db-4c9c-b9b6-ba4875082f56</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;It should be perfectly possible to start and stop a timer upon a connect and disconnect, respectively?&lt;/p&gt;
&lt;p&gt;It would be very nice if I can see/test the code, could you upload it? Also, which version of S132 do you use?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 24.03.2017:&lt;/strong&gt; I think the problem is related to app_timer, calling the app_timer a BLE interrupt context.To call the app_timer a BLE interrupt context, the scheduler should be used. The ble_app_hids_mouse example uses the the scheduler for the battery level update, I would recommend you to take a look at it.&lt;/p&gt;
&lt;p&gt;For reference, I have attached a version of ble_app_template (SDK 13, S132 v.4.0.2), that uses the scheduler and calls app_timer in a BLE interrupt context (BLE_GAP_EVT_CONNECTED and BLE_GAP_EVT_DISCONNECTED), similar to your project: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_template_5F00_122411_5F00_devzone.zip"&gt;ble_app_template_122411_devzone.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>