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

Ble peripheral and central with dfu could not burn when using nrfjprog(Close)

Hi,

I try to using nrfjprog to burn softdevice + bootloader + applacation, but it shows that application burn failed. image description

My SDK version is nRF5_SDK_12.2.0_f012efa and I using Keil uVersion5 to generate the hex files.

  1. Softdevice: s132_nrf52_3.0.0_softdevice.hex
  2. bootloader: example/dfu/bootloader_secure
  3. applacation: examples\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay

I add some file to the application project:

image description

I don't modify any file.

I did a test. If i remove the dfu c files(nrf_dfu_flash_buttonless.c, ble_dfu.c, _nrf_dfu_settings.c), it could burn success.

Any suggestions or pointers are very much appreciated.

Thanks.

Path: ble_app_hrs_rscs_relay_test.rar

  • Hi Kevin,

    Could you attach your project here ? I suspect something wrong with the flash configuration.

  • Hi Hung Bui,

    The project: ble_app_hrs_rscs_relay_test.rar

    I upload project at last

    Thanks!!

  • Hi Kevin,

    It was because a small bug with our buttonless approach. The nrf_dfu_settings.c file is used. It's the same file used for the DFU Bootloader and it will try to write to the UICR the address of the MBR setting page which is not needed for the buttonless application.

    When you use nrfjprog to program the application, it see that the address in UICR is already written and it won't be able to write to that area, throwing you the error.

    So what you need to do is to clone another file nrf_dfu_settings.c file and use it for the buttonless example (so that the DFU bootloader won't be affected), then remove the line 74 in the file, where we write to UICR:

    #if defined ( __CC_ARM )
        uint32_t m_uicr_mbr_params_page_address __attribute__((at(NRF_UICR_MBR_PARAMS_PAGE_ADDRESS)))
                                                        = NRF_MBR_PARAMS_PAGE_ADDRESS;
    
    #elif defined ( __GNUC__ )
        volatile uint32_t m_uicr_mbr_params_page_address    __attribute__ ((section(".uicrMbrParamsPageAddress")))
                                                        = NRF_MBR_PARAMS_PAGE_ADDRESS;
    #elif defined ( __ICCARM__ )
    
        __root    const uint32_t m_uicr_mbr_params_page_address @ NRF_UICR_MBR_PARAMS_PAGE_ADDRESS
                                                        = NRF_MBR_PARAMS_PAGE_ADDRESS;
    
    #else
    
        #error Not a valid compiler/linker for m_mbr_params_page placement.
    
    #endif
    

    After that it should be OK.

Related