<?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>Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103625/insufficient-resources-error-while-doing-buttonless-ota-on-nrf52840</link><description>Hi All, 
 I am facing some issues while doing OTA for nrf52840. I am creating the settings.hex file using the following command:- 
 nrfutil settings generate --family NRF52840 --application sensor.hex --application-version 3 --bootloader-version 2 --bl</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Nov 2023 03:57:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103625/insufficient-resources-error-while-doing-buttonless-ota-on-nrf52840" /><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/454820?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2023 03:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e5be3aa-da1b-4fbf-a730-c2e6fac98e2a</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi... I have solved the issue.&amp;nbsp;&lt;span&gt;Same pin was being accessed in bootloader as well as application fw which caused the issue.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/452946?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2023 09:02:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ee05eb8-c7b8-4b33-a778-cec6de054632</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please step in the code and check what cause the problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You need to know how to debug to be able to solve the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the app_usbd.c we used:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;ret = nrf_drv_power_init(NULL);
if ((ret != NRF_SUCCESS) &amp;amp;&amp;amp; (ret != NRF_ERROR_MODULE_ALREADY_INITIALIZED))
{
/* This should never happen */
APP_ERROR_HANDLER(ret);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You may want to consider to do the same.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Have you tried what I suggested ?&amp;nbsp;&lt;br /&gt;Can you confirm that if you flash them separately they worked ?&amp;nbsp;&lt;br /&gt;It they do, I don&amp;#39;t see why the code would cause the problem. Why combining hexes have anything to do with&amp;nbsp;nrf_drv_power_init() function.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/452893?ContentTypeID=1</link><pubDate>Sun, 29 Oct 2023 17:54:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91d8fae7-56ef-49c0-9fe7-7bab81cee246</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi I guess I know what the issue is... The issue is inside &amp;quot;nrf_drv_power.c&amp;quot; file. Something is causing an issue in this file. If i comment this whole file everything works fine, But for USB MSC this file is needed and its causing issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also searched other tickets and did nrf_drv_power_init before ble stack init in the application main file. But still the device seems to hang. This is my code for main.c:-&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
        bool erase_bonds;
    ret_code_t err_code;
    // Initialize modules.
    log_init();
    timers_init();


    err_code = nrf_drv_power_init(NULL);
    APP_ERROR_CHECK(err_code);

    clock_init();
    nrf_drv_clock_lfclk_request(NULL);

    while(!nrf_drv_clock_lfclk_is_running())
    {
        /* Just waiting */
    }
    
    usbd_config_init();

    // Initialize the async SVCI interface to bootloader before any interrupts are enabled.
    // We don&amp;#39;t check for error in case bootloader not in place
    ble_dfu_buttonless_async_svci_init();

    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);
    
    // Do not start any interrupt that uses system functions before system initialisation.
    // The best solution is to start the OS before any other initalisation.

#if NRF_LOG_ENABLED
    // Start execution.
    m_logger_thread = xTaskCreateStatic(logger_thread, &amp;quot;LOGGER&amp;quot;, sizeof(xLoggerStack) / sizeof(xLoggerStack[0]), NULL, LOGGER_TASK_PRIORITY, xLoggerStack, &amp;amp;xLoggerTaskBuffer);
    if (m_logger_thread == NULL) {
        APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
    }
#endif

NRF_LOG_INFO(&amp;quot;TESTING NEW FIRMWARE&amp;quot;);
    
      //init_device_storage();

    // Activate deep sleep mode.
    SCB-&amp;gt;SCR |= SCB_SCR_SLEEPDEEP_Msk;

    device_storage_init();
    clinitraq_load_settings();
  

    memset(app_fw_version, 0, sizeof(app_fw_version));
    app_version_str(app_fw_version, sizeof(app_fw_version));

    mem_init();

 ///* Enable interrupt for FPU so we can clear it */
 //   NVIC_SetPriority(FPU_IRQn, APP_IRQ_PRIORITY_LOW);
 //   NVIC_EnableIRQ(FPU_IRQn);

    // Configure and initialize the BLE stack.
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();
    peer_manager_init();

    // Initialize modules.
    
 
    
    
    application_timers_start();

 /* Set TX Output Power to +4dBm */
    err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, 4); 
    APP_ERROR_CHECK(err_code);

    // Create a FreeRTOS task for the BLE stack.
    // The task will run advertising_start() before entering its loop.
    nrf_sdh_freertos_init(advertising_start, &amp;amp;erase_bonds);

    
    init_usb_msc_task();
    init_led_button_task();
    init_system_task();
    //////////init_device_storage();
    init_clinitraq_task();
 

    //err_code = app_usbd_power_events_enable();
    //APP_ERROR_CHECK(err_code);

    NRF_LOG_INFO(&amp;quot;CLINITRAQ Starting&amp;quot;);
    NRF_LOG_INFO(&amp;quot;FW Version: %s&amp;quot;, app_fw_version);
    

      

     // Start FreeRTOS scheduler.
    vTaskStartScheduler();

    for (;;) {
        APP_ERROR_HANDLER(NRF_ERROR_FORBIDDEN);
    }
}


&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;can you please suggest me something? I am running out of time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/451524?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 13:47:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f13466c-de85-42b8-9063-fed830b8ba2f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After you have everything working, you may want to copy the content of the flash of your working device and then flash it to other products. You&amp;nbsp;want only one hex file and can flash to all product in production, correct ?&amp;nbsp; I assume that what you want ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can do that by having a working device, then do this:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;nrfjprog --readcode --readuicr myfirmware.hex&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After that nrfjprog will read the flash content of the working device including the UICR, and write it to myfirmware.hex&lt;/p&gt;
&lt;p&gt;You can use this myfirmware.hex to flash other device(s) and it should have the exact flash content as the working device.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/451485?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 11:43:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6619c0e3-d8c9-4456-862e-493d405fd52e</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&lt;span&gt;- If you do SD + BL and then do DFU update the application. After that you can do as many DFU update as you want , is it correct ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Yes correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&lt;span&gt;If it&amp;#39;s the case I think one solution for you to not to have to merge SD + BL + APP + BL setting is that you can do a flash read out and UICR read out :&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;nrfjprog --readcode --readuicr&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here which files do I need to flash and then read out the code?? Got confused on this one.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/451479?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 10:55:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f2ee47b-f799-4b8e-a556-38c234244e2b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;br /&gt;It&amp;#39;s really strange that&amp;nbsp; with bootloader setting v2 it didn&amp;#39;t work&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you confirm that:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- If you do SD + BL and then do DFU update the application. After that you can do as many DFU update as you want , is it correct ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s the case I think one solution for you to not to have to merge SD + BL + APP + BL setting is that you can do a flash read out and UICR read out :&amp;nbsp;&lt;br /&gt;nrfjprog --readcode --readuicr&lt;/p&gt;
&lt;p&gt;so that you can get the hex dump into a hex file. You can then use this hex file to flash your application in production.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/451420?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 06:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d58a400f-3759-418b-9d08-6cee5471bfef</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sorry for the late response. Was out for some days. I tried with&amp;nbsp;&lt;span&gt;--bl-settings-version 2&amp;nbsp; but still OTA did not work. We got Gatt error as described in above comments. Would it be a hardware issue?? Because everything works fine on development kit nrf52840.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Snehal&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/449470?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2023 07:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a34fe7b-bd88-4568-a351-b65e598b4b0a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;br /&gt;It seems that you are using SDK v17.1&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But in the bootloader settings script you are using&amp;nbsp;--bl-settings-version 1&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is incorrect. You can see here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_settings_generate_display.html?cp=11_8_6"&gt;https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_settings_generate_display.html?cp=11_8_6&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should use&amp;nbsp;&lt;span&gt;--bl-settings-version 2&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/449432?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2023 04:52:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee77f343-a0a7-4b16-877b-07e71de41f14</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;settings page is generated using following script&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfutil settings generate --family NRF52840 --application usbmsc.hex --application-version 3 --bootloader-version 2 --bl-settings-version 1 settings_usbmsc.hex

del /s /q jtag_lp
del /s /q dfu_lp
mkdir jtag_lp

mergehex -m s140_nrf52_7.2.0_softdevice.hex usbmsc.hex bootloader.hex -o inter_usbmsc.hex
mergehex -m inter_clinitraq.hex settings_usbmsc.hex -o jtag_lp/usbmsc-merged.hex


mkdir dfu_lp
nrfutil pkg generate --hw-version 52 --application-version 3 --application usbmsc.hex --sd-req 0x0100 --key-file debug.pem dfu_lp/usbmsc-dfu.zip

:end
pause
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Is anything wrong with my settings generation or merging of files?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The application firmware is using &amp;quot;&lt;span&gt;fstorage&amp;quot; but why it does not show any issues on development kit?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/449342?ContentTypeID=1</link><pubDate>Mon, 09 Oct 2023 11:21:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6af1fe5c-63b2-4280-ba92-fee38e5758a2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;br /&gt;Then we will need to look at how you generate the bootloader setting and if there is anything special about your application ? Did it write to flash (without using fds or fstorage) that may potential cause a problem to DFU update ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Please try doing a test with an example in our SDK , ble_app_hrs for example.&amp;nbsp;&lt;br /&gt;Please do bootloader + softdevice test first, DFU update ble_app_hrs and very that it works on your board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After that do bootloader + softdevice + application + bootloader setting then do DFU update after that to check if it works&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/449284?ContentTypeID=1</link><pubDate>Mon, 09 Oct 2023 06:46:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56b9422d-0460-4cc1-998b-883a3864306d</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;I tried following your steps on our custom device. We flashed the device with bootloader.hex and softdevice file. Then we performed OTA via nrf connect app and I was able to do OTA. Even after doing OTA, I was able to connect again to the device without any issue. Did this multiple times and it is working fine on custom board.&lt;/p&gt;
&lt;p&gt;But why the merged files work on development kit and doesn&amp;#39;t work on custom device??&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448838?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2023 13:39:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2df83d2-3119-4667-82c2-36fd70155382</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please do what I suggested only flash softdevice + bootloader for step 1(this is how it should be done as in the bootloader documentation)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Please sent us the schematic of your board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Besides RTT log, you can debug the application (and the bootloader) by step into the code and set a breakpoint. It&amp;#39;s the normal debugging process for application development.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448832?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2023 13:22:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbe347bf-4c61-4122-ab87-70941cd2c906</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;For debugging rtt logs will be needed right. Currently after doing ota rtt logs are not seen. Before ota we can see rtt logs... but not after ota. Thats my problem. I can&amp;#39;t debug in this case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;without ota my application works fine... I am able to connect to device. How to debug ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448820?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2023 12:34:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7fef925-c53b-4367-bc04-7c1d68e8a538</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes I read this reply. I know that everything works on the DK.&amp;nbsp; We need to look into why it doesn&amp;#39;t work your board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;I&amp;nbsp;want you test at step 1 only do softdevice + bootloader no application, no bootloader setting.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Also please try to do this:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Flash softdevice + bootloader&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. DFU update your application&lt;/p&gt;
&lt;p&gt;3. Check if your application start.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If #3 doesn&amp;#39;t work, then you can again from step 1 but at step 2 do DFU update a very simple application&lt;/p&gt;
&lt;p&gt;If #3 works, you can see your application advertising, then you can try to do DFU update your application again (with minor modification, for example change advertising name).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What I want to say is that you need to narrow down what can be wrong and you need to try debugging it. Step in the code, simplify your application, etc.&amp;nbsp;&lt;br /&gt; Simply say it doesn&amp;#39;t work won&amp;#39;t help.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448800?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2023 10:56:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c53da1d4-3f16-465d-88d8-baccc45d9ce0</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;I guess you missed to read my one reply here. I am attaching that reply here again:-&lt;/p&gt;
&lt;p&gt;I tried various combinations. I have found that my code ( USB MSC application) works fine on development kit nrf52840. I am able to do OTA and even after OTA I am able to connect to the device without any GATT error on the development kit nrf52840. But on my custom board after OTA I am not able to connect to the application.&amp;nbsp;&lt;br /&gt;Can you please help us on why it is creating issues on our custom hardware after doing OTA update??&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am following the same steps to test OTA on development kit as well as custom hardware which I had shared&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1)Flash the firmware files separately one by one (bootloader, softdevice &amp;amp; application)&lt;/p&gt;
&lt;p&gt;2)Device is advertising and visible in&amp;nbsp;NRF connect app.&lt;/p&gt;
&lt;p&gt;3) Connect&amp;nbsp;NRF connect with device.&lt;/p&gt;
&lt;p&gt;4) Do OTA upgrade&lt;/p&gt;
&lt;p&gt;5) Upgrade finishes&amp;nbsp;&lt;/p&gt;
&lt;p&gt;6) After upgrading firmware I am no longer able to connect to the device on custom hardware.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448799?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2023 10:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6871e49-5114-491c-adbe-cf03ee4b53bb</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you please try testing again with only softdevice + bootloader at step 1?&amp;nbsp;&lt;br /&gt;Please try that and update the application to see if the application can run.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If it doesn&amp;#39;t run, please try again with a more simple application, blinky for example. You mentioned that if you disable USB MSC code it work ?&amp;nbsp;&lt;br /&gt;If it&amp;#39;s the case , this mean the application actually run , but it crash at initializing USB MSC, then you can step in and debug to see what crashes.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448745?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2023 06:54:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7ebc264-84a9-4c68-b921-93f0b607c17f</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Answering all your queries sequentially:-&lt;/p&gt;
&lt;p&gt;1) At step 2 yes the device was advertising properly.&lt;/p&gt;
&lt;p&gt;2) At step 1, I flashed bottloader+ softdevice + application + settings. So the device was advertising properly and I was able to do OTA upgrade.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3) If I only&lt;span&gt;&amp;nbsp;flash softdevice + application yes the application works perfectly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4) At step 6 I am not able to see any logs. I tried to check in RTT logs but nothing was seen.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please understand I am able to do OTA on custom board but after doing OTA upgrade I am not able to connect to the device, application doesn&amp;#39;t&amp;nbsp;seem to be running in this case. Thts the reason I am not observing any logs in RTT viewer.&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;Snehal&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448640?ContentTypeID=1</link><pubDate>Tue, 03 Oct 2023 12:14:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2d56233-2c9e-4c5b-89a0-780c7120c248</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;br /&gt;Please clarify at #2 the device was advertising as DFUTarg ?&amp;nbsp;&lt;br /&gt;At 1 if you only flash bootloader + softdevice + application, the application won&amp;#39;t be able to start because the bootloader will not accept it as a valid application. Please only do bootloader + softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you only flash softdevice + application , would the application work ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At step 6 do you see any log ? We need to know if the application was running and crashed or it never run and the bootloader having trouble&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please be aware that you can debug the application as normal after it&amp;#39;s DFUed. Please try to debug it, either by step in the code or by printing log out. It&amp;#39;s not a black box.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/448618?ContentTypeID=1</link><pubDate>Tue, 03 Oct 2023 10:58:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78ad241f-4319-4f0b-ac22-09c6cd3b79d3</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I tried various combinations. I have found that my code ( USB MSC application) works fine on development kit nrf52840. I am able to do OTA and even after OTA I am able to connect to the device without any GATT error on the development kit nrf52840. But on my custom board after OTA I am not able to connect to the application.&amp;nbsp;&lt;br /&gt;Can you please help us on why it is creating issues on our custom hardware after doing OTA update??&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am following the same steps to test OTA on development kit as well as custom hardware which I had shared&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1)Flash the firmware files separately one by one (bootloader, softdevice &amp;amp; application)&lt;/p&gt;
&lt;p&gt;2)Device is advertising and visible in&amp;nbsp;NRF connect app.&lt;/p&gt;
&lt;p&gt;3) Connect&amp;nbsp;NRF connect with device.&lt;/p&gt;
&lt;p&gt;4) Do OTA upgrade&lt;/p&gt;
&lt;p&gt;5) Upgrade finishes&amp;nbsp;&lt;/p&gt;
&lt;p&gt;6) After upgrading firmware I am no longer able to connect to the device on custom hardware.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/446832?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2023 10:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53cb6830-8eb7-425d-a722-7478e47c1926</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At step 1 please don&amp;#39;t flash the application. You should flash only the bootloader + softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At step 4, please try testing with:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1 - Simple blinky application&lt;/p&gt;
&lt;p&gt;2 - ble_app_hrs&lt;/p&gt;
&lt;p&gt;3 -&amp;nbsp;usbd_msc&lt;/p&gt;
&lt;p&gt;You may need to modify the usbd_msc application so that it works with the softdevice.&amp;nbsp;&lt;br /&gt;Please make sure all of the application works with application + softdevice before you test with DFU and bootloader.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the test #3 worked fine, then it must be something wrong with your application that make it doesn&amp;#39;t work when DFU updated. You would need to comment out some features of the application until you see that it would run after DFU update.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Please let me know the result of the test #1, #2, #3.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/446754?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2023 05:00:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:241bffd7-b613-4289-8426-95480e5b825c</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; When I try to debug with segger studio, it is working fine. The Gatt error comes only after updating firmware via DFU. To avoid more confusion please see the steps below which I am following for test.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1)Flash the firmware files separately one by one (bootloader, softdevice &amp;amp; application)&lt;/p&gt;
&lt;p&gt;2)Device is advertising and visible in&amp;nbsp;NRF connect app.&lt;/p&gt;
&lt;p&gt;3) Connect&amp;nbsp;NRF connect with device.&lt;/p&gt;
&lt;p&gt;4) Do OTA upgrade&lt;/p&gt;
&lt;p&gt;5) Upgrade finishes&amp;nbsp;&lt;/p&gt;
&lt;p&gt;6) After upgrading firmware I am no longer able to connect to the device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;This firmware includes USB MSC code. So is that causing an issue after OTA upgrade? Do we need to set anything after OTA? It seems like device gets stuck after upgrading. I am not even able to see any logs in RTT viewer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also one thing to note is in my sdk config &amp;quot;NRF_SDH_DISPATCH_MODEL&amp;quot; is set to &amp;quot;0&amp;quot; which is interrupt based. I had to set this define as I am using USB MSC with FreeRTOS. Is this causing an issue?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/445845?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2023 12:47:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cc45e8e-8502-4350-a77e-42c152044386</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;My understanding is that the device, after DFU, advertised. Then you connect to it and then you get the GATT ERROR ?&amp;nbsp;&lt;br /&gt;It&amp;#39;s not that after DFU the device doesn&amp;#39;t do anything, correct ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In that case, please try to debug the application to see if you have any assert. You can debug it as normal like when you flash it directly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please also capture a &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;sniffer trace&lt;/a&gt; so that we know what exactly happens.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/445784?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2023 09:19:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaa2cdf5-0a0f-42af-a8b1-73792ed79af0</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I already tried DFU without USB MSC code in my application firmware. Without USB MSC code OTA works fine. I am able to upgrade the firmware and connect to device even after OTA. The problem comes only when i add usb msc code in my application firmware.&lt;/p&gt;
&lt;p&gt;The error which I get while testing usb msc code is as follows:-&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/img_2D00_20230912_2D00_wa0005.jpg" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/screenshot_5F00_2023_2D00_09_2D00_13_2D00_15_2D00_14_2D00_40_2D00_301_5F00_no.nordicsemi.android.mcp_5F00_720.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Snehal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/445780?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2023 08:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1c47916-e69c-404b-ade4-b86b5e52f47f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Snehal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Please keep merge hex out of the scope until you have made DFU works.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;From what you described DFU doesn&amp;#39;t work. You mentioned &lt;strong&gt;&amp;quot;&lt;em&gt;but as soon as application is loaded via DFU, I am no longer able to connect to the device.&amp;quot; &lt;/em&gt;&lt;/strong&gt;Does that mean the device is not working after DFU update? Does it advertise as your application ? Please show the error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Please try to follow the documentation and test doing DFU with a very simple application before you test with your application.&amp;nbsp;For example ble_app_hrs.&amp;nbsp; You can follow my tutorial here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader"&gt;Getting started with Nordic&amp;#39;s Secure DFU bootloader, a step by step guide&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;After you have DFU working for an example, please try testing DFU with a example that uses USB MSC in the SDK.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Insufficient resources error while doing Buttonless OTA on NRF52840</title><link>https://devzone.nordicsemi.com/thread/445769?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2023 08:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07e0dd92-5c31-4fe2-ab6d-775797fa97b7</guid><dc:creator>sne_333</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I am using &amp;quot;pca10056_s140_ble_debug&amp;quot; bootloader in my project which is BLE bootloader.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&lt;strong&gt;f you don&amp;#39;t do merge hex and simply DFU the application, would the application works after DFU ?&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&amp;gt;&amp;gt; Yes if I don&amp;#39;t merge the files and flash it one by one, then DFU upgrade works but as soon as application is loaded via DFU, I am no longer able to connect to the device. It gives GATT error on nrf connect app and no logs are shown on RTT viewer.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;you are talking about if you comment out the USB MSC the merged hex file worked fine. If you have the USB MSC in your code the merged hex file doesn&amp;#39;t work ?&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&amp;gt;&amp;gt; Yes If I comment USB MSC code from project OTA works fine even with merged files. But If I uncomment the USB MSC code then it won&amp;#39;t work. Even logs can&amp;#39;t be seen on RTT viewer in this case which makes it difficult&amp;nbsp;to debug.&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;What I&amp;#39;m thinking of is that there could be a chance that the bootloader has initialized USB or write to a register that should be cleaned before you use it in the application&lt;/strong&gt;&lt;em&gt;.&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&amp;gt;&amp;gt; which register should be cleaned here and how to do it?&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Also I had one more doubt. I am merging settings.hex also with the firmware file. Does that cause an issue&lt;/strong&gt;&lt;em&gt;?&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks &amp;amp; Regards,&lt;br /&gt;Snehal&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>