<?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>HVX notification crashes when called from peripheral handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65939/hvx-notification-crashes-when-called-from-peripheral-handler</link><description>So as part of my system I have something much like the Nordic UART service in that I need to send a notification when something arrives from the UART. Mine is a little bit different from NUS as it doesn&amp;#39;t wait for a newline before sending to BLE, instead</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Sep 2020 18:18:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65939/hvx-notification-crashes-when-called-from-peripheral-handler" /><item><title>RE: HVX notification crashes when called from peripheral handler</title><link>https://devzone.nordicsemi.com/thread/269738?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 18:18:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9d30c91-0f31-46ef-857c-469f2226cb64</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;Brilliant, thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HVX notification crashes when called from peripheral handler</title><link>https://devzone.nordicsemi.com/thread/269704?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 14:34:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaab5bec-607a-44d8-b398-cec22112f2b6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, you can call&amp;nbsp;NVIC_SetPriority() to change the priority as shown below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  NRF_TIMER4-&amp;gt;TASKS_CLEAR   = 1;
  NRF_TIMER4-&amp;gt;BITMODE =     TIMER_BITMODE_BITMODE_32Bit;
  NRF_TIMER4-&amp;gt;CC[0]         = 1000;
  NRF_TIMER4-&amp;gt;SHORTS        = TIMER_SHORTS_COMPARE0_CLEAR_Msk;
  NRF_TIMER4-&amp;gt;INTENSET      = (TIMER_INTENSET_COMPARE0_Enabled &amp;lt;&amp;lt; TIMER_INTENSET_COMPARE0_Pos);
  NVIC_SetPriority(TIMER4_IRQn, 6);
  NVIC_EnableIRQ(TIMER4_IRQn);
  NRF_TIMER4-&amp;gt;TASKS_START = 1;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The default interrupt priority (reset value) is &amp;#39;0&amp;#39;, and is reserved to the Softdevice. Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HVX notification crashes when called from peripheral handler</title><link>https://devzone.nordicsemi.com/thread/269699?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 14:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33248d95-94ea-4106-a8d1-d2ff0fd5d73a</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;Hi Thanks for the quick reply..&lt;/p&gt;
&lt;p&gt;I think I do have an IRQ issue. The&amp;nbsp; UART was set to level 6 but&amp;nbsp;was overridden when calling APP_UART_FIFO_INIT. I&amp;#39;ve reset it to 6 and the UART event handler works as expected.&lt;/p&gt;
&lt;p&gt;For the timer, I&amp;#39;m currently not using the nrf drivers as the timer code was culled from an example ages ago (this project started out as a Manchester decoder) so it is setting registers directly.&lt;/p&gt;
&lt;p&gt;Is there an easy way to set the IRQ priority for timer4? I think my next task should be to rewrite the timer routines...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  NRF_TIMER4-&amp;gt;TASKS_CLEAR   = 1;
  NRF_TIMER4-&amp;gt;BITMODE =     TIMER_BITMODE_BITMODE_32Bit;
  NRF_TIMER4-&amp;gt;CC[0]         = 1000;
  NRF_TIMER4-&amp;gt;SHORTS        = TIMER_SHORTS_COMPARE0_CLEAR_Msk;
  NRF_TIMER4-&amp;gt;INTENSET      = (TIMER_INTENSET_COMPARE0_Enabled &amp;lt;&amp;lt; TIMER_INTENSET_COMPARE0_Pos);
  NVIC_EnableIRQ(TIMER4_IRQn);
  NRF_TIMER4-&amp;gt;TASKS_START = 1;
  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HVX notification crashes when called from peripheral handler</title><link>https://devzone.nordicsemi.com/thread/269570?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 08:33:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49feccb2-4026-4963-a954-2f8211082a54</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What&amp;#39;s the interrupt priority of your UART handler and timer handler? It should be fine to call the HVX function from these if you are using the default priority which is &amp;#39;6&amp;#39;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>