<?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>Using nrf52840 to try to add dfu service in the hrs example failed (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46061/using-nrf52840-to-try-to-add-dfu-service-in-the-hrs-example-failed-sdk15-3-0</link><description>hello ,everyone, 
 I want to add the dfu service to the hrs example, but after I follow the step by step guide operation, I import the (settings+softdevice+bootloader+app) hybrid file into nrf52840. My phone does not receive his Bluetooth signal (even</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Apr 2019 09:38:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46061/using-nrf52840-to-try-to-add-dfu-service-in-the-hrs-example-failed-sdk15-3-0" /><item><title>RE: Using nrf52840 to try to add dfu service in the hrs example failed (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/182042?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 09:38:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aec73f25-c822-4b2b-8fe1-f6585a3d9914</guid><dc:creator>zhong</dc:creator><description>&lt;p&gt;hello,I have tried a lot about your advice,and now there is my problem.&lt;/p&gt;
&lt;p&gt;1.stopped by vector catch&lt;/p&gt;
&lt;p&gt;I set the breakpoint and debugging ,it&amp;#39;s the screen shot.&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/6560.problem.png" /&gt;&lt;/p&gt;
&lt;p&gt;and the variable &amp;#39;p_app_ram_start&amp;#39; shows that &amp;quot;not found&amp;#39;, and then I change the address the terminal emulator,like the image.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/terminal-emulator.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I want to see the RAM address I need to modify in it, but I haven&amp;#39;t seen anything. How can I solve these two problems? This is my code (main.c and sdkconfig.h), and build and run are not reporting errors.&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/5076.main.c"&gt;devzone.nordicsemi.com/.../5076.main.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1832.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../1832.sdk_5F00_config.h&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrf52840 to try to add dfu service in the hrs example failed (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/181751?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 06:18:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:409a89c5-478d-4839-8d43-cfd73efffc76</guid><dc:creator>zhong</dc:creator><description>&lt;p&gt;I think my problem may be that I don&amp;#39;t know how to configure RAM memory after adding a service. Where can I configure the memory through the serial port? Similar to the following example: &amp;lt;warning&amp;gt; nrf_sdh_ble: RAM starts at 0x200020E0, can be adjusted to 0x200020F0.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_sdh_ble: RAM size can be adjusted to 0xDF10.&lt;br /&gt;&amp;lt;error&amp;gt; nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrf52840 to try to add dfu service in the hrs example failed (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/181739?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 04:44:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32b146a9-bc09-4854-acb8-2fd1afd82502</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Thanks for the detailed explanation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you built the debug the application?&lt;/p&gt;
&lt;p&gt;You should be able to see how much RAM you need to allocate to the SoftDevice by examining the&amp;nbsp;p_app_ram_start variable in&amp;nbsp;nrf_sdh_ble_enable() which is called in&amp;nbsp;ble_stack_init().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t nrf_sdh_ble_enable(uint32_t * const p_app_ram_start)
{
    // Start of RAM, obtained from linker symbol.
    uint32_t const app_ram_start_link = *p_app_ram_start;

    ret_code_t ret_code = sd_ble_enable(p_app_ram_start);
    if (*p_app_ram_start &amp;gt; app_ram_start_link)
    {
        NRF_LOG_WARNING(&amp;quot;Insufficient RAM allocated for the SoftDevice.&amp;quot;);

        NRF_LOG_WARNING(&amp;quot;Change the RAM start location from 0x%x to 0x%x.&amp;quot;,
                        app_ram_start_link, *p_app_ram_start);
        NRF_LOG_WARNING(&amp;quot;Maximum RAM size for application is 0x%x.&amp;quot;,
                        ram_end_address_get() - (*p_app_ram_start));
    }
    else
    {
        NRF_LOG_DEBUG(&amp;quot;RAM starts at 0x%x&amp;quot;, app_ram_start_link);
        if (*p_app_ram_start != app_ram_start_link)
        {
            NRF_LOG_DEBUG(&amp;quot;RAM start location can be adjusted to 0x%x.&amp;quot;, *p_app_ram_start);

            NRF_LOG_DEBUG(&amp;quot;RAM size for application can be adjusted to 0x%x.&amp;quot;,
                          ram_end_address_get() - (*p_app_ram_start));
        }
    }

    if (ret_code == NRF_SUCCESS)
    {
        m_stack_is_enabled = true;
    }
    else
    {
        NRF_LOG_ERROR(&amp;quot;sd_ble_enable() returned %s.&amp;quot;, nrf_strerror_get(ret_code));
    }

    return ret_code;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To get the LOG output you need to make sure that&amp;nbsp;NRF_LOG_ENABLED in sdk_config.h is set to 1. You also need to set which backend to use by setting either&amp;nbsp;NRF_LOG_BACKEND_RTT_ENABLED or&amp;nbsp;NRF_LOG_BACKEND_UART_ENABLED to 1.&lt;/p&gt;
&lt;p&gt;If its not the SD ram setting that is incorrect, then please set a&amp;nbsp;&lt;span&gt;app_error_handler_bare() in app_error.c and then look at the call stack if you hit the breakpoint, this will tell you which function that generated the error.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrf52840 to try to add dfu service in the hrs example failed (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/181728?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 02:20:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bae25338-053e-46a0-a749-69536a60c7d5</guid><dc:creator>zhong</dc:creator><description>&lt;p&gt;hello,I am using the tutorial for this website.&lt;a href="http://www.sunyouqun.com/2018/04/nordic-ble-dfu-4-buttonless-app/"&gt;http://www.sunyouqun.com/2018/04/nordic-ble-dfu-4-buttonless-app/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;it&amp;#39;s Chinese, but all the changes are shown in the form of pictures. Now I explain the work I have done.&lt;/p&gt;
&lt;p&gt;first，Open the &amp;lt;sdk&amp;gt;\examples\ble_peripheral\ble_app_hrs project to make sure the project works&lt;/p&gt;
&lt;p&gt;1.Add source file&lt;br /&gt;Add a folder nRF_DFU to the project and add the following files:&lt;/p&gt;
&lt;p&gt;&amp;lt;sdk&amp;gt;\components\ble\ble_services\ble_dfu\ble_dfu.c&lt;br /&gt;&amp;lt;sdk&amp;gt;\components\ble\ble_services\ble_dfu\ble_dfu_bonded.c&lt;br /&gt;&amp;lt;sdk&amp;gt;\components\ble\ble_services\ble_dfu\ble_dfu_unbonded.c&lt;br /&gt;&amp;lt;sdk&amp;gt;\components\libraries\bootloader\dfu\nrf_dfu_svci.c&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2.Add Include directory&lt;br /&gt;Find User Include Directories in the project configuration window and add the following path:&lt;/p&gt;
&lt;p&gt;../../../../../../components/libraries/bootloader&lt;br /&gt;../../../../../../components/libraries/bootloader/ble_dfu&lt;br /&gt;../../../../../../components/libraries/bootloader/dfu&lt;br /&gt;../../../../../../components/libraries/svc&lt;br /&gt;If you use SEGGER Embedded Studio, you need to pay extra attention to the spaces at the end of these paths, which may result in not being recognized correctly.&lt;/p&gt;
&lt;p&gt;3.Add macro switch&lt;br /&gt;Find Preprocessor Definitions in the Project Configuration window and add the following items:&lt;/p&gt;
&lt;p&gt;NRF_DFU_SVCI_ENABLED&lt;br /&gt;NRF_DFU_TRANSPORT_BLE=1&lt;br /&gt;BL_SETTINGS_ACCESS_ONLY&lt;/p&gt;
&lt;p&gt;4.Configuring sdk_config&lt;br /&gt;In sdk_config.h, make the following changes:&lt;/p&gt;
&lt;p&gt;BLE_DFU_ENABLED = 1&lt;br /&gt;NRF_SDH_BLE_VS_UUID_COUNT += 1&lt;/p&gt;
&lt;p&gt;5.Add header file&lt;br /&gt;Add the following header file to main.c:&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf_dfu_ble_svci_bond_sharing.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_svci_async_function.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_svci_async_handler.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_dfu.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_power.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_bootloader_info.h&amp;quot;&lt;/p&gt;
&lt;p&gt;6.Add code&lt;br /&gt;Open the main.c of the Buttonless sample project and copy the following functions into the main.c of the current project:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static bool app_shutdown_handler(nrf_pwr_mgmt_evt_t event){};
NRF_PWR_MGMT_HANDLER_REGISTER(app_shutdown_handler, 0);
static void buttonless_dfu_sdh_state_observer(nrf_sdh_state_evt_t state, void * p_context){};
NRF_SDH_STATE_OBSERVER(m_buttonless_dfu_state_obs, 0) = {};
static void ble_dfu_evt_handler(ble_dfu_buttonless_evt_type_t event){};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Add Buttonless DFU Service&lt;br /&gt;Add the DFU service at the end of the main.c/services_init function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ble_dfu_buttonless_init_t dfus_init = {0};

// Initialize the async SVCI interface to bootloader.
err_code = ble_dfu_buttonless_async_svci_init();
APP_ERROR_CHECK(err_code);

dfus_init.evt_handler = ble_dfu_evt_handler;

err_code = ble_dfu_buttonless_init(&amp;amp;dfus_init);
APP_ERROR_CHECK(err_code);  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;7.Adjust memory address&lt;br /&gt;Follow the steps above and walk down, you can already compile. Burn Softdevice and Application, open the serial port tool, you should see the log message prompts that the memory address and memory size need to be adjusted.&lt;/p&gt;
&lt;p&gt;（In this step, I didn&amp;#39;t see any information on the serial port, so I don&amp;#39;t know how to modify the RAM, maybe the memory of nrf52840 is enough）&lt;/p&gt;
&lt;p&gt;Then I can compile and get the app.hex file&lt;/p&gt;
&lt;p&gt;8.Bootloader settings&lt;/p&gt;
&lt;p&gt;I confirmed that I used the correct version of softdevice and bootloader (s140_nrf52_6.1.1_softdevice.hex and complie the file in sdk15.3.0/example/dfu/secure_bootloader/pca10056 folder to get the bootloader.hex), and then got the final hex file by&amp;nbsp;&lt;span&gt;the following command.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;nrfutil settings generate --family NRF52840 --application app.hex --application-version 3 --bootloader-version 2 --bl-settings-version 1 settings.hex&lt;/p&gt;
&lt;p&gt;mergehex --merge bootloader.hex s140_nrf52_6.1.1_softdevice.hex --output production_final1.hex&lt;/p&gt;
&lt;p&gt;mergehex --merge production_final1.hex app.hex --output production_final2.hex&lt;/p&gt;
&lt;p&gt;mergehex --merge production_final2.hex settings.hex --output production_final.hex&lt;/p&gt;
&lt;p&gt;nrfjprog --eraseall -f NRF52&lt;/p&gt;
&lt;p&gt;nrfjprog -f NRF52 --program &amp;quot;production_final.hex&amp;quot; --verify&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrfjprog --reset -f NRF52&lt;/p&gt;
&lt;p&gt;Unfortunately, I didn&amp;#39;t search for the nrf52840&amp;#39;s Bluetooth link, and I didn&amp;#39;t even see the led light blinking (the hrs example and the buttonless example will have a led light blinking at runtime), I don&amp;#39;t know where I am having problems, maybe I need to configure flash RAM? Then I did not find a more suitable tutorial, I look forward to your reply.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrf52840 to try to add dfu service in the hrs example failed (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/181639?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 13:41:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7d33245-6d44-4edd-afc9-dc9a77ab3386</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/zhong"&gt;zhong&lt;/a&gt;: Which step-by-step guide have you been following?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the application is not starting up properly, then you need to debug the application and look at the return codes from the functions that you have added. I assume that you have added the&amp;nbsp;following code&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;#160;ble_dfu_buttonless_init_t dfus_init = {0};

dfus_init.evt_handler = ble_dfu_evt_handler;

err_code = ble_dfu_buttonless_init(&amp;amp;dfus_init);
APP_ERROR_CHECK(err_code);

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to&amp;nbsp;services_init(). Set a breakpoint in&amp;nbsp;app_error_handler_bare() in app_error.c and then look at the call stack if you hit the breakpoint, this will tell you which function that generated the error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>