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

BLE Background DFU function support

Hi Nordic ,

I have a nRF52840 project development based on SDK 15.3 . Now ,I need to add DFU feature there. we suppose to use background DFU here. we will use long range( coded PHY S8), and long connection parameter . 

form my study ,I can use IOT bootloader example from my bootloader.

but about the DFU function, can you give me the hint and reference for DFU function implement ?

I am not idea on how to save the New fw package during the application status now. Thanks.

  • Ok, so it is a flashing problem then, I assume. It doesn't have anything to do with OTA DFU, I assume?

    Have you tried to flash the merged hex file using nrfjprog?

    What HW are you trying to flash this to?

    I see that it is the nRF52840, but is it a Development kit, the nRF52840 dongle, or a custom PCB?

  • I am using the custom PCB with nRF52840 , but I can flash it with App.hex only before.

    Once I merge the Bootlaoder and softwdevice, it happen fail.

    Bootloader and SoftDevice can been flash independency.

  • Can you try to use nRF Command Line Tools to flash the merged hex file?

    The commands you would need to use are:

    nrfjprog --eraseall
    nrfjprog --program merged_file.hex
    nrfjprog --reset

    What happens if you try this? Does it throw any errors?

    What programmer do you use to program the custom PCB?

  • Thanks for reply , I work fine. I can flash the hex file by Command Line tools with Jlink now. 

    Then , can I back to the other issue ?

     

    Kawing said:
    1. I want to use different bootloader with same app part for different usage, can I use the UICR file to implement that case?

     I don't understand what you mean by this. 

    In my design , I would like to use the UICR register customer area to save some software setting.

    Then once the App part starting , it can get UICR->Customer[0] value to select the operation. even do the OTA , the software can working with same operation. 

    I try to adding the config file in app part. it work fine. 

    #include "cus_uicr_config.h"
    
    uint32_t get_NRF_UICR_CUSTOMER_SECTION (void)
    {
        // if register is not write , return None type .
        return (NRF_UICR->CUSTOMER[0] == 0xFFFFFFFF)?0x00:NRF_UICR->CUSTOMER[0];
    }
    

    but I try to adding the same file in bootloader part , it cannot work. my application cannot work with my setting. there is the config file I used. 

    so, my question is how can I write my UICR setting in code ?

    If I need to use bootloader function, can I adding the UICR setting in bootloader?

    Thank. 

    cus_uicr_config.h

  • Kawing said:
    but I try to adding the same file in bootloader part , it cannot work. my application cannot work with my setting. there is the config file I used. 

     What do you mean by "doesn't work". Are you not able to read the UICR? Is the value different from what you expect?

    Where do you write to the UICR register? Is the value correct if you try to read it using nrfjprog? Do you try to update it during runtime?

    You can use the command:

    nrfjprog --memrd 0x10001080

    to read UICR->CUSTOMER[0]

    For testing, you can also write to the UICR register using:

    nrfjprog --memwr 0x10001080 --val 0xDEADBEEF

    You can see the different UICR registers here.

Related