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

Access DFU settings page

Hi,

I'm currently working on a project including the buttonless DFU.

I would like to read the bootloader settings page from the application, especially the app version field. I know that these settings are stored at address 0x0007 F000 and I can of course just read them directly from there (the word at 0x0007 F008 should correspond to the app version).

But what if at some point this address changes or if the data structure is changed?

Should I manually define an APP_VERSION at the build stage that equals the DFU packet version given to nrfutil?

What is the recommended way of managing / retrieving the running app version? 

Details:

SoC: nRF52832

SDK: 15.2.0

SD: S132 v.6.1.0 

Regards,

William

Parents
  • Hi William,

    I had exactly this requirement for my application as well. What I ended up doing is creating SVCI async functions that the application can call on the bootloader. It works very well and it's maintainable. But it is a rather complex implementation that requires you to modify some SDK files.

  • Hi Andy,

    thank you for the suggestion, It seems like the most "proper" way to do it as far as I can tell. However, I prefer not to modify the SDK as I don't have it under source control, I could perhaps put the relevant files under source control.

    Would be great if there is some other "proper" way of doing it.

  • I would recommend you to put a clean copy of the SDK under source control. Especially for this case, since you need to share some files between application and bootloader. In most cases, copying modules directly into your project is enough, but I'd say that for this particular case you need to share the same modified files in both projects.

  • There is code in nrf_dfu_settings that suggests Nordic had planned a proper (or at least standard) way for the application to read the settings (NRF_DFU_SETTINGS_IN_APP), but it seems that it is not fully implemented.

    Also when generating a bootloader settings page for flashing the bootloader you specify a version for the settings page, but that info doesn't seem to be used by the code actually reading the settings.

    I ended up assuming the structure is fixed. And if it ever does  change I'll just force an application update along with the new bootloader.

    So if anyone from Nordic is listening, a proper way would be appreciated...

Reply
  • There is code in nrf_dfu_settings that suggests Nordic had planned a proper (or at least standard) way for the application to read the settings (NRF_DFU_SETTINGS_IN_APP), but it seems that it is not fully implemented.

    Also when generating a bootloader settings page for flashing the bootloader you specify a version for the settings page, but that info doesn't seem to be used by the code actually reading the settings.

    I ended up assuming the structure is fixed. And if it ever does  change I'll just force an application update along with the new bootloader.

    So if anyone from Nordic is listening, a proper way would be appreciated...

Children
No Data
Related