<?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 does not trigger his handle function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84000/app-timer-does-not-trigger-his-handle-function</link><description>Hi, I&amp;#39;m trying to implement a timer that will trigger each 10ms (for example) an handler function and do something inside it. So, I came with the idea to implement an App Timer as follow : 
 
 
 My issue is that I don&amp;#39;t read the &amp;quot;Yes&amp;quot; charachter in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jan 2022 14:53:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84000/app-timer-does-not-trigger-his-handle-function" /><item><title>RE: App Timer does not trigger his handle function</title><link>https://devzone.nordicsemi.com/thread/349588?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 14:53:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:115c5416-78bf-4e02-a16b-5cf1f81d5ebd</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Christos.Bou"]Thanks for your advice about the DEBUG ![/quote]
&lt;p&gt;No problem at all - it is a very helpful configuration - I am happy to hear that you found my advice helpful!&lt;/p&gt;
[quote user="Christos.Bou"]The issue was that I was not initializing&amp;nbsp;lfclk at the start.&lt;br /&gt;Even if I have a SoftDevice, if I do not initialize the SoftDevice I need to intialize lfclk I guess[/quote]
&lt;p&gt;I am not sure I have understood you fully here. &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/sd_resource_reqs/hw_block_interrupt_vector.html"&gt;With a SoftDevice present the clock peripherals will be restricted access&lt;/a&gt;, meaning that all clock related calls should be triggered through the SoftDevice API.&lt;br /&gt;However, in an application without the SoftDevice present you will not need to manually start and stop the LFCLK in order to use the app_timer API - it will be done as part of the app_timer initialization and usage. Could you elaborate on what you meant here?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer does not trigger his handle function</title><link>https://devzone.nordicsemi.com/thread/349494?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 10:49:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16cf9951-9f38-4b3c-b3c4-5562f823a99c</guid><dc:creator>Christos.Bou</dc:creator><description>&lt;p&gt;The issue was that I was not initializing&amp;nbsp;lfclk at the start.&lt;br /&gt;Even if I have a SoftDevice, if I do not initialize the SoftDevice I need to intialize lfclk I guess&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer does not trigger his handle function</title><link>https://devzone.nordicsemi.com/thread/349475?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 09:47:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b42f4a1-81cc-4acf-8543-2210e294814b</guid><dc:creator>Christos.Bou</dc:creator><description>&lt;p&gt;Thanks for your advice about the DEBUG !&lt;br /&gt;&lt;br /&gt;Unfortunally, adding the app_timer_init into my timer_init function didn&amp;#39;t change anything...&lt;/p&gt;
&lt;p&gt;Is there anything else that I could try to find the bug ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer does not trigger his handle function</title><link>https://devzone.nordicsemi.com/thread/349471?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 09:41:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7da562a6-b6ea-42f5-8441-2bdd21446a76</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Christos.Bou"]I&amp;#39;m using the RTT terminal because when I run the code, the debug terminal show me this :&amp;nbsp;[/quote]
&lt;p&gt;Thank you for clarifying.&lt;br /&gt;&lt;br /&gt;It seems I glanced over the code too quickly yesterday. Please add the&amp;nbsp;&lt;a title="Function for initializing the timer module." href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__app__timer.html#ga6dfeb220d038adefe101dd483c48d036"&gt;app_timer_init&lt;/a&gt;&amp;nbsp;to your timer_init function, and see if this resolves the issue.&lt;br /&gt;&lt;br /&gt;For future reference, please also add the DEBUG define to your preprocessor defines like shown in the included image:&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/3036.enabling_5F00_debug_5F00_SES.PNG" /&gt;&lt;br /&gt;This will make your logger output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer does not trigger his handle function</title><link>https://devzone.nordicsemi.com/thread/349437?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 08:22:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5caf082d-add6-4213-8a92-b7d698445a23</guid><dc:creator>Christos.Bou</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I&amp;#39;m using the RTT terminal because when I run the code, the debug terminal show me this :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1643098908148v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I just don&amp;#39;t get the &amp;quot;Yes&amp;quot; from the timer handler on the terminal and I don&amp;#39;t get why...&lt;/p&gt;
&lt;p&gt;And no, when I debug, the code seems to work as expected in an infinite loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer does not trigger his handle function</title><link>https://devzone.nordicsemi.com/thread/349360?ContentTypeID=1</link><pubDate>Mon, 24 Jan 2022 17:40:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9932a3d0-6ac6-4fe9-a9bf-028bc9470bf3</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Chris,&lt;br /&gt;&lt;br /&gt;I do not immediately see anything wrong with your use of the application timer library so I suspect that the problem actually may be with the logging.&lt;br /&gt;Which logger backend are you using?&lt;br /&gt;The&amp;nbsp;&lt;em&gt;Segger Debug Terminal&amp;nbsp;&lt;/em&gt;is an RTT terminal, so it will only show the loggings if the logger module is using the RTT backend. If you are using the UART backend you will need to use a serial terminal like Termite, PuTTy or similar to see the logs.&lt;br /&gt;Are you seeing any other unexpected behavior? Is the device resetting unexpectedly, for example?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>