<?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>What should I do if a fatal error occurs when running APP_UART_FIFO_INIT?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36703/what-should-i-do-if-a-fatal-error-occurs-when-running-app_uart_fifo_init</link><description>sdk12.3.0 In the ble_app_hrs_rscs_relay example, I added the uart_init function referring to the ble_uart example, but when I execute the APP_UART_FIFO_INIT () function, a fatal error occurs. Is there a workaround?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Jul 2018 09:40:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36703/what-should-i-do-if-a-fatal-error-occurs-when-running-app_uart_fifo_init" /><item><title>RE: What should I do if a fatal error occurs when running APP_UART_FIFO_INIT?</title><link>https://devzone.nordicsemi.com/thread/141492?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 09:40:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:867bad33-4f4a-45aa-8c58-87f5de2d2c4f</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I was able to make it work by following the steps given by Petter Myhre in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19424/adding-libraries-to-ble_app_blinky-error/75434#75434"&gt;this&lt;/a&gt;&amp;nbsp;answer. First complete step 1 and 2, then in step 3&amp;nbsp;you need to do some modification to the sdk_config file&amp;nbsp;belonging to&amp;nbsp;the ble_app_hrs_rscs_relay project.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Search for APP_FIFO_ENABLED and RETARGET_ENABLED in the sdk_config file of the ble_app_uart project and copy out the parts shown below&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;q&amp;gt; APP_FIFO_ENABLED  - app_fifo - Software FIFO implementation
 

#ifndef APP_FIFO_ENABLED
#define APP_FIFO_ENABLED 1
#endif

.
.
.
.
.
.

// &amp;lt;q&amp;gt; RETARGET_ENABLED  - retarget - Retargeting stdio functions
 

#ifndef RETARGET_ENABLED
#define RETARGET_ENABLED 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then insert it into the sdk_config file of the relay project&lt;/li&gt;
&lt;li&gt;Remeber to&amp;nbsp;set APP_UART_ENABLED to 1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Add the following code to main:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;quot;app_uart.h&amp;quot;
#define UART_TX_BUF_SIZE 256                         /**&amp;lt; UART TX buffer size. */
#define UART_RX_BUF_SIZE 256                         /**&amp;lt; UART RX buffer size. */

/**@snippet [Handling the data received over UART] */
void uart_event_handle(app_uart_evt_t * p_event)
{
			//Handle the event
}

/**@brief  Function for initializing the UART module.
 */
/**@snippet [UART Initialization] */
static void uart_init(void)
{
    uint32_t                     err_code;
    const app_uart_comm_params_t comm_params =
    {
        RX_PIN_NUMBER,
        TX_PIN_NUMBER,
        RTS_PIN_NUMBER,
        CTS_PIN_NUMBER,
        APP_UART_FLOW_CONTROL_DISABLED,
        false,
        UART_BAUDRATE_BAUDRATE_Baud115200
    };

    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);
}
/**@snippet [UART Initialization] */

int main(void)
{
    uart_init();
    .
    .
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>