<?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>Timer setting problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72179/timer-setting-problem</link><description>I have created file timer_init.h / c. I make the timer settings in this file and include it in main.c. I create the timers in the timers_init () function. However, the 2 timers I show below do not stop when I call app_timer_stop (). But if I define these</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Mar 2021 08:01:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72179/timer-setting-problem" /><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/297372?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 08:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5ebb81d-6632-4c13-96ef-a1e4153c2e81</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Then I&amp;#39;m not sure how you can get a&amp;nbsp;&lt;span&gt;NRF_ERROR_INVALID_STATE..&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you share a&amp;nbsp;&lt;strong&gt;minimal example&amp;nbsp;&lt;/strong&gt;that can run on the nRF52DK and will reproduce the issue?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/297213?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 13:48:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33b9624b-092a-4f5f-bc03-019826f19dac</guid><dc:creator>cemalb</dc:creator><description>&lt;p&gt;Yes, I&amp;#39;m sure&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/297057?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 08:12:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b171f5eb-4fa7-493d-b08c-c2edc81ee84b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Have you made sure that the timer has been initialized and started before you call app_timer_stop() in your code?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/296916?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 14:50:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:507f2b25-7948-4d42-b162-9305b67bcdd7</guid><dc:creator>cemalb</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;There is no problem when creating a timer with app_timer_create (). they all return the value 0x00. I guess that means NRF_SUCCESS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/296906?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 14:36:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fc5d65b-32e4-4d8e-aef5-3ecf201311c2</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;0x08 Is indeed a NRF_ERROR_INVALID STATE. &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__app__timer.html#gac1b5d0e8d96612e331952a19c83e79f8"&gt;The documentation states&lt;/a&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="1" rowspan="1"&gt;NRF_ERROR_INVALID_STATE&lt;/td&gt;
&lt;td colspan="1" rowspan="1"&gt;If the application timer module has not been initialized or the timer has not been created.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Next step would therefore be to verify that the application timer module is initialized and created in your project before you call app_timer_stop().&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/296880?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 14:13:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c60f2fd-88d8-4775-bd62-662e26aae752</guid><dc:creator>cemalb</dc:creator><description>&lt;p&gt;If I&amp;#39;m not mistaken, the code NRF_ERROR_INVALID_STATE is being returned.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I created the variable uint32_t code1,code2.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;code1 =&amp;nbsp;app_timer_stop (m_open_door_hash_value_timer_id);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;code2 =&amp;nbsp;app_timer_stop (m_open_door_timer_id);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;watched the variables. both have values 0x00000008.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/296876?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 14:06:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a8f7dcc-30c3-45f6-9110-c60c1ac107da</guid><dc:creator>cemalb</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1-)When using app_timer_stop () I was not returning err_code. After you told me, I edited my code like this:&lt;/p&gt;
&lt;p&gt;err_code = app_timer_stop(m_open_door_hash_value_timer_id); /* Stop open door hash value timer. */&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;err_code = app_timer_stop(m_open_door_timer_id); /* Stop open door timer. */&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;After doing so, the program started going to NRF_BREAKPOINT_COND. But I don&amp;#39;t know how to read the error code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2-)During compilation I get a warning like this. I guess it has nothing to do with this problem.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/bune.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;3-) I don&amp;#39;t think there is a problem in this part.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer setting problem</title><link>https://devzone.nordicsemi.com/thread/296848?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 13:14:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c680bd3c-285d-45c3-b2cf-d92246c248c3</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=uP8RYgYGRvI"&gt;Use the debugger and debug your application&lt;/a&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Does the program actually enter and return from&amp;nbsp;&lt;span&gt;app_timer_stop() without returning any errors?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Do you get any relevant warnings during compile time?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=t-kh1EbesvI"&gt;Have you included your files correctly&lt;/a&gt;?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Answering these questions would be a good start for finding the root cause &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>