Jump to bootloader (mcuboot) from application without button

Hi, I'm currently getting familiar with mcuboot and DFU Slight smile

First of all, thank you very much for the new Academy course that covers DFU!

If I understand correctly, to enter the bootloader (for Serial Recovery), the bootloader button has to be activated during startup.

Unfortunately, our hardware is very small and does not have a bootloader button. Is there any possibility to switch from the application into bootloader mode, just like when the button was pressed? E.g. send a specific command via USB (cdc_acm) to the application that enables mcuboot?

Further, is the overlay that I created for my main project (board_name.overlay) also applied to the mcuboot child? Or will I have to create a separate overlay file for mcuboot (child_image\mcuboot.overlay)?

Best regards,

Michael

Parents
  • Hello Michael,

    I'm glad to hear that you enjoyed the DFU course!

    If I understand correctly, to enter the bootloader (for Serial Recovery), the bootloader button has to be activated during startup.

    Yes, you can use a button to signal the bootloader to enter Serial recovery on boot. Another option is to enable the CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y symbol in your bootloader build. This will make the bootloader always enter serial recovery on startup. 

    Further, is the overlay that I created for my main project (board_name.overlay) also applied to the mcuboot child? Or will I have to create a separate overlay file for mcuboot (child_image\mcuboot.overlay)?

    Yes, you will need to create a separate overlay for the mcuboot build. You can do this by creating a child_image folder, as you mentioned. https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/config_and_build/multi_image.html#permanent-configuration-changes-to-child-images 

    Best regards,

    Vidar

  • Hello Vidar,

    thanks for the fast reply. Waiting for DFU increases startup time, so we try to jump from the application into the bootloader under certain conditions. (This way, the bootloader entry could also be hidden or protected.) We used this concept in all our older products, as they are usually deployed in the field and it is not feasible to perform a power cycle for entering the bootloader.

    If I understand correctly, there is no such feature for enabling recovery mode from the application yet? Are there any plans to implement it in the future?

    As a dirty workaround, would it be possible to set a digital output pin in the application and then perform a reset (how can I perform a reset) and the bootloader reads the pin that I just set as a "pressed button"?

    Best regards,

    Michael

Reply
  • Hello Vidar,

    thanks for the fast reply. Waiting for DFU increases startup time, so we try to jump from the application into the bootloader under certain conditions. (This way, the bootloader entry could also be hidden or protected.) We used this concept in all our older products, as they are usually deployed in the field and it is not feasible to perform a power cycle for entering the bootloader.

    If I understand correctly, there is no such feature for enabling recovery mode from the application yet? Are there any plans to implement it in the future?

    As a dirty workaround, would it be possible to set a digital output pin in the application and then perform a reset (how can I perform a reset) and the bootloader reads the pin that I just set as a "pressed button"?

    Best regards,

    Michael

Children
Related