<?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>Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89095/implementing-uarte-on-a-bluetooth-enabled-dk-ncs-v1-9-1</link><description>Hello, im trying to implement the UARTE Driver for simultaneous Use of Bluetooth and asynchrounos Uart TX/RX on a nRF52840 and nrf9160. The Problem is that neither RX or TX works. While Debugging i realised it Crashes while trying to create the TXEND</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 17 Jul 2022 08:26:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89095/implementing-uarte-on-a-bluetooth-enabled-dk-ncs-v1-9-1" /><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/377287?ContentTypeID=1</link><pubDate>Sun, 17 Jul 2022 08:26:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb14615a-46ab-49bf-85f7-f286cfbb9113</guid><dc:creator>Kriki</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;Sorry for the long wait.&lt;br /&gt;&lt;br /&gt;I have found out what i have to do to get the UARTE Driver to work with the &amp;quot;normal&amp;quot; (Zephyr based) Async Api.&lt;br /&gt;&lt;br /&gt;You dont have to implement the UARTE Driver directly you just have to enable&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONIFG_UARTE
CONFIG_UARTE_x ( where x is youre instance etc)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As for the Questions you had:&lt;br /&gt;1. Yes im very sure i build it for the NS Target it might hat something to do with the Fact that i just used a normal char buffer.&lt;br /&gt;&lt;br /&gt;2.It was identical to the other nrf91 implementation.&lt;br /&gt;&lt;br /&gt;In General the rewrite just made sure that it wasnt a weird Logic Fault or something,&lt;br /&gt;otherwise the new Code was very similar to the Codes and KConfigs i posted here earlier.&lt;br /&gt;&lt;br /&gt;This Driver also solved the Problem i had in this Ticket.&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/88947/isr-error-in-asynchronous-uart-rx-tx-crashing-zephyr-when-using-bluetooth-ncs-v1-9-1"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/88947/isr-error-in-asynchronous-uart-rx-tx-crashing-zephyr-when-using-bluetooth-ncs-v1-9-1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have my implementation here for anyone maybe having the same problem.&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/uart_5F00_drv.rar"&gt;devzone.nordicsemi.com/.../uart_5F00_drv.rar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Still thank you for your help&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/376027?ContentTypeID=1</link><pubDate>Thu, 07 Jul 2022 13:20:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e475a9b-422f-430d-bc5f-0516b8b59a4d</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For the nRF9160 case:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Are you still building the project in non secure mode? Can you share the code and prj.config for this, it seems that you&amp;#39;re using the incorrect instance.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For the nRF52840:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A bit unsure what happens with the nRF52840. Could you also share the code and prj.config file for this one?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/375126?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2022 13:41:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61d5cd99-7271-44e5-99be-9b559f65134f</guid><dc:creator>Kriki</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for this mess of a Help Request.&lt;/p&gt;
&lt;p&gt;The build from the last Error Message was the nrf52840 Build.&lt;br /&gt;That Error Message occurs when i use the KCONFIG Option&lt;/p&gt;
&lt;p&gt;CONFIG_UART_ASYNC_API=y&lt;br /&gt;CONFIG_UART_1_NRF_HW_ASYNC=y&lt;br /&gt;CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;CONFIG_NRFX_UARTE=y&lt;/p&gt;
&lt;p&gt;together. I do not know why&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I have rewritten the Applications.&lt;/p&gt;
&lt;p&gt;For the nrf52840 i use&lt;/p&gt;
&lt;p&gt;build target is nrf52840dk_nrf52840&lt;/p&gt;
&lt;div style="background-color:#272822;color:#f8f8f2;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#a6e22e;"&gt;IRQ_DIRECT_CONNECT&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;(&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;UARTE1_IRQn&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;, &lt;/span&gt;&lt;span style="color:#ae81ff;"&gt;0&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;, &lt;/span&gt;&lt;span style="color:#a6e22e;"&gt;uart_event_handler&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;, &lt;/span&gt;&lt;span style="color:#ae81ff;"&gt;0&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For the nrf9160 i use&lt;/p&gt;
&lt;p&gt;build target is nrf9160dk_nrf9160_ns&lt;/p&gt;
&lt;div style="background-color:#272822;color:#f8f8f2;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#a6e22e;"&gt;IRQ_DIRECT_CONNECT&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;(UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQn, &lt;/span&gt;&lt;span style="color:#ae81ff;"&gt;0&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;, &lt;/span&gt;&lt;span style="color:#a6e22e;"&gt;uart_event_handler&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;, &lt;/span&gt;&lt;span style="color:#ae81ff;"&gt;0&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I tried tx and rx with both devices neither complete either task.&lt;br /&gt;For the nrf52:&lt;/p&gt;
&lt;p&gt;It &amp;quot;completes&amp;quot; the tx but repeatedly calls the uart_event_handler with a unknown event code&lt;/p&gt;
&lt;p&gt;00&amp;gt; [00:00:00.378,448] &amp;lt;inf&amp;gt; main: All Initialized&lt;br /&gt;00&amp;gt; [00:00:00.378,753] &amp;lt;inf&amp;gt; app_uart: app_uart_send, length:10&lt;br /&gt;00&amp;gt; [00:00:00.379,089] &amp;lt;inf&amp;gt; app_uart: Trying to TX&lt;br /&gt;00&amp;gt; [00:00:00.380,249] &amp;lt;err&amp;gt; app_uart: Unknown Case 8669&lt;br /&gt;00&amp;gt; [00:00:00.380,584] &amp;lt;err&amp;gt; app_uart: Unknown Case 8669&lt;/p&gt;
&lt;p&gt;For the nrf92:&lt;/p&gt;
&lt;p&gt;It does not complete the Tx and hard crashes with following LOG&lt;/p&gt;
&lt;p&gt;00&amp;gt; [00:00:00.493,865] &amp;lt;inf&amp;gt; main: All Initialized&lt;br /&gt;00&amp;gt; [00:00:00.494,171] &amp;lt;inf&amp;gt; app_uart: app_uart_send, length:10&lt;br /&gt;00&amp;gt; [00:00:00.494,537] &amp;lt;inf&amp;gt; app_uart: Trying to TX&lt;br /&gt;00&amp;gt; [00:00:00.495,727] &amp;lt;err&amp;gt; os: Exception occurred in Secure State&lt;br /&gt;00&amp;gt; [00:00:00.496,093] &amp;lt;err&amp;gt; os: ***** HARD FAULT *****&lt;br /&gt;00&amp;gt; [00:00:00.496,398] &amp;lt;err&amp;gt; os:&amp;nbsp;&amp;nbsp; Fault escalation (see below)&lt;br /&gt;00&amp;gt; [00:00:00.496,765] &amp;lt;err&amp;gt; os: ***** BUS FAULT *****&lt;br /&gt;00&amp;gt; [00:00:00.497,070] &amp;lt;err&amp;gt; os:&amp;nbsp;&amp;nbsp; Precise data bus error&lt;br /&gt;00&amp;gt; [00:00:00.497,375] &amp;lt;err&amp;gt; os:&amp;nbsp;&amp;nbsp; BFAR Address: 0x50008158&lt;br /&gt;00&amp;gt; [00:00:00.497,741] &amp;lt;err&amp;gt; os: r0/a1:&amp;nbsp; 0x00000000&amp;nbsp; r1/a2:&amp;nbsp; 0x00000000&amp;nbsp; r2/a3:&amp;nbsp; 0x00000000&lt;br /&gt;00&amp;gt; [00:00:00.498,199] &amp;lt;err&amp;gt; os: r3/a4:&amp;nbsp; 0x00000000 r12/ip:&amp;nbsp; 0x00000000 r14/lr:&amp;nbsp; 0xffffffbc&lt;br /&gt;00&amp;gt; [00:00:00.498,657] &amp;lt;err&amp;gt; os:&amp;nbsp; xpsr:&amp;nbsp; 0x01000000&lt;br /&gt;00&amp;gt; [00:00:00.498,992] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00010676&lt;br /&gt;00&amp;gt; [00:00:00.499,420] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0&lt;br /&gt;00&amp;gt; [00:00:00.499,847] &amp;lt;err&amp;gt; os: Current thread: 0x2000c6b8 (unknown)&lt;/p&gt;
&lt;p&gt;If you need any other Details. Please let me know&lt;/p&gt;
&lt;p&gt;Also i dont know why but i cant reply to some of your replies.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/374682?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 08:19:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f4f7569-c290-402a-91ff-5436f3432ccd</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;You&amp;#39;re building it in non secure mode. The error log specified register 0x50008158 which points to the UARTE0 &lt;strong&gt;Secure&lt;/strong&gt; peripheral not the non secure peripheral which lies at 0x40008000. Can you double check that you&amp;#39;re using the correct instance?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/374387?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 15:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20a55564-f622-471d-b767-dc471696be0c</guid><dc:creator>Kriki</dc:creator><description>&lt;p&gt;I build using the nrf9160dk_nrfn9160_ns build target.&lt;br /&gt;Also i accidentally misclicked and verified your last reply&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/374351?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 13:20:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7442d920-fc11-4214-8ed3-bacc835bba4d</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you building it from non-secure for the nRF9160?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/373524?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 16:18:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d41347c-761f-4990-bfb2-86eccae1d61d</guid><dc:creator>Kriki</dc:creator><description>&lt;p&gt;I accidentally built it for the nrF9160 which explains why it didnt Compile.&lt;br /&gt;&lt;br /&gt;I since changed it to use &amp;quot;UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQn&amp;quot; as it seemed to be the only UARTE related Interrupt but using this crashes the 9160 with this Errorlog&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; [00:01:08.228,729] &amp;lt;err&amp;gt; os: Exception occurred in Secure State
00&amp;gt; [00:01:08.229,095] &amp;lt;err&amp;gt; os: ***** HARD FAULT *****
00&amp;gt; [00:01:08.229,431] &amp;lt;err&amp;gt; os:   Fault escalation (see below)
00&amp;gt; [00:01:08.229,797] &amp;lt;err&amp;gt; os: ***** BUS FAULT *****
00&amp;gt; [00:01:08.230,133] &amp;lt;err&amp;gt; os:   Precise data bus error
00&amp;gt; [00:01:08.230,468] &amp;lt;err&amp;gt; os:   BFAR Address: 0x50008158
00&amp;gt; [00:01:08.230,834] &amp;lt;err&amp;gt; os: r0/a1:  0x00000000  r1/a2:  0x2000d7f4  r2/a3:  0x00000000
00&amp;gt; [00:01:08.231,323] &amp;lt;err&amp;gt; os: r3/a4:  0x2000c8fc r12/ip:  0x0000000a r14/lr:  0x000106cf
00&amp;gt; [00:01:08.231,842] &amp;lt;err&amp;gt; os:  xpsr:  0x61000000
00&amp;gt; [00:01:08.232,177] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x000106ce
00&amp;gt; [00:01:08.232,635] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
00&amp;gt; [00:01:08.233,093] &amp;lt;err&amp;gt; os: Current thread: 0x2000c7a0 (unknown)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I then tried using the Zephyr Uart Driver on the nRF9160 an the UARTE Driver on the nRF52840.&lt;/p&gt;
&lt;p&gt;The Tx from 52-&amp;gt;91 works but the Tx from 91-&amp;gt;52 doesnt.&lt;/p&gt;
&lt;p&gt;Also when Tx from 52-&amp;gt;91 the Uarte Eventhandler gets called repedeatly with the Eventtype 31.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/373471?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 13:27:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a101e6c2-a66f-4cce-9d97-0b4c7eba88ed</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Is this when you build for the nRF52840 or the nRF9160? Could you share the entire error log?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/373193?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 10:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3f91750-d645-4b19-bce1-9acd13853d93</guid><dc:creator>Kriki</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;Do you by chance know which Header to include ?&lt;br /&gt;VS Code tells me that it cant find &amp;quot;UARTE1_IRQn&amp;quot; and the file you linked to isnt in the 1.9.1 version of the ncs&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/373186?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 09:28:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:899aaf91-bbcb-4ecd-a602-0564f218b665</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Good, but you also need to connect the IRQ to the handler, as in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/80862/assign-a-pwm-event-handler-gives-me-unhandled-interrupt-on-cpu-0/335001"&gt;this &lt;/a&gt;case for the PWM peripheral. You can use the &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/55305292a2a8e4149869951451311452f4566e9a/soc/nrfx_irqs_nrf52840.h#L185"&gt;UARTE1_IRQn&lt;/a&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/373183?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 09:21:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30d7e173-d395-4014-af94-f1f25b8a3f8c</guid><dc:creator>Kriki</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes i did.&lt;/p&gt;
&lt;p&gt;Here is the relevant Code&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7585.app_5F00_uart.rar"&gt;devzone.nordicsemi.com/.../7585.app_5F00_uart.rar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)</title><link>https://devzone.nordicsemi.com/thread/373181?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 09:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19d32f7e-c07c-43db-acfd-c5573f36f151</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you added a callback handler for the UARTE driver?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>