[nrf52832] NCS sample & instruction for custom bootloader.

Hello Nordic,

I am looking for a sample or instruction (step by step) for custom bootloader.

Our application code is ready and all the left thing is BLE DFU and custom bootloader which should give HIGH on a specific GPIO.

I couldn't find any proper repo or instruction for it.

NCS version: v2.6.1

  • Hello,

    I am a bit confused about the term custom bootloader here. Are you planning to implement a completely custom bootloader, or are you planning to add custom functionality to MCUboot?

    MCUboot ( bootloader) is integrated with the nRF Connect SDK and is the default bootloader for device firmware updates, including BLE DFU. See the MCUboot documentation for more details.

    You can also take a look at the section DFU over Bluetooth, which guides you on how to configure the application for this purpose.

    Kind regards,
    Abhijith

  • Hi,

    1) I want to add functionalities at bootloader code like GPIO controls.

    2) My dev machine is macOS. I want to know if there's way to write code for bootloader (mcu boot) not at the default system path. Code should be managed using git.

    >> Any suggestions? I guess, there must be a procedure/guidance for it.

  • Hello,

    Sorry for the delayed response it’s currently the summer vacation period here in Norway, which caused a delay in getting back to you on this issue.

    You can apply project specific configuration using a .conf file (Kconfig fragments). This allows for GPIO or other functionality customization at build time. See the section on customizing the bootloader.For example: west build -b your_board -- -Dmcuboot_EXTRA_CONF_FILE=custom_mcuboot.conf, Here, custom_mcuboot.conf can live in your Git repository and lets you apply temporary or project specific settings without hardcoding them into the MCUboot source.

    If you need different bootloader behavior across multiple projects, consider maintaining separate MCUboot Git repositories per project. Each can have its own custom logic. See this devzone ticket for an explanation on how to build MCUboot separately.

    There’s also a method discussed in another DevZone case that explains how to add new functionalities to MCUboot without forking it. This approach keeps MCUboot unmodified and fully under your control in Git.

    Kind Regards,

    Abhijith

Related