This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU SDK13 buttonless - DfuTarg appears for few seconds

I enter to bootloader via my app by UART command:

err_code = sd_power_gpregret_clr(0, 0xffffffff);
APP_ERROR_CHECK(err_code);
            
err_code = sd_power_gpregret_set(0, 0xB1);
APP_ERROR_CHECK(err_code);

sd_nvic_SystemReset();

After that I see DfuTarg. But after about 1 second, advertising disappear. I need again send UART command for advertise.

I suppose, this problem in the bootloader_secure_ble, which I use. How to repare it?

nordic_debug2.txt

Parents
  • Hi Mikhail,

    I had a look at this together with Ketil. It looks like your system is being reset shortly after it starts advertising. This typically means that an error has occurred somewhere and the "APP_ERROR_CHECK" will then call "app_error_handler_bare" which by default resets the system. You need to figure out which error is causing the reset and resolve the cause of the error. I would recommend altering the error handler function so that it doesn't reset but rather loop indefinitely. That way you can do logging in the error handler. Further, you need to find the error check which failed. I typically use a debugger and set breakpoints to see which one is actually failing.

    (When the issue has been resolved, put back the reset in the error handler. It's there as a recovery mechanism for end-user products.)

    If you send me the files you have altered in the bootloader I might be able to reproduce the issue and tell you how to resolve it.

    Best regards, Rune Holmgren

  • Hi! Thanks.

    with commented and add debug code same result like attached log:

    void app_error_handler_bare(uint32_t error_code)
    {
    NRF_LOG_INFO("Az_app_error: 0x%08x!\r\n", error_code); // ###del
    
    (void)error_code;
    NRF_LOG_ERROR("Received an error: 0x%08x!\r\n", error_code);
    //    NVIC_SystemReset();
    
    }
    

    If from main app I send reboot comand and if I have or button pressed or NRF_POWER->GPREGRET == BOOTLOADER_DFU_START I have 2 times restart. But If I still press button, I read again it and than bootloader works fine. Is it no normal behavior.

    project downloaded here

    I just changed cristall settings to RC

Reply
  • Hi! Thanks.

    with commented and add debug code same result like attached log:

    void app_error_handler_bare(uint32_t error_code)
    {
    NRF_LOG_INFO("Az_app_error: 0x%08x!\r\n", error_code); // ###del
    
    (void)error_code;
    NRF_LOG_ERROR("Received an error: 0x%08x!\r\n", error_code);
    //    NVIC_SystemReset();
    
    }
    

    If from main app I send reboot comand and if I have or button pressed or NRF_POWER->GPREGRET == BOOTLOADER_DFU_START I have 2 times restart. But If I still press button, I read again it and than bootloader works fine. Is it no normal behavior.

    project downloaded here

    I just changed cristall settings to RC

Children
No Data
Related