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

The nRF52832 chip and SDK12.3.0 implement the buttonless DFU function.

The nRF52832 chip and SDK12.3.0 implement the buttonless DFU function.

First, as you are guided by the DK board, you have already completed the tutorial.

I tried to run it in the source of my project,
My project device is stopped during the initial setup of the application and it seems to run in bootloader mode.

In my project, I did not call the bootloader mode setting function, but only added the header file and C file.

I want to know the exact reason for this and how to solve it.

Why do I enter this mode when I did not call the bootloader mode function?

 

bootloader mode is running but not advertising.
I'm guessing now that my device's state is bootloader mode, but I'm not sure.

Softdevice & firmware all delete picture

Softdevice & firmware all delete picture

Softdevice & My DFU Project Downloaded on Chip

Softdevice & My DFU Project Downloaded on Chip

Help me...Thank you very much.

Parents
  • Hi,

    I think you are following an old tutorial.  

    We have a buttonless DFU tutorial for SDK 15.0.0 which is more up to date here -> https://github.com/gamnes/nRF52832-buttonless-dfu-development-tutorial

    Best Regards,

    Marjeris

  • Exactly what I think is to implement the main application operation and then switch to bootloader mode after or reboot when receiving a specific packet.
    I first tested it with the example of SDK12.3.0 and the DK board,
    I confirmed that it worked well.
    After that, I had to merge my project source to download the firmware to the device and enter the bootloader as soon as booting.
    My device is buttonless. There is no button. There is a button to boot the device, but there are no more buttons available for GPIO to switch to Bootloader mode.
    I want to solve this somehow, so I'm trying to test again with the SDK 15.0.0 Version.

  • The message 'INVALID OBJECT' means something wrong with the zip file.

    The application file you are using is called 'nRF52832_xxaa_s132'. Did you build this file yourself from one of our examples? Remember that you can not use the precompiled hex files from examples as they also contain a softdevice image.

    You need to build the application yourself, then go to the 'build' folder and copy the hex file, the name should be 'nrf52832_xxaa.hex', without any softdevice attached to it.

  • Hi msromero

    When you build in keil, the hex file is named nrf52832_xxaa_s132.hex.
    Is it possible to rename this file and package it?

    And there is a step to merge application.hex, bootloader.hex, softdevice.hex file using "mergehex" command in tutorial.
    However, the command mergehex is not recognized by my computer and can not perform the command.
    Do you have any additional utilities or applications to install?

    I installed Command Line Tools, but I do not know how to use the command mergehex.

  • The mergehex command has been successfully executed!
    However, DFU still does not work :(
    I think the zip file is wrong.
    I do not know how to solve it.

    There are many commands I have
    1. nrfutil pkg generate --hw-version 52 --application-version 1 --application nrf52832_xxaa.hex --sd-req 0x8c --softdevice softdevice.hex --key-file private.key app_dfu_package_softdevice.zip

    2. nrfutil pkg generate --hw-version 52 --sd-req 0x8c --application-version 1 -
    application nrf52832_xxaa.hex --key-file priv.pem app_dfu_package.zip

    3. nrfutil pkg generate --hw-version 52 --sd-req 0x8c --application-version 1 -
    application nrf52832_xxaa.hex --key-file priv.pem app_dfu_package.zip

    The nrf52832_xxaa.hex of this command was originally nrf52832_xxaa_s132.hex. I tried to rename it with nrf52832.xxaa.hex and packaging it.
    But the symptoms are the same.

    Another derectory of this project is that I tried this try because there is no hex file called nrf52832_xxaa.hex.

  • Could this happen because of the path or environment of the derectory?

    The Derectory I was performing
    D: \ Project \ SDK \ nRF5_SDK_12.3.0_d7731ad DFU_Bootloader \ external \ micro-ecc \ nrf52_keil \ armgcc.

    Was it something you did here?

    D: \ Project \ SDK \ nRF5_SDK_12.3.0_d7731ad DFU_Bootloader \ examples \ dfu \ bootloader_secure \ pca10040 \ arm5_no_packs \ _build
    Do you have to run the command here?
    The Develop Tool I use is Keil.

    /*

    All these questions try to translate the tutorial as much as possible and try to understand it as much as possible, but it seems to have a limit :(
    There are times when strange translations are made once in a time when I do not use the translator because the English interpretation is still too much. Perhaps you have often seen such a case in my reply.

    */

  • Hi,

    I also think there is something wrong with your zip file. You cannot rename it and expect it to work.

    Can you try to update just the application and see if this works?

    Use an application from an example in the SDK, but build this application yourself.

    For example:

    1. Use examples/ble_app_hrs/pca10050/s132/arm5_no_packs/ble_app_hrs_pca10050_s132.uvprojx (for KEIL)

    2. Open the project and build it.

    3. Use the hex file in examples/ble_app_hrs/pca10050/s132/arm5_no_packs/_build/nrf52832_xxaa.hex. Copy this hex file to the same folder you have your generated keys in.

    4. You need to run the nrfutil command from the same directory you have your application hex file and your private key.

    5. Generate the zip file:

    nrfutil pkg generate --hw-version 52 --application-version 1 --application nrf52832_xxaa.hex --sd-req 0x8c --key-file key.pem app_dfu_package.zip

    Does this works? I want you to test if you can perform an DFU updating only the application. You don't need to mergehex files when only doing application update.

    And what are you running in the DFU targ device? Try only running bootloader + softdevice. If you are running bootloader + softdevice + application, and one to update the application, then you need to change --application-version to 2

    - Marjeris

Reply
  • Hi,

    I also think there is something wrong with your zip file. You cannot rename it and expect it to work.

    Can you try to update just the application and see if this works?

    Use an application from an example in the SDK, but build this application yourself.

    For example:

    1. Use examples/ble_app_hrs/pca10050/s132/arm5_no_packs/ble_app_hrs_pca10050_s132.uvprojx (for KEIL)

    2. Open the project and build it.

    3. Use the hex file in examples/ble_app_hrs/pca10050/s132/arm5_no_packs/_build/nrf52832_xxaa.hex. Copy this hex file to the same folder you have your generated keys in.

    4. You need to run the nrfutil command from the same directory you have your application hex file and your private key.

    5. Generate the zip file:

    nrfutil pkg generate --hw-version 52 --application-version 1 --application nrf52832_xxaa.hex --sd-req 0x8c --key-file key.pem app_dfu_package.zip

    Does this works? I want you to test if you can perform an DFU updating only the application. You don't need to mergehex files when only doing application update.

    And what are you running in the DFU targ device? Try only running bootloader + softdevice. If you are running bootloader + softdevice + application, and one to update the application, then you need to change --application-version to 2

    - Marjeris

Children
  • Hi Kind Answer too thank you so much.
    All of the steps 1 to 5 proceeded sequentially.
    I have done the same before and now.

    I've tried again with the command you provided, but it still does not work.

    Let's solve the order in nRF Toolbox App. Please point out anything that's wrong with this process.

    1.SELECT FILE

    2.Distribution packet(ZIP)

    3.app_dfu_package.zip

    4.application only > OK

    --------------------------------

    5.SELECT DEVICE

    6.'DfuTarg' buletooth Secect

    7.UPLOAD

    If you proceed with DFU in this process, the following Fail message will be displayed.

    If you proceed with DFU in the above process, you will see the result as shown below.

    If there is nothing wrong with this process, it is obvious that the process of creating app_dfu_package.zip is wrong.
    what do you think?

    Setting version information to --application-version 2 or 3 is the same.

    And
    examples / ble_app_hrs / pca10050 / s132 / arm5_no_packs / _build
    No matter how I look for nrf52832_xxaa.hex, the file does not exist.
    There is only nrf52832_xxaa_s132.hex instead.

    And what firmware should be up before DFU on the device?

  • Hi,

    Which version of the nRF toolbox app are you using?

    You can try to see if the process works using nRF Connect app.

    But I don't think app is the issue.

     

    Aser said:
    No matter how I look for nrf52832_xxaa.hex, the file does not exist.
    There is only nrf52832_xxaa_s132.hex instead.

    Did you build the example using Keil? What is the location (path) of nRF52832_xxaa_s132.hex?

    Before the DFU: the device (dfu targ) should be flashed with bootloader + softdevice:

    1. The bootloader located in \examples\dfu\bootloader_secure\

    2. Own generated private and public key should be located in examples\dfu\bootloader_secure\

    3. Replace 'dfu_public_key.c' with your own public key.

    4.Open the project  \examples\dfu\bootloader_secure\pca10040\arm5_no_packs\secure_dfu_secure_dfu_ble_s132_pca10040.uvprojx in Keil

    5.Build the bootloader with Keil

    6. Flash bootloader and softdevice.

         6.1 Erase the device

    nrfjprog --eraseall

         6.2 Program softdevice, located in components\softdevice\s132\hex\

    nrfjprog -f NRF52 --program s132_nrf52_3.0.0_softdevice.hex

        6.3 Program the bootloader, located in \examples\dfu\bootloader_secure\pca10040\arm5_no_packs\_build\nrf52832_xxaa_s132.hex

    nrfjprog -f NRF52 --program nrf52832_xxaa_s132.hex --verify --reset

    7. Verify that the bootloader starts advertising as "DFUTarg" in nRFConnect app/ nRFtoolbox app .

    I recommend you read Step A, B, C and D again in this tutorial.

    Best regards,

    Marjeris

  • My app is nRF toolbox and nRF connect.

     This log is the log that attempted the DFU function a few minutes ago.

    We use nRF connect more often. The reason is because you can check the log if you slide next to it.

    The path of my application.hex
    D: \ Project \ Wikiki_Source \ Wikiki_gitlinkage \ examples \ ble_peripheral \ ble_app_beacon_wikiki \ pca10040 \ s132 \ arm5_no_packs \ _build
    is.
    Wikiki is my project name.

    1.APP source blid -> The generated nrf52832_xxaa.hex file copy. -> nrf52832_xxaa.hex + priv.pem = app_dfu_wikiki.zip file generated.

    2.From left, 'Erase all', 'softdevice download', 'bootloader download'.

     

    3.

    It's the order of the way I've done so far.
    Is anything wrong?

    It's the order of the way I've done so far.
    Is anything wrong?
    Maybe it looks the same way you commented with the command.

    I'll try it from now on the way you've told me.

Related