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

nRF DFU works only in using SES, not after nrfjprog programming

Hello,

SDK 15.2.0

SoftDevice 6.1.0

DFU with Uart (based on {SDK}\examples\dfu\secure_bootloader\pca10040_uart. Single bank mode as my app is quite big (probably not relevant in the current issue).

I will update the nRF using a STM32 controller, so I have developped the controller protocol and it seems now OK (despite my issue).

What is working :

I program the SD and my App using nRFGo. I build the setting.hex of my app for bootloader and program it. Then I launch the bootloader using SES. It first go to app (DFU not started and valid app is available) and I launch DFU mode using BUTTON mode of the DFU (which is in fact a GPIO handle by the STM32). It enter DFU mode, it set PRN, get MTU, send Init Packet, and the new Application. And now the new app is working.

What is not working:

I program the SD and App using nRFGo. I program the bootloader_setting hex file using nrfjprog (mergehex between the two file). I launch the code. It launch the app at start. Then I enter in DFU mode the same way. I set the PRN and I did get a success answer. Then any coming command is not answer to the controller. get MTU, or reset PRN, create object, ... none of those command are answer. After a while inactivity trigger a reset and go back to the app.

Here is the script I am using for the programming, no error occurs during the programming.

nrfutil settings generate --family NRF52 --application application.hex --application-version 3 --bootloader-version 2 --bl-settings-version 1 settings.hex
mergehex -m bootloader.hex settings.hex -o bootloader_settings.hex
nrfjprog --family NRF52 --program bootloader_settings.hex --sectoranduicrerase --verify
nrfjprog --family NRF52 --reset

But as this is completly repeatable, I may I miss something in the process.

Hope you can help.

Parents
  • I am unsure, i still need to do more testing, but is it possible that a printf in the code can cause the crash of the bootloader ? I add a printf in one of the uart driver function that was previously blocking and I needed to monitor its result but forgot to remove it.NRF_LOG is disabled in release mode and cannot enable it as there is not enough space for it.

    It seems that after removing this, it works. If you think this could be link, I would like to understand the reason and if there is a way to properly disable printf output in suc case, but if you don't, let me know as it will happen again. regards

Reply
  • I am unsure, i still need to do more testing, but is it possible that a printf in the code can cause the crash of the bootloader ? I add a printf in one of the uart driver function that was previously blocking and I needed to monitor its result but forgot to remove it.NRF_LOG is disabled in release mode and cannot enable it as there is not enough space for it.

    It seems that after removing this, it works. If you think this could be link, I would like to understand the reason and if there is a way to properly disable printf output in suc case, but if you don't, let me know as it will happen again. regards

Children
No Data
Related