Hi
using NRF5_SDK 17.0.2
I'm trying to better understand the DFU process, currently have a large number of questions. But mainly i would like to better understand the generation & handling of the bootloader file itself.
I keep seeing references to the booloader examples as a means to get a hold of a bootloader binarys, this seems a little weird, is there not a master location from which I can download a suitable bootloader binary?
it is unclear from the documentation if i have to manually compile some code to produce the bootloader binary? I keep seeing references to "build the bootloader example", surely the example code isn't required for bespoke applications?
I am confused by the source code for the DFU example, it seems to reference events generated by the bootloader which are handled through a registered observer, similar to how the softdevice observers operate, so what is the purpose of this example code? Is it purely to demonstrate the bootloader (the binary for which i must find elsewhere?) Or is it to actually generate a bootloader binary? - The example i'm looking at is below.
Where to do I modify the bootloader settings (such as altering the pins that are turned on (LED's) when the device enters DFU mode? Can this be done before runtime? Should I do this from my application code? If so this seems inconvenient as this requires me to implement code in my firmware for to handle first boot scenarios, or Repeating code on startup that need only be done once in the products life...
How do i generate the bootloader settings section of memory, is there a default version of this that I should flash to the chip along with the bootloader? Is there a published format for this?
There seems to be plenty of documentation about how to carry out a firmware update using the bootloader & DFU mode, but nothing overly detailed when it comes to the initial programming process for the device? How are initial values for HW & FW versions embedded? Where does the initial MBR come from? Do I have to generate these? Is there a zip file i can generate, comparable to the one used for DFU's that i can use for the initial flashing of a product?
/**@brief Function for application main entry. */ int main(void) { uint32_t ret_val; // Must happen before flash protection is applied, since it edits a protected page. nrf_bootloader_mbr_addrs_populate(); // Protect MBR and bootloader code from being overwritten. ret_val = nrf_bootloader_flash_protect(0, MBR_SIZE); APP_ERROR_CHECK(ret_val); ret_val = nrf_bootloader_flash_protect(BOOTLOADER_START_ADDR, BOOTLOADER_SIZE); APP_ERROR_CHECK(ret_val); (void) NRF_LOG_INIT(nrf_bootloader_dfu_timer_counter_get); NRF_LOG_DEFAULT_BACKENDS_INIT(); NRF_LOG_INFO("Inside main"); ret_val = nrf_bootloader_init(dfu_observer); APP_ERROR_CHECK(ret_val); NRF_LOG_FLUSH(); NRF_LOG_ERROR("After main, should never be reached."); NRF_LOG_FLUSH(); APP_ERROR_CHECK_BOOL(false); } /** * @} */
I've read through all the available documentation I can find on the infocentre. Think i'm in need of a clearer explanation on where the bootloaders can be found/generated/packaged, whatever.
Thanks,
Sean