Modifying mcuboot-based bootloader source code

Hello, I want to modify ncs\v2.2.0\bootloader\mcuboot\boot\zephyr main.c code of BLE OTA bootloader, but I need to move its code inside my application firmware repository folder except mcuboot, ncs and third party stuff. Then I want to link this bootloader to my application through prj.conf of the application. How to do it in proper way? Thanks.

Target board: nRF5340-DK 400432

The reason I need to modify the original bootloader code is that I want to add "Enter to boot mode by button pressing at startup" feature. If I press the button upon turn on, the bootloader should not run the main firmware but should wait in "boot mode" for BLE connections.

After providing path for nrf sdk boot directory, I got the same error as in this question.

Thanks.

Parents
  • Hi,

    First, I will specify some things for my following explanation:

    An SMP Server is a server running on the device to receive an DFU update.

    The SMP Server can either run in the Application or in MCUboot:

    Image from my unofficial bootloader guide.

    In the nRF Connect SDK we do not have support for Bluetooth Low Energy in the bootloader.
    Therefore, if you want to do DFU over Bluetooth Low Energy, I recommend that you run the SMP Server in your Application.

    Then to your use-case:

    I want to modify ncs\v2.2.0\bootloader\mcuboot\boot\zephyr main.c code of BLE OTA bootloader, but I need to move its code inside my application firmware repository folder except mcuboot, ncs and third party stuff. Then I want to link this bootloader to my application through prj.conf of the application. How to do it in proper way? Thanks.

    I suspect this is not the way to achieve what you need.
    We already have Serial Recovery which you can trigger with a button press.

    But as stated above, MCUboot does not support DFU over Bluetooth Low Energy.
    I would not recommend making large changes to MCUboot, such as adding Bluetooth Low Energy capabilities to it.

    I suggest that you first have a look at your DFU design first. So I will ask the following:

    If I press the button upon turn on, the bootloader should not run the main firmware but should wait in "boot mode" for BLE connections.

    Was your intention to run the SMP Server in the bootloader or in the application?
    Or something else?

    Regards,
    Sigurd Hellesvik

    Regards,
    Sigurd Hellesvik

  • Thanks,

    I want to run SMP in bootloader to gain stability (I am not planning to update the bootloader itself)

Reply Children
  • timuritxs said:
    I want to run SMP in bootloader to gain stability (I am not planning to update the bootloader itself)

    The nRF Connect SDK does not have support for Bluetooth Low Energy in the bootloader.

    If you do not think it is stable enough to run an SMP Server in your application, you will have to do some work yourself.

    I have discussed this challenge with another customer in  BLE Recovery Image .
    Maybe read through that one, and maybe you can get some ideas about how to do this.
    PS: I was first very against an BLE Recovery image in my first comment, but the customer convinsed me a bit, so remember to also have a look at my second comment.

    In this, I also give some reasons to why you do not want to add Bluetooth Low Energy to MCUboot.

    Was this helpful?

    Regards,
    Sigurd Hellesvik

Related