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

Feature request: new DFU bootloader callback to dfu_observer after transports are initialized, but before loop_forever() is called

In the secure DFU bootloader, I have some custom initialization that I need to happen after the BLE transport is initialized in nrf_dfu_init(), but before loop_forever() in nrf_bootloader.c is called. I'd prefer to do that initialization in main.c rather than having to modify your nrf_dfu_init(). Currently nrf_dfu_init() calls the dfu_observer function with an event NRF_DFU_EVT_DFU_INITIALIZED right before it initializes the transports. Could you please add a new event such as NRF_DFU_EVT_DFU_TRANSPORTS_INITIALIZED, and call the dfu observer with that event right after the transports are initialized?

Parents
  • Hi,

    I have not seen any similar request earlier, but I will make an internal feature request describing your reasoning for wanting this event. You should not expect this to be included in an updated SDK anytime soon though, so if you need it you should implement it yourself (even if that means that you have to modify the SDK code).

  • Sure, I can do that pretty easily. It's just my preference to avoid modifications to the SDK as much as possible. I certainly don't expect that you would add this on any particular schedule, though if it could be added in SDK 16 that would be nice.

    Alternatively to my original suggestion, it might also work to move the call with NRF_DFU_EVT_DFU_INITIALIZED to after the transport initialization, rather than having two separate events, but I don't know whether that might cause problems elsewhere, hence my suggestion to just add a separate event for it.

    Thanks!

  • Similarly, it would be nice to have an event called from near the start of nrf_bootloader_app_start(), before turning off interrupts, so that my event handler can call the *_uninit() functions for any hardware it has initialized (e.g., PWM for an LCD display backlight), to ensure that the application starts without any hardware peripherals still running.

    Initially I tried putting my hardware uninitialization in main() just before nrf_bootloader_app_start() is called from there, but that wasn't satisfactory because that's not the only place that invokes nrf_bootloader_app_start().

    As with my original request, this is easily done if I modify the SDK bootloader code myself, but what I am requesting is of general enough utility that it should be possible to do it without modifying the library.

Reply
  • Similarly, it would be nice to have an event called from near the start of nrf_bootloader_app_start(), before turning off interrupts, so that my event handler can call the *_uninit() functions for any hardware it has initialized (e.g., PWM for an LCD display backlight), to ensure that the application starts without any hardware peripherals still running.

    Initially I tried putting my hardware uninitialization in main() just before nrf_bootloader_app_start() is called from there, but that wasn't satisfactory because that's not the only place that invokes nrf_bootloader_app_start().

    As with my original request, this is easily done if I modify the SDK bootloader code myself, but what I am requesting is of general enough utility that it should be possible to do it without modifying the library.

Children
No Data
Related