<?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>nrfx timers - unhandled interrupt on CPU0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106672/nrfx-timers---unhandled-interrupt-on-cpu0</link><description>Hello, 
 I am trying to use nrfx timers from nrf v2.5.0 and I cam across a weird issue. 
 As I enable the CC interrupt a CPU fatal error happens: 
 00&amp;gt; [00:00:00.250,732] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0 00&amp;gt; [00:00:00.250</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Dec 2023 10:33:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106672/nrfx-timers---unhandled-interrupt-on-cpu0" /><item><title>RE: nrfx timers - unhandled interrupt on CPU0</title><link>https://devzone.nordicsemi.com/thread/460515?ContentTypeID=1</link><pubDate>Fri, 15 Dec 2023 10:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8f70b71-fb41-4326-b42b-92988a5c2dd4</guid><dc:creator>Marco Russi</dc:creator><description>&lt;p&gt;Thank you Jorgen, I added the following&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;IRQ_CONNECT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;DT_IRQN&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;DT_NODELABEL&lt;/span&gt;&lt;span&gt;(timer2)),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;DT_IRQ&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;DT_NODELABEL&lt;/span&gt;&lt;span&gt;(timer2), priority),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;nrfx_isr&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;nrfx_timer_2_irq_handler&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;and it is working now. I was close but not enough... :)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thanks.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfx timers - unhandled interrupt on CPU0</title><link>https://devzone.nordicsemi.com/thread/460513?ContentTypeID=1</link><pubDate>Fri, 15 Dec 2023 10:28:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8f85b64-e9ab-47c0-b190-8224521e0606</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]&lt;p&gt;I tried to add this piece od code&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;div style="max-width:100%;overflow:auto;max-height:638.4px;"&gt;&lt;div&gt;&lt;a href="#"&gt;Fullscreen&lt;/a&gt;&lt;div style="width:100%;height:14.4px;"&gt;&lt;div&gt;&lt;div style="margin-top:0;height:43.2px;width:40px;"&gt;&lt;div style="height:14.4px;"&gt;1&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="left:40px;right:0;bottom:0;"&gt;&lt;div style="margin-top:0;width:816px;height:43.2px;margin-left:0;"&gt;&lt;div&gt;&lt;div style="left:531.82px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div style="padding:0 4px;"&gt;&lt;div style="height:14.4000005722046px;"&gt;IRQ_CONNECT(TIMER2_IRQn, 0, timer2_interrupt_handler, NULL, 0);&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="left:4px;top:0;width:6.59775px;height:14.4px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;width:19px;bottom:0;"&gt;&lt;div style="width:19px;height:14.4px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;height:19px;left:40px;right:0;"&gt;&lt;div style="height:19px;width:816px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="height:auto;width:auto;top:0;left:0;white-space:pre;overflow:hidden;"&gt;&lt;div style="height:auto;width:auto;top:0;left:0;white-space:pre;overflow:visible;"&gt;&lt;/div&gt;&lt;div style="height:auto;width:auto;top:0;left:0;white-space:pre;font-style:inherit;font-size:inherit;line-height:inherit;font-family:inherit;overflow:visible;"&gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style="display:none;"&gt;IRQ_CONNECT(TIMER2_IRQn, 0, timer2_interrupt_handler, NULL, 0);&lt;/pre&gt;&lt;/div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;Since you are using the nrfx timer driver, you should connect the interrupt to the interrupt handler defined in the nrfx driver, not to the event handler in your application. The interrupt handler in the driver will check/clear the events from the peripheral and pass appropriate events to your application event handler when needed.&lt;/p&gt;
&lt;p&gt;Either use the &lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/blob/master/nrfx/drivers/include/nrfx_timer.h#L414"&gt;macro&lt;/a&gt; as shown in &lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/blob/master/nrfx/samples/src/nrfx_timer/timer/main.c#L88-L89"&gt;nrfx_timer sample in upstream Zephyr&lt;/a&gt;, or write out the name like it is done in the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1/samples/boards/nrf/nrfx/src/main.c#L42"&gt;nrfx sample in Zephyr&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>