<?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>nRF52840 interrupt causing reset</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89379/nrf52840-interrupt-causing-reset</link><description>Hello guys, 
 I&amp;#39;m trying to run uart example from https://github.com/andenore/NordicSnippets/blob/master/examples/uart/main.c extended by interrupts call after transmission end on nRF52840 Dongle . I&amp;#39;m not able to successfully make CPU to call an interrupt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jun 2022 15:13:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89379/nrf52840-interrupt-causing-reset" /><item><title>RE: nRF52840 interrupt causing reset</title><link>https://devzone.nordicsemi.com/thread/374957?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 15:13:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:979ca8b2-ef59-40d5-b7ab-a6f815155ac1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Thw Zephyr RTOS likely generates its own vector and ISR tables based on the IRQ_(DIRECT_)CONNECT macros during build-time, see &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.0.99-ncs1/include/zephyr/arch/arm/aarch32/irq.h#L106-L109"&gt;this comment&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 interrupt causing reset</title><link>https://devzone.nordicsemi.com/thread/374399?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 16:57:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f42b6048-022f-44bf-9d88-7788e7acffa0</guid><dc:creator>MarekU</dc:creator><description>&lt;p&gt;This is my whole application, I edit my post to add main.c file.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s working now! Thank you. Can you tell me, why this is working, and &amp;quot;direct api&amp;quot; is not? What&amp;#39;s the difference?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Initialize a &amp;#39;direct&amp;#39; interrupt handler.
 *
 * This routine initializes an interrupt handler for an IRQ. The IRQ must be
 * subsequently enabled via irq_enable() before the interrupt handler begins
 * servicing interrupts.
 *
 * These ISRs are designed for performance-critical interrupt handling and do
 * not go through common interrupt handling code. They must be implemented in
 * such a way that it is safe to put them directly in the vector table.  For
 * ISRs written in C, The ISR_DIRECT_DECLARE() macro will do this
 * automatically. For ISRs written in assembly it is entirely up to the
 * developer to ensure that the right steps are taken.
 *
 * This type of interrupt currently has a few limitations compared to normal
 * Zephyr interrupts:
 * - No parameters are passed to the ISR.
 * - No stack switch is done, the ISR will run on the interrupted context&amp;#39;s
 *   stack, unless the architecture automatically does the stack switch in HW.
 * - Interrupt locking state is unchanged from how the HW sets it when the ISR
 *   runs. On arches that enter ISRs with interrupts locked, they will remain
 *   locked.
 * - Scheduling decisions are now optional, controlled by the return value of
 *   ISRs implemented with the ISR_DIRECT_DECLARE() macro
 * - The call into the OS to exit power management idle state is now optional.
 *   Normal interrupts always do this before the ISR is run, but when it runs
 *   is now controlled by the placement of a ISR_DIRECT_PM() macro, or omitted
 *   entirely.
 *
 * @warning
 * Although this routine is invoked at run-time, all of its arguments must be
 * computable by the compiler at build time.
 *
 * @param irq_p IRQ line number.
 * @param priority_p Interrupt priority.
 * @param isr_p Address of interrupt service routine.
 * @param flags_p Architecture-specific IRQ configuration flags.
 */
 #define IRQ_DIRECT_CONNECT(irq_p, priority_p, isr_p, flags_p) \
	ARCH_IRQ_DIRECT_CONNECT(irq_p, priority_p, isr_p, flags_p)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s sounds like this method should be used in user code. Is that a case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 interrupt causing reset</title><link>https://devzone.nordicsemi.com/thread/374398?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 16:41:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46517495-67d6-453c-b639-8e9a017e557a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is this part of a larger application, or is this your whole application?&lt;/p&gt;
&lt;p&gt;Can you try to use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/kernel/services/interrupts.html#c.IRQ_DIRECT_CONNECT"&gt;Zephyr APIs&lt;/a&gt; to connect the interrupt to the handler?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;IRQ_DIRECT_CONNECT(UARTE0_UART0_IRQn, 6, UART0_IRQHandler, 0);
irq_enable(UARTE0_UART0_IRQn);&lt;/pre&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>