<?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>nrf_drv_timer_init NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82678/nrf_drv_timer_init-nrfx_error_invalid_state</link><description>Hi, 
 I have a weird problem. My application starts two timers, one after another. Like this: 
 
 Normally it just works - no errors, nothing. However, after a DFU OTA upgrade (using NRF Tools), the application raises the NRFX_ERROR_INVALID_STATE error</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Dec 2021 15:38:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82678/nrf_drv_timer_init-nrfx_error_invalid_state" /><item><title>RE: nrf_drv_timer_init NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/343249?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 15:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cd789f7-5565-4b72-8421-e47b43539976</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;I will try to emaulate this somehow, hoever as I said, It only happens just after the update. The time I run it, it just works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_drv_timer_init NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/343186?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 13:22:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66638fb6-e0c7-47d8-b8fd-bf7359f9b5fc</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;It should be possible to set for instance a breakpoint in nrfx_timer_init() to find if it&amp;#39;s failing in the following if statement or not:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    if (p_cb-&amp;gt;state != NRFX_DRV_STATE_UNINITIALIZED)
    {
        err_code = NRFX_ERROR_INVALID_STATE;
        NRFX_LOG_WARNING(&amp;quot;Function: %s, error code: %s.&amp;quot;,
                         __func__,
                         NRFX_LOG_ERROR_STRING_GET(err_code));
        return err_code;
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_drv_timer_init NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/343145?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 12:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c67b8201-0b37-4e66-89c8-ee8e5ffa2272</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Yes, I&amp;#39;m sure it&amp;#39;s enabled. It won&amp;#39;t compile otherwise, right?&lt;/p&gt;
&lt;p&gt;Can&amp;#39;t really check exactly where it fails. If i run the debug session, it&amp;#39;s not the &amp;quot;first run after OTA update&amp;quot; and it just works :/&lt;/p&gt;
&lt;p&gt;All I know is the debug information in the RTT console (error code and line# in main)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_drv_timer_init NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/343142?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 12:10:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c60640e-81f8-4925-8c3b-8373173414da</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Are you sure you have set&amp;nbsp;TIMER4_ENABLED 1 in sdk_config.h? If it&amp;#39;s due to&amp;nbsp;NRFX_DRV_STATE_UNINITIALIZED, then I get a feeling that&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you able to find where exactly in&amp;nbsp;nrf_drv_timer_init() the&amp;nbsp;&lt;span&gt;NRFX_ERROR_INVALID_STATE is returned?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_drv_timer_init NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/343043?ContentTypeID=1</link><pubDate>Sun, 12 Dec 2021 22:46:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10dfc916-8901-4c1f-9491-c0ec6f07fe78</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;UPDATE:&amp;nbsp;The timers are defined as follows (both enabled in sdk_config:&lt;/p&gt;
&lt;p&gt;const nrf_drv_timer_t TRIAC_TIMER = NRF_DRV_TIMER_INSTANCE(1);&lt;br /&gt;const nrf_drv_timer_t LED_TIMER = NRF_DRV_TIMER_INSTANCE(3);&lt;/p&gt;
&lt;p&gt;When I changed the&amp;nbsp;&lt;span&gt;LED_TIMER&amp;nbsp;&lt;/span&gt;to 4 - it didn&amp;#39;t help. Changing it to 2 - solved the problem. Still no clue why...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>