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

Help with restarting, debugging and size-limitations for DFU procedure needed

Hello,

while I already managed to solve a couple of problems regarding a proper handling of the DFU procedure in my previous topic here, there are still 3 problems that remain where I could use some help...

  1. How can I trigger a 'hard-reset' within the Nordic SDK, that behaves like using the on-/off-switch on the nRF52832 dev-board? Apparently a mere 'soft-reset' - f.ex. after a watchdog-timeout - isnt enough to get a restart in application-mode, when successfully completing the DFU procedure!

  2. How can I enable the debugging for the bootloader_secure-example, when using a gcc-toolchain? Basically something like this here, but just for a direct handling on cmd-line-basis with gcc and SDK v12.2.0! Has anyone done that before?

  3. Apparently I can only complete the DFU procedure for a pkg-file, that just includes my application (f.ex. buttonless_dfu-example), but not for a pkg-file which includes the bootloader and the softdevice due to a 'REMOTE DFU DATA SIZE EXCEEDS LIMIT'-error, even though this file is smaller then the test-files given within the dfu_send_hex-example!

I would very much appreciate any help on those issues!

Kind regards

Parents
  • Hi Ray,

    Q1: The Secure bootloader should jump to the application after the DFU procedure has been completed. Upon completion the bootloader will set the valid application flag in the bootloader settings and jump to the application. This valid application flag is checked by the bootloader everytime the device is booted up. If you've put the device in bootloader mode, but do not start any DFU process then you will stay in bootloader mode until the device is reset, unless you implement a timeout.

    I saw that you've implemented this using the WDT as I suggested in this answer. If the valid application flag is set in the bootloader settings, then a Soft-reset should result in the bootloader jumping to the application. You can check if the flag is set by reading the bootloader settings from flash using the following command:

    nrfjprog -f nrf52 --memrd 0x7F020
    

    which should be set to 1, i.e. the command should return

    0x0007F020: 00000001     
    

    Q2: I recommend using Segger's Ozone Debugger, here is the link to the download page. You need to copy the .out file from the _build folder to the same folder that contains the Makefile. Ozone should then be able to locate all the source files based on the paths in the Makefile.

    Q3: It could be an issue with the bootloader size. Can you post the nrfutil command that you used to generate the zip file ? Please also attach the generated zip file as well as the bootloader and softdevice hex files used to generate the image?

Reply
  • Hi Ray,

    Q1: The Secure bootloader should jump to the application after the DFU procedure has been completed. Upon completion the bootloader will set the valid application flag in the bootloader settings and jump to the application. This valid application flag is checked by the bootloader everytime the device is booted up. If you've put the device in bootloader mode, but do not start any DFU process then you will stay in bootloader mode until the device is reset, unless you implement a timeout.

    I saw that you've implemented this using the WDT as I suggested in this answer. If the valid application flag is set in the bootloader settings, then a Soft-reset should result in the bootloader jumping to the application. You can check if the flag is set by reading the bootloader settings from flash using the following command:

    nrfjprog -f nrf52 --memrd 0x7F020
    

    which should be set to 1, i.e. the command should return

    0x0007F020: 00000001     
    

    Q2: I recommend using Segger's Ozone Debugger, here is the link to the download page. You need to copy the .out file from the _build folder to the same folder that contains the Makefile. Ozone should then be able to locate all the source files based on the paths in the Makefile.

    Q3: It could be an issue with the bootloader size. Can you post the nrfutil command that you used to generate the zip file ? Please also attach the generated zip file as well as the bootloader and softdevice hex files used to generate the image?

Children
No Data
Related