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

nRF52810 buttonless DFU not working

Hello all:

I've developed an nRF52810 application based on the UART example, but when I include buttonless DFU support to my application, it doesn't work. I'm using SDK 17.0.2, SD 112 7.2.0

The instructions followed are shown here. In summary:

- Generated private/public key pair,

- replaced dfu_public_key.c for the example secure bootloader project at: <nRF5 SDK Folder>/examples/dfu/,

- built application <nRF5 SDK Folder>/examples/dfu/secure_bootloader/pca10040e_ble/ses/secure_bootloader_ble_s112_pca10040e.emProject,

- updated my app according to Nordic instructions (RAM parameters modified, added dfu .c files to project, added preprocessor definitions, added include directories, made changes to sdk_config.h, added includes and source additions to main.c),

- built my application

- generated the bootloader settings file using nrfutil for the hex file of my application,

- using mergehex, merged the bootloader settings, bootloader, softdevice and my application together

- used nrfjprog to erase and program chip

Using nRF Connect for Desktop for discover the device, the name of the device advertising is DfuTarg. It belongs to the bootloader instead of my application. However, using the Programmer option of the application, I can see all the hex files in the device.

Doing the same method with a nRF2832, it works properly. So, as one difference with the nRF2832 chip is the memory capacity, maybe the problem is related to the memory limitation of the nRF2810. In fact, I'm not sure about the correct values of RAM_SIZE and RAM_START in the linker options of the application.

All help is welcome

Thanks in advance,

Marta

  • Hi Marta, 


    To narrow down the issue, I would suggest to do the following test: 

    1. Please test doing DFU update with the bootloader. This is to verify that your bootloader is working well. I have made a blog that you can follow here. You can just update a simple application for example blinky application. 

    2. Try generating the bootloader setting for the blinky application. Then write to flash the SD + BL + APP + BL setting. Please don't use mergehex at this point. 

    If it doesn't work please show the script you used to generate the BL setting. 
    You can think of building the bootloader in debug setting so that you can step into the code and check why it doesn't jump to the application. The function that check if the bootloader should enter the application is in app_is_valid() in nrf_bootloader.c 

    You may also want to check if the NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN is always 0 or not. If it's 0, then the DFU bootloader will enter DFU mode anyway (check dfu_enter_check() )

  • Thanks for your quick reply, Hung. 

    I've done the suggested test: DFU bootloader works well, i can update the blinky application. After that, I've modified the RAM parameters, added dfu .c files to project, added preprocessor definitions, added include directories and all the DFU buttonless support to the blinky application. Then, i've generated the BL settings with the following command: 

    nrfutil settings generate --family NRF52810 --application ble_app_blinky_pca10040e_s112.hex --application-version-string "2.0.0" --bootloader-version 2 --bl-settings-version 2 bl_setting.hex
    

    Then, i've written to flash SD + BL + APP + BL setting.

    Now, i can't see any device advertising. However, i've checked that the application is valid looking at app_is_valid(). I've noticed that the reason of my previous mistake (the program didn't jump to the application) was that I was using an incorrect bootloader settings file.

    Now, this is solved, but... why I can't see my application? Do you think it could be related to the memory limits of the chip?

    Marta

  • Hi Marta,

    Please don't skip the step, just test doing SD+BL+Blinky app + BL Setting. 

    We need to verify that the application can be updated and can run normally. 

    You can test first with the simple blinky that only does LED Blink, no BLE. After it 's verified, you can test with the BLE blinky. 


    I suspect that the app (that you added DFU Buttonless)  may crash for some reason. You can try debug it, if the bootloader works as it should you should be able to stop the PC at main() in the application when debugging. 

  • Hi Hung,

    I've written to flash SD+BL+Blinky BLE + BL Setting. As a result, the bootloader works well and the program enter to the Blinky app. I can see "Nordic_Blinky" device advertising.

    I able to debug from the Secure bootloader code, but when I try to do it from the Blinky application, it never jumps into the app. I'm working with SEGGER Embedded Studio 5.5.

    Regards,

    Marta

  • Hi Marta, 


    When you debug the blinky application, please make sure that you don't have the SES project of the bootloader also in debug mode. 
    You can try trigger a reset from the Debug menu in the blinky application. If it doesn't jump to the application, please pause and check where the PC is. 
    Note that you should have the exact same application that you DFU update via the bootloader. If you have any modification (for example switch from "release" to "debug" compiling mode or if you change anything) the CRC check will not match and the bootloader will not jump to the application.  

Related