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

DFU : Which code sets bootloader_settings->bank_0 = BANK_VALID_APP

I am trying DFU to work with gcc and SoftDevice 7.1.

Problem: MCP able to send the APP binary successfully to the bootloader and DFU bootloader correctly write the app in the flash. However the application is not starting and the control is in DFU mode always.

After some debugging it is because bootloader_app_is_valid() is always returing false because bootloader_settings(0x3fc00) is 0.

I am able to see the APP data(0x16000) on the flash. I need help figuring out the missing piece which updates the bootloader_settings(0x3fc00).

bootloader_dfu_update_process() seems to be function where it can be done, but in the SDK code it is missing. Since it is working for everybody, I guess I am missing something here.

Note: I can hard code the bootloader settings and get the application loaded(and it works fine) but want to know whether DFU bootloader will eventually write this or not?

attribute ((section(".bootloaderSettings"))) uint8_t m_boot_settings[1024] = {BANK_VALID_APP};

Parents Reply Children
  • Thanks for the reply Hung.

    bootloader_dfu_update_process() with DFU_UPDATE_APP_COMPLETE is get called. But I didnt understand where it actually modifies the bootloader_settings at 0x3fc00. I looked at bootloader_settings_save() and realized that pstorage_register() needs to get block id 0x3fc00 for this thing to work. In my case it was getting 0x3f800. After adjusting the pstorage_platform.h, my problem is solved.

Related