<?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>HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board</link><description>Hi, 
 
 on my Custom Board I&amp;#39;am setting P0.12 to High triggered by a BLE notification (NUS). I&amp;#39;am here using the BLE Uart Example (S112, pca10040). The Custom Board&amp;#39;s nrf52832 DCDC Pin is not connected 
 The Problem is, that on my Custom Board the System</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Sep 2022 08:02:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board" /><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387821?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 08:02:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:042584fd-dba5-47fc-b4e6-9150fc88e6d8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I agree that it seems strange, but I can&amp;#39;t think of any other explanations at this point. The fact that the pull-up helped indicates there is a small current leak shortly after you&amp;#39;ve set the pin high.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387731?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 15:36:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:689b6feb-7ee8-4026-9252-0d4c78c9f3f1</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;could be, but I&amp;#39;m not sure.&lt;/p&gt;
&lt;p&gt;But as I said, just setting the boot0 pin on STM with P0.12 doesn&amp;#39;t trigger anything on STM side, to&amp;nbsp;start&amp;nbsp;the bootloader, where the uart from STM will be configured I need to reset the STM after setting boot0 to high..&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: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387726?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 15:17:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14294db5-5847-48e6-a18a-2b7c30796233</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Could it be that the oscilloscope probe adds enough capacitance to keep the RX line high?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387712?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 14:30:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd8f85fc-2b33-4dcc-bd61-2e9b07202522</guid><dc:creator>Buli</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387695"]This confirms that there was &amp;quot;glitch&amp;quot; on the RX line.&amp;nbsp;[/quote]
&lt;p&gt;but not according to the oscilloscope.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The issue with the frame error belongs to the uart config (the STM bootloader required a parity bit. already solved.&lt;/p&gt;
&lt;p&gt;But at the time where I set P0.12 to &amp;quot;1&amp;quot; the uart is not involved. So, why is the UART raising the&amp;nbsp;&lt;span&gt;APP_UART_COMMUNICATION_ERROR&amp;nbsp; event?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;acute;The issue is gone, but the reason is still not clear for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387695?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 12:35:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63bf38c5-32c9-4cb9-8733-5d0fc3c38c71</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;This confirms that there was &amp;quot;glitch&amp;quot; on the RX line.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Framing errors usually means you are overflowing the receive buffer, which can be avoided by either increasing the DMA buffer size, or&amp;nbsp;by enabling HW flow control.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the app uart library does not support DMA buffers &amp;gt;1 byte. If you need larger buffers you can use the&amp;nbsp;&lt;a title="Libuarte - advanced UARTE driver" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_libuarte.html?cp=8_1_3_28"&gt;Libuarte - advanced UARTE driver&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387692?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 12:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b35881eb-ab0b-4ee5-b852-c595b0ba15a7</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;The issue is resolved, but now a framing error occurs when I receive more than 1Byte (same on the DK)&lt;/p&gt;
&lt;p&gt;For me is the connection between P0.12 and the RX not clear and why a &amp;quot;1&amp;quot; has trigger an &amp;quot;break&amp;quot; condition on the RX&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387668?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 11:06:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2823c82-6e52-4957-bdee-d37ccbdc66cd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hm, that&amp;#39;s strange. Please try to add the following line right after APP_UART_FIFO_INIT() to enable the internal pull-up on the RX line and see if it makes any difference:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    ...
    APP_UART_FIFO_INIT(&amp;amp;comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);
    APP_ERROR_CHECK(err_code);
    NRF_P0-&amp;gt;PIN_CNF[RX_PIN_NUMBER] |= (GPIO_PIN_CNF_PULL_Pullup &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos);
    ...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387664?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 10:56:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6b41fb9-2cef-4dad-9d65-7a02b6b738c1</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;No activities on the RX Line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387663?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 10:51:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5781506-1a39-42db-8929-91264fd84e6f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;And is there any activity on the RX during that time? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387660?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 10:46:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18259778-910a-4560-a3f2-349f1c01232f</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;It takes&amp;nbsp;0,043sec (2752438 cycles at 64MHz)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387634?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 08:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03bac363-6d2f-40de-bfcd-754cc9c39530</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the clarification. So the APP_UART_COMMUNICATION_ERROR event is triggered when you set the P0.12 output. Have you measured how long time it takes from when P0.12 is asserted until the error event is raised?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387627?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 08:09:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65b3df57-8993-4853-a95f-cdd69987f4ad</guid><dc:creator>Buli</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387613"]&lt;blockquote class="quote"&gt;&lt;div class="quote-user"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387608"&gt;Buli said:&lt;/a&gt;&lt;/div&gt;&lt;div class="quote-content"&gt;Nothing on the UART happens here. I&amp;#39;am setting with this pin a the Bootloader PIN from STM on High.&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;Yes, but you indicated earlier that the error only happened when you configured this pin?&lt;/p&gt;[/quote]
&lt;p&gt;Not at Configuration...At the time where I set the P0.12 Pin to &amp;quot;1&amp;quot;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387613"]&lt;blockquote class="quote"&gt;&lt;div class="quote-user"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387608"&gt;Buli said:&lt;/a&gt;&lt;/div&gt;&lt;div class="quote-content"&gt;Yes, this is correct, but this this doesn&amp;#39;t come from the RX Line itself.&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;It does come from the RX line, so we have to try to narrow down the problem somehow. With the scope traces, were you able to verify if both the nrf and stm are transmitting with the correct baudrate?&lt;/p&gt;[/quote]
&lt;p&gt;The Baudrate on both are ok. The uart communication works well in both directions. As I said, at the time where I set P0.12 to &amp;quot;1&amp;quot; the error occurs. At the time where I set P0.12 to &amp;quot;1&amp;quot; nothing happens on the RX/TX lines&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387613?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 07:30:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:098280e8-99fd-4130-8fd1-b29d715bb183</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="117109" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387608"]Nothing on the UART happens here. I&amp;#39;am setting with this pin a the Bootloader PIN from STM on High.[/quote]
&lt;p&gt;Yes, but you indicated earlier that the error only happened when you configured this pin?&lt;/p&gt;
[quote userid="117109" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387608"]Yes, this is correct, but this this doesn&amp;#39;t come from the RX Line itself.[/quote]
&lt;p&gt;It does come from the RX line, so we have to try to narrow down the problem somehow. With the scope traces, were you able to verify if both the nrf and stm are transmitting with the correct baudrate?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387608?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 06:54:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11fbc265-c8c3-4603-b30e-0a7bd921dcd1</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;HI Vidar,&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387598"]The UART peripheral will raise this event when an &lt;span class="item"&gt;&lt;a class="" title="Error conditions" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uarte.html?cp=4_0_0_5_33_3#concept_fpm_qcm_wr"&gt;Error condition&lt;/a&gt; is detected on the RX pin, and from the&amp;nbsp; screenshot you posted we can see it detected a BREAK condition.&lt;/span&gt;[/quote]
&lt;p&gt;Yes, this is correct, but this this doesn&amp;#39;t come from the RX Line itself.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387598"]Does this mean the STM is powered on before the nRF has enabled the UART interface?[/quote]
&lt;p&gt;Yes, the STM is ready before the uart_init functions runs.&amp;nbsp;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387598"]&lt;blockquote class="quote"&gt;&lt;div class="quote-user"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387543"&gt;Buli said:&lt;/a&gt;&lt;/div&gt;&lt;div class="quote-content"&gt;Furthermore I don&amp;#39;t see any edges with the oscilloscope on my RX PIN when I&amp;#39;am setting P0.12 1&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;What exactly happens when you set configure P0.12? Will there be any UART communication between the nrf and stm if you don&amp;#39;t configure it?&lt;/p&gt;[/quote]
&lt;p&gt;Nothing on the UART happens here. I&amp;#39;am setting with this pin a the Bootloader PIN from STM on High.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387598?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 05:07:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e05e1e8-181b-4f32-bd8f-cd686bae6d74</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The UART peripheral will raise this event when an &lt;span class="item"&gt;&lt;a class="" title="Error conditions" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uarte.html?cp=4_0_0_5_33_3#concept_fpm_qcm_wr"&gt;Error condition&lt;/a&gt; is detected on the RX pin, and from the&amp;nbsp; screenshot you posted we can see it detected a BREAK condition. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="item"&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1663908491646v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="117109" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387543"]the nrf ist waiting for 200ms before he starts with the&amp;nbsp;second line in main() after the delay sommand.[/quote]
&lt;p&gt;Does this mean the STM is powered on before the nRF has enabled the UART interface?&lt;/p&gt;
[quote userid="117109" url="~/f/nordic-q-a/92128/hardfault-after-gpio-pin-set-to-high-on-custom-board/387543"]Furthermore I don&amp;#39;t see any edges with the oscilloscope on my RX PIN when I&amp;#39;am setting P0.12 1[/quote]
&lt;p&gt;What exactly happens when you set configure P0.12? Will there be any UART communication between the nrf and stm if you don&amp;#39;t configure it?&lt;/p&gt;
&lt;p&gt;&lt;span class="item"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387559?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 17:26:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8962bb77-e720-41eb-8c48-3b190891b1fc</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;RTS/CTS are disabled, same strange event&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387550?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 16:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0d05b21-9f2b-4cef-8d29-92b12be2993c</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Perhaps hardware bus contention with RTS or CTS pin numbers fighting against STM or other connection with incorrect polarity which can lead to a fault; check by disabling RTS and CTS pins in config&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387543?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 15:16:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fb3284b-57b7-4f68-9f70-4156ee756eb8</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;the nrf ist waiting for 200ms before he starts with the&amp;nbsp;second line in main() after the delay sommand.&lt;/p&gt;
&lt;p&gt;Furthermore I don&amp;#39;t see any edges with the oscilloscope on my RX PIN when I&amp;#39;am setting P0.12 1&lt;/p&gt;
&lt;p&gt;Therefore I&amp;#39;am wondering why and from where this event is triggered.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1663859752649v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387534?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 14:20:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb45205e-457d-41e9-b1c2-75daa3d8988a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I suggest you print a log message every time you get APP_UART_COMMUNICATION_ERROR to see how frequent it occurs. It would also be better if you could capture the packet that led to this event.&lt;/p&gt;
&lt;p&gt;I guess there may be a glitch when the STM configures its TX pin during bootup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387532?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 14:06:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46d6309e-c2cb-43be-898e-4d449425d7e3</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;#define RX_PIN_NUMBER 6&lt;br /&gt;#define TX_PIN_NUMBER 8&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void uart_init(void)
{
    uint32_t                     err_code;
    app_uart_comm_params_t const comm_params =
    {
        .rx_pin_no    = RX_PIN_NUMBER,
        .tx_pin_no    = TX_PIN_NUMBER,
        .rts_pin_no   = RTS_PIN_NUMBER,
        .cts_pin_no   = CTS_PIN_NUMBER,
        .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
        .use_parity   = false,
#if defined (UART_PRESENT)
        .baud_rate    = NRF_UART_BAUDRATE_115200
#else
        .baud_rate    = NRF_UARTE_BAUDRATE_115200
#endif
    };

    APP_UART_FIFO_INIT(&amp;amp;comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It is the code from the example. I just swapped the RX and TX Pin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With the Scope I check the RX, whether there is something happening while I set P0.12 to high, but there is nothing.&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: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387517?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 13:20:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35ad789b-9f37-44a0-8dd8-d92f1842b384</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is the pinout for your UART interface? There must be something that cause the UART to receive invalid data when you assert pin 12.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387495?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 12:19:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a7fe059-51fd-4f36-a208-c38c9caef54c</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;it&amp;#39;s not going into an error handler, and it works, but not sure why.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;most strange thing is, why the&amp;nbsp;uart_event_handle() is called, when I&amp;#39;m setting P0.12 within the&amp;nbsp;nus_data_handler() this happens only with this PIN?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387478?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 11:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd73276e-6347-4125-a488-00249566281c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you see the same if you ignore UART communications errors by commenting the APP_ERROR_HANDLER() line in APP_UART_COMMUNICATION_ERROR?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387455?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 10:35:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26bdc75c-68d1-41c7-b2f1-a23169fb5be4</guid><dc:creator>Buli</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;it was triggered by the uart event handler&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void uart_event_handle(app_uart_evt_t * p_event)
{
    static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
    static uint8_t index = 0;
    uint32_t       err_code;

    switch (p_event-&amp;gt;evt_type)
    {
        case APP_UART_DATA_READY:
            UNUSED_VARIABLE(app_uart_get(&amp;amp;data_array[index]));
            index++;

							if ((((data_array[index - 2] == &amp;#39;\n&amp;#39;) &amp;amp;&amp;amp; (data_array[index - 1] == &amp;#39;\r&amp;#39;)) ||
									(index &amp;gt;= m_ble_nus_max_data_len)) || (index&amp;gt;0 &amp;amp;&amp;amp; m_ctrl==1))
								//if(index &amp;gt;0)
							{
							 
								if((index &amp;gt;1) || (index&amp;gt;0 &amp;amp;&amp;amp; m_ctrl==1))
									{
											//NRF_LOG_DEBUG(&amp;quot;Ready to send data over BLE NUS&amp;quot;);
											//NRF_LOG_HEXDUMP_DEBUG(data_array, index);

											do
											{
													uint16_t length = ((uint16_t)index);
													err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);
													if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
															(err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
															(err_code != NRF_ERROR_NOT_FOUND))
													{
															APP_ERROR_CHECK(err_code);
													}
											} while (err_code == NRF_ERROR_RESOURCES);
									}

									index = 0;
									
							}
            break;

        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
            break;

        case APP_UART_FIFO_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
            break;

        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1663842683690v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Why this is happening, when I sent from BLE to the device? The UART shouldn&amp;#39;t be involved here.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void nus_data_handler(ble_nus_evt_t * p_evt)
{

    if (p_evt-&amp;gt;type == BLE_NUS_EVT_RX_DATA)
    {
        uint32_t err_code;

//        NRF_LOG_DEBUG(&amp;quot;Received data from BLE NUS. Writing data on UART.&amp;quot;);
//        NRF_LOG_HEXDUMP_DEBUG(p_evt-&amp;gt;params.rx_data.p_data, p_evt-&amp;gt;params.rx_data.length);

        for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.rx_data.length; i++)
        {
            do
            {
                err_code = app_uart_put(p_evt-&amp;gt;params.rx_data.p_data[i]);
                if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
                {
                    //NRF_LOG_ERROR(&amp;quot;Failed receiving NUS message. Error 0x%x. &amp;quot;, err_code);
                    APP_ERROR_CHECK(err_code);
                }
            } while (err_code == NRF_ERROR_BUSY);
        }
//        if (p_evt-&amp;gt;params.rx_data.p_data[p_evt-&amp;gt;params.rx_data.length - 1] == &amp;#39;\r&amp;#39;)
//        {
//          while (app_uart_put(&amp;#39;\n&amp;#39;) == NRF_ERROR_BUSY);
//        }
					
				
    }
		
		if (p_evt-&amp;gt;type == BLE_CTRL)
		{
			uint32_t err_code;

			
			if (p_evt-&amp;gt;params.rx_data.p_data[0]==0xFA)	
			{ // Bootloader Pattern1
				m_ctrl=1;
		  	nrf_gpio_pin_write(12, 1);
				for (uint16_t ts=0;ts&amp;lt;4000;ts++){} 
				nrf_gpio_pin_write(11, 0);
				for (uint16_t ts=0;ts&amp;lt;4000;ts++){} 
				nrf_gpio_pin_write(11, 1);
			
			}
		
						
			if (p_evt-&amp;gt;params.rx_data.p_data[0]==0xFB)	
			{ // Reset
				m_ctrl=0;
				nrf_gpio_pin_write(12, 0);
				for (uint16_t ts=0;ts&amp;lt;4000;ts++){} 
				nrf_gpio_pin_write(11, 0);
				for (uint16_t ts=0;ts&amp;lt;4000;ts++){} 
				nrf_gpio_pin_write(11, 1);
			
			}
			

				
			
		}
		

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;nrf_gpio_pin_write(12, 1); is raising the uart event handler.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;One important info, from 100 try&amp;#39;s 1-2 times works.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault after GPIO PIN set to High on Custom Board</title><link>https://devzone.nordicsemi.com/thread/387446?ContentTypeID=1</link><pubDate>Thu, 22 Sep 2022 10:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77cd6a52-b158-4f59-a7f9-ecd4db1a4c04</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;So the error is triggered in uart_event_handle, and the error code appears to be NRF_ERROR_DATA_SIZE.&lt;/p&gt;
&lt;p&gt;You can get the exact line number of where the error occurred if you build with the &amp;#39;DEBUG&amp;#39; flag enabled.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1663841418656v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>