<?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>LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99344/lpuart-nrf5340-fatal-error</link><description>I&amp;#39;m working on a custom board that has an nRF9160 connected to an nRF5340 and am using NCS v2.3.0. I am able to build and run applications for both chips successfully, but LPUART is generating a fatal error on the nRF5340: 
 This error occurs when the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Jun 2023 12:53:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99344/lpuart-nrf5340-fatal-error" /><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/429300?ContentTypeID=1</link><pubDate>Mon, 05 Jun 2023 12:53:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39a75a68-ecd1-44b9-8324-7d5a7a56adf1</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-hal_nordic/blob/main/nrfx/mdk/nrf5340_application.h#L53-L114"&gt;https://github.com/nrfconnect/sdk-hal_nordic/blob/main/nrfx/mdk/nrf5340_application.h#L53-L114&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;13 is the irq number for GPIOTE0, while 47 is the irq number for GPIOTE1. There is a hard split between the two when it comes to secure and non-secure regions, where GPIOTE0 is only secure and GPIOTE1 is only non-secure.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf5340%2Fgpiote.html&amp;amp;cp=4_0_0_6_13"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf5340%2Fgpiote.html&amp;amp;cp=4_0_0_6_13&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/429061?ContentTypeID=1</link><pubDate>Fri, 02 Jun 2023 16:19:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4962603-4b62-411e-8f20-63efb643cfd0</guid><dc:creator>Chris Burns</dc:creator><description>&lt;p&gt;That change works. Now the LPUART and other GPIO interrupts work with the board_cpuapp_ns build target.&lt;/p&gt;
&lt;p&gt;Why does using interrupt 47 work when 13 didn&amp;#39;t? I don&amp;#39;t know where to find the information about how to set the GPIOTE interrupts in the DTS.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/429005?ContentTypeID=1</link><pubDate>Fri, 02 Jun 2023 12:25:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c149a91-b365-4437-838c-b676a95eeb1c</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi, can you try using 47 instead of 13 for the gpiote interrupt?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/427511?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 11:52:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad9c6638-7b8c-4cfd-bfbe-8bd336e32291</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;I have not found a configuration setup that solves the issue, but I agree that TF-M is likely the culprit. I have opened an issue internally and will keep you updated as it progresses.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/427039?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 19:23:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72935bc5-6f75-4b69-86a6-2e0d501e93f4</guid><dc:creator>Chris Burns</dc:creator><description>&lt;p&gt;I discovered that the GPIOTE ISR is called if I compile for board_cpuapp instead of board_cpuapp_ns. It seems there&amp;#39;s an issue using GPIOTE interrupts in the app and TF-M. Is there a config option to fix this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/426918?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 12:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:022b2605-d263-4c6c-a2f6-78a239b8aa97</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;I haven&amp;#39;t found a likely solution yet, unfortunately.&lt;/p&gt;
&lt;p&gt;Could you test the lpuart sample at nrf/samples/peripheral/lpuart on the nrf5340 on the custom board? Do not use the overlay in the sample, use your own overlay instead. How are the results then?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/426328?ContentTypeID=1</link><pubDate>Fri, 19 May 2023 12:48:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29e7612e-aabe-4b2b-8cdf-505271fd0e2c</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;We have been short staffed this week due to Public Holidays in Norway. I will be back on Monday with an update. I am sorry for the inconvenience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/425424?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 19:29:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c20f67a-2a07-44a0-94d0-36f16301fa44</guid><dc:creator>Chris Burns</dc:creator><description>&lt;p&gt;It looks to me like nrfx_gpiote_input_configure is called by the LPUART driver. In NCS v2.3.0 I see it called in the functions req_pin_init and rdy_pin_init.&lt;/p&gt;
&lt;p&gt;As for the pins being swapped I&amp;#39;ve already corrected that but it doesn&amp;#39;t affect the behavior.&lt;/p&gt;
&lt;p&gt;If I have the GPIOTE interrupt cell in the DTS but generate no GPIO interrupts the fatal error does not occur. The fatal error occurs when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a GPIO configured as an interrupt input,&lt;/li&gt;
&lt;li&gt;the interrupts line for GPIOTE in the DTS, and&lt;/li&gt;
&lt;li&gt;that GPIO line triggers the interrupt.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Unfortunately the board does not have 4 non-QSPI pins wired to the nRF9160. The pins I listed previously are the only ones connected between the two chips. I have tried with the REQ and RDY pins being non-QSPI pins, and with QSPI disabled in the DTS and neither changed the behavior.&lt;/p&gt;
&lt;p&gt;Changing the prj.conf to include CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=10 didn&amp;#39;t change the behavior.&lt;/p&gt;
&lt;p&gt;In case the GPIOTE IRQ wasn&amp;#39;t being connected I tried adding this line to my code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    IRQ_CONNECT(DT_IRQN(DT_NODELABEL(gpiote)),
                DT_IRQ(DT_NODELABEL(gpiote), priority),
                nrfx_isr, nrfx_gpiote_irq_handler, 0);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But it creates this build error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;gen_isr_tables.py: error: multiple registrations at table_index 13 for irq 13 (0xd)
Existing handler 0x1e063, new handler 0x1e063
Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the same irq multiple times?&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It also looks like nrfx_gpiote_irq_handler isn&amp;#39;t being called. If I add a function call to set an LED in this routine it doesn&amp;#39;t turn on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/425415?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 17:17:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:364a2cfd-8fc5-433c-8dec-ac7af6edacf8</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;I started looking into the gpiote after your latest update, apologies for not posting a response.&lt;br /&gt;How are you setting up your gpiote handlers? Could I see the code where you call nrfx_gpiote_input_configure etc.? Do you get the error if you keep the interrupts line, but never call any gpiote functions?&lt;/p&gt;
&lt;p&gt;Could you try changing the RX and TX pins to pins which are not by default qspi pins as well? &lt;br /&gt;And I assume that the pins being swapped in default vs sleep is not intentional? &lt;br /&gt;How many gpiote callbacks are you setting up? There is a config you should adjust if you require more than 2 handlers:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=2&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/424679?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 23:18:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6e53c25-933d-4914-9e1d-39031d8af5e7</guid><dc:creator>Chris Burns</dc:creator><description>&lt;p&gt;Additional info: any GPIO interrupts, even if they&amp;#39;re not related to LPUART, cause the &amp;quot;Unhandled interrupt&amp;quot; error if I have the interrupts line in gpiote in the DTS file:&lt;/p&gt;
&lt;p&gt;&amp;amp;gpiote {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = &amp;quot;okay&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interrupts = &amp;lt;13 NRF_DEFAULT_IRQ_PRIORITY&amp;gt;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;If I remove (or comment out) the interrupts line above then GPIO interrupts work normally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/423850?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 17:10:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac78bdd2-5994-4b2c-929f-c399b7c59e32</guid><dc:creator>Chris Burns</dc:creator><description>&lt;p&gt;This is on a custom board with custom board files. I created the DTS files for both the board with the nRF52840 and the board with the nRF5340.&lt;/p&gt;
&lt;p&gt;The pins wired between the two microcontrollers (on the nRF5340 side) are:&lt;/p&gt;
&lt;p&gt;0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21&lt;/p&gt;
&lt;p&gt;After your comment I checked the product spec and noticed several of these pins are dedicated QSPI pins, so I changed the DTS to set the QSPI peripheral to &amp;quot;disabled&amp;quot; (from &amp;quot;okay&amp;quot;). This didn&amp;#39;t change the result - I still get the unhandled interrupt.&lt;/p&gt;
&lt;p&gt;For another test I changed the REQ and RDY pins to be some of the ones that aren&amp;#39;t connected to QSPI. The result is the same - ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0.&lt;/p&gt;
&lt;p&gt;Again, for both of these tests the error occurs when the nRF9160 attempts to send something and it looks to be tied to the REQ pin on the nRF5340 going high.&lt;/p&gt;
&lt;p&gt;Here are the relevant sections from the DTS file:&lt;/p&gt;
&lt;p&gt;&amp;amp;gpiote {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = &amp;quot;okay&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interrupts = &amp;lt;13 NRF_DEFAULT_IRQ_PRIORITY&amp;gt;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;uart1 {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; current-speed = &amp;lt;460800&amp;gt;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; pinctrl-0 = &amp;lt;&amp;amp;lpuart_uart1_default&amp;gt;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; pinctrl-1 = &amp;lt;&amp;amp;lpuart_uart1_sleep&amp;gt;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpuart: nrf-sw-lpuart {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; compatible = &amp;quot;nordic,nrf-sw-lpuart&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; req-pin = &amp;lt;14&amp;gt;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; rdy-pin = &amp;lt;16&amp;gt;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;And in the pinctrl DTSI file:&lt;/p&gt;
&lt;p&gt;lpuart_uart1_default: lpuart_uart1_default {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; group1 {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; psels = &amp;lt;NRF_PSEL(UART_TX, 0, 13)&amp;gt;,&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;NRF_PSEL(UART_RX, 0, 15)&amp;gt;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;lpuart_uart1_sleep: lpuart_uart1_sleep {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; group1 {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; psels = &amp;lt;NRF_PSEL(UART_RX, 0, 13)&amp;gt;,&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;NRF_PSEL(UART_TX, 0, 15)&amp;gt;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; low-power-enable;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt; };&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPUART nRF5340 fatal error</title><link>https://devzone.nordicsemi.com/thread/423737?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 10:46:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56169921-9ac6-4fb2-8076-18111829b0b2</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using custom boards for these tests, or are you currently testing with DKs? &lt;br /&gt;Are you using the DK board files found in the SDK, or custom board files?&lt;br /&gt;Which pins on the nRF5340 are you using for LPUART? &lt;br /&gt;Could I see any overlay files or other changes to the devicetree you have made?&lt;/p&gt;
&lt;p&gt;My first thought is that the difference between the nRF52840 and the nRF5340 is the default setup for the pin. &lt;br /&gt;Some pins may require an extra step to be changed from their default configuration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>