<?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>Can&amp;#39;t enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34641/can-t-enable-timer-on-nrf52840-dk</link><description>The code crashes at the 3rd line (nrfx_timer.c) 
 
 Here is my init code 
 
 I suspect this is a config problem but I can&amp;#39;t figure what it might be</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 May 2018 08:06:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34641/can-t-enable-timer-on-nrf52840-dk" /><item><title>RE: Can't enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/132905?ContentTypeID=1</link><pubDate>Wed, 23 May 2018 08:06:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfdf68a5-94df-4286-8b9c-f8b0da26b2ef</guid><dc:creator>Andre</dc:creator><description>&lt;p&gt;Have a look at the interrupt priorities of the timer and the twi. is the timer Interrupting the twi transfer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/132838?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 21:56:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5eb8b3a-8c37-4285-a04a-de02d8e7a9d0</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;it appears that the TWIM interface is stuck here (but only after that 3rd line in nrfx_timer_enable is run):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        while (!nrf_twim_event_check(p_twim, evt_to_wait))
        {
            if (nrf_twim_event_check(p_twim, NRF_TWIM_EVENT_ERROR))
            {
                NRFX_LOG_DEBUG(&amp;quot;TWIM: Event: %s.&amp;quot;, EVT_TO_STR_TWIM(NRF_TWIM_EVENT_ERROR));
                nrf_twim_event_clear(p_twim, NRF_TWIM_EVENT_ERROR);
                nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_RESUME);
                nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_STOP);
                evt_to_wait = NRF_TWIM_EVENT_STOPPED;
            }
        }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;should i try to get&amp;nbsp; TWIM to&amp;nbsp; use the scheduler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/132834?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 19:43:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9fd76d2-502d-41b8-8da8-48401125b5b4</guid><dc:creator>Andre</dc:creator><description>&lt;p&gt;And I assume it is also enabled in nrfx_config.h ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, i see a strange thing, that you use the line&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;HESA_TIMER-&amp;gt;TASKS_START = 1;&lt;/pre&gt;&lt;br /&gt;As this would be used when setting the registers manually, but in the rest of your code, you have the SDK manage it for you. Setting the hardware in some state manually might confuse the SDK code, however, as you report the error occurs in a line before this line, this would not be the cause of the issue.&lt;/p&gt;
&lt;p&gt;Also, by the code crashes, you mean you&amp;#39;re entering a HardFault? Looking at that line, getting a HardFault there would suggest you&amp;#39;re feeding the function an invalid parameter. Can you verify if the&amp;nbsp;p_instance in&amp;nbsp;nrfx_timer_enable is correct?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/132832?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 18:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3d6436b-8014-4581-afeb-6f6116d6cc70</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;further up in that same file&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define HESA_TIMER_ID 1
#define TIMER_HESA_CONFIG_IRQ_PRIORITY 6

const nrfx_timer_t hesa_timer_instance = NRFX_TIMER_INSTANCE(HESA_TIMER_ID);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/132831?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 18:15:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9588c4c0-cc0c-4252-88db-6918896a8669</guid><dc:creator>Andre</dc:creator><description>&lt;p&gt;Where and how is&amp;nbsp;hesa_timer_instance defined and initialised?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/132828?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 17:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4427c5a0-4c4f-4df0-a9b0-4fb00eed963f</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;I have the NRFX timer, the NRF timer, NRFX power, NRF power, app timer (I&amp;#39;m also using a LF timer) - anything else need to be enabled?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't enable timer on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/132827?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 17:43:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cffff9a8-da59-4a5b-bfe8-94f7d7af4740</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Have you enabled the module in sdk_config.h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>