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.

  • Hi ,

    If I understood you right, you already have an application based on SDK 12.3.0 and now you want to add buttonless DFU to your old application. Is that correct?

    And you already tested the Buttonless DFU template application example in SDK 12.3.0 and it work well, but now you want to merge the both your application and the bootloader in your firmware image zip file and you are having trouble?

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

    I think this is probably because you flash the application with the bootloader without first generating the bootloader settings page using nrfutil.

    There is a guide using SDK v12 which you can take a look at an explains how to generate the bootloader settings page using nrfutil in Appendix 1:
    https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader

     

    Aser said:
    There are two things that I saw when I read this article.
    first,
    Step 2 - Create our own bootloader using out own private / public keys
    In Step 4
    "Compile C: \ nRF5_SDK_15.0.0_a53641a \ examples \ dfu \ secure_bootloader \ pca10040_ble \ ses \ secure_bootloader_ble_s132_pca10040.emProject, which is the secure BLE bootloader for nRF52832".
    I do not know exactly how this part should proceed with Compile.

    This part is the same as 'Step B: Build the Bootloader' in the blogpost. After you have generate your own private and public keys (use nrfutil) you should:

    • Install micro-ecc
    • Copy the generated public key to your bootloader folder.
    • Compile the bootloader, means to build the bootloader. Open the bootloader project in your IDE of choice and click "build".

    Are you able to build your bootloader successfully or not?

    Best regards,

    Marjeris

  • Before proceeding with the 15.0 SDK, I first went through this tutorial.

    https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader


    But Step D. Test the DFU stage and use the nRF Toolbox application to run the DFU
    I have symptoms like the picture below.
    In the meantime, the DFU is interrupted and is not successful.
    With a fail message called INVALID OBJECT.

    I have not found the cause even if I search hard.
    Why are you doing this?


  • 아랫 사진은 내가 DFU.zip파일을 생성할때 썻던 커맨드입니다.

    The bottom picture is the command I used when I created the DFU.zip file

    아래사진은 이 커맨드를 실행한 경로의 윈도우 창입니다.

    The picture below is the window of the path where this command was executed.

    And where is the "mergehex" command?
    When this command is input, it does not recognize it.

  • 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.

Reply
  • 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.

Children
  • 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

  • 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?

Related