<?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>combining 2 examples</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48768/combining-2-examples</link><description>Hi 
 i am using the nrf52832 dk. 
 I am trying to combine the ble_app_uart code along with the fds code using ses. 
 what are the changes i have to make in the config file of ble_app_uart. 
 Please suggest the most ideal method to combine the 2 projects</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Jun 2019 08:50:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48768/combining-2-examples" /><item><title>RE: combining 2 examples</title><link>https://devzone.nordicsemi.com/thread/194027?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2019 08:50:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf5817c0-2b4b-4b7f-9e12-ab7fa5d9e165</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Dcrossd"]the devise gets disconnected and starts advertising again.[/quote]
&lt;p&gt;This is typically the behavior when an APP_ERROR_CHECK has been hit, and DEBUG is not defined. I recommend you define DEBUG for your project (Just select the Debug build configuration if using SES) and enable logging. Then you should see the error code and location printed in the log. See &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/an-introduction-to-error-handling-in-nrf5-projects"&gt;An introduction to error handling in nRF5 projects&lt;/a&gt;&amp;nbsp;for more details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: combining 2 examples</title><link>https://devzone.nordicsemi.com/thread/193886?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2019 12:09:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f11ced2a-c408-49a3-aa79-f48ff58613f5</guid><dc:creator>Dcrossd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I made the following changes to the nus_data_handler function.&lt;/p&gt;
&lt;p&gt;the i am able to run the code, but when i send data from my phone(central) to the dk no data is sent and the devise gets disconnected and starts advertising again.&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)
{
    char wagon[20];//string i added 
    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);
        strcpy(wagon,p_evt-&amp;gt;params.rx_data.p_data);//string copy
        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);
        }
    }
    //changes i made 
    ret_code_t rc;
    nrf_fstorage_api_t * p_fs_api;
    p_fs_api = &amp;amp;nrf_fstorage_sd;
    rc = nrf_fstorage_init(&amp;amp;fstorage, p_fs_api, NULL);
    APP_ERROR_CHECK(rc);
    rc = nrf_fstorage_write(&amp;amp;fstorage, 0x3e000, wagon, strlen(wagon), NULL);
    APP_ERROR_CHECK(rc);

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;i used the function from the flash storage example&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: combining 2 examples</title><link>https://devzone.nordicsemi.com/thread/193667?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 12:26:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdec95dd-bf4d-45b0-a46b-4eb53b1f15e7</guid><dc:creator>awneil</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/48768/combining-2-examples/193636"]Modify the sdk_config.h file to enable FDS and add related configurations. Refer to the FDS example or other examples that use FDS[/quote]
&lt;p&gt;For viewing &amp;amp; modifying&amp;nbsp;&lt;span&gt;the sdk_config.h file, you can use the free Keil:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1594369804458v2.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I find this superior to the Java utility:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/47937/mesh-compilation-error/190186#190186"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/47937/mesh-compilation-error/190186#190186&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can run 2 (or more) instances of uVision to view 2&amp;nbsp;(or more) sdk_config.h files side-by-side.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The attached ZIP file contains a uVision Project for viewing &amp;amp; editing the sdk_config.h file &lt;em&gt;and nothing else&lt;/em&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simply extract the&amp;nbsp;sdk_config.uvoptx and&amp;nbsp;sdk_config.uvprojx files into the same folder as the&amp;nbsp;sdk_config.h file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/uvision_5F00_sdk_5F00_config.zip"&gt;devzone.nordicsemi.com/.../uvision_5F00_sdk_5F00_config.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;EDIT&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Added screenshot&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;EDIT 2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The above uVision Project assumes nRF52832; you will get&amp;nbsp;warning messages&amp;nbsp; if you don&amp;#39;t have its Device Pack installed. This is entirely benign, and it is completely safe to just ignore the messages - as you are not going to build any code. But it is a bit annoying.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The project below assumes a generic Cortex-M0,&amp;nbsp; which doesn&amp;#39;t require any Device Pack - so won&amp;#39;t give any messages:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/uvision_5F00_sdk_5F00_config_2D00_m0.zip"&gt;devzone.nordicsemi.com/.../uvision_5F00_sdk_5F00_config_2D00_m0.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: combining 2 examples</title><link>https://devzone.nordicsemi.com/thread/193645?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 11:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47facd56-f688-44c3-8047-92af7c7c8483</guid><dc:creator>Dcrossd</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;Yes I only need to write to the flash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: combining 2 examples</title><link>https://devzone.nordicsemi.com/thread/193636?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 11:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6e54cfe-bff9-423d-88fc-bc9fccf70986</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First of all: Do you need a filesystem (like FDS) or do you just want to write directly to flash? If you just need to write directly to flash, you can use &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fstorage.html?cp=5_1_3_56"&gt;fstorage&lt;/a&gt; instead.&lt;/p&gt;
&lt;p&gt;If you want FDS in the NUS example you can use this approach:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start with the NUS example (which use SoftDevice and is generally more complex) and add things from the FDS example as needed.&lt;/li&gt;
&lt;li&gt;Add the FDS files and include path to your project.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Add required includes and code to your main.c file.&lt;/li&gt;
&lt;li&gt;Modify the sdk_config.h file to enable FDS and add related configurations. Refer to the FDS example or other examples that use FDS.&lt;/li&gt;
&lt;li&gt;Compile the application
&lt;ol&gt;
&lt;li&gt;If there are errors or warnings, go back to pint 2 and resolve the errors before you build again. This will probably happen several times.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Test application.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note that most other BLE examples include the FDS, as it is used by the Peer manager for storing bonding information, so they can be used as a reference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>