From 7be0703e05fd5c8aed9682348008021771ea3d19 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Sat, 29 Nov 2025 08:30:10 +0100 Subject: [PATCH] doc: nrf-bm: app_dev: dfu: doc on entering the firmware mode Documented mechanism-es for entering the firmware loader mode Signed-off-by: Andrzej Puzdrowski --- doc/nrf-bm/app_dev/dfu/entering_dfu.rst | 38 +++++++++++++++++++++++++ doc/nrf-bm/app_dev/dfu/index.rst | 1 + 2 files changed, 39 insertions(+) create mode 100644 doc/nrf-bm/app_dev/dfu/entering_dfu.rst diff --git a/doc/nrf-bm/app_dev/dfu/entering_dfu.rst b/doc/nrf-bm/app_dev/dfu/entering_dfu.rst new file mode 100644 index 0000000000..bca97442f8 --- /dev/null +++ b/doc/nrf-bm/app_dev/dfu/entering_dfu.rst @@ -0,0 +1,38 @@ +.. _entering_dfu_single_bank: + +Entering single-Bank Device Firmware Update (DFU) mode +###################################################### + +|BMlong| supports a single-bank DFU mechanism. +The device normally executes the application that cannot update itself nor the firmware elements it depends on. +This means that the device running the application must be switched to the DFU mode so that it can run the firmware loader. +The firmware loader is a physically separated firmware entity that provides services for supporting the firmware download to the single bank. +Decision on entering the firmware loader is made by the MCUboot. +The available entering schemes are listed the following sections. + +Entering on GPIO state +********************** + +The firmware loader is entered when the active state of a GPIO pin is asserted during early device startup. +The SoC must be rebooted, for instance, by the board power toggling to perform this action. +Use the :kconfig:option:`SB_CONFIG_BM_BOOTLOADER_MCUBOOT_FIRMWARE_LOADER_ENTRANCE_GPIO` sysbuild Kconfig option to enter this mode. +The GPIO PIN is configured by the defining ``BOARD_PIN_BTN_0`` of the board in its :file:`include/board-config.h` file. + +Entering on reset by PIN +************************ + +The firmware loader is entered when the SoC reset is triggered by the reset pin. +Use the :kconfig:option:`SB_CONFIG_BM_BOOTLOADER_MCUBOOT_FIRMWARE_LOADER_ENTRANCE_PIN_RESET` sysbuild Kconfig option to enter this mode. + +Buttonless entering +******************* + +The firmware loader is entered when the MCUboot detects such request delivered to the retained memory area by the application. +The application must trigger the SoC reset for making MCUboot to perform this action. +Use boot mode API: :c:func:`bootmode_set` and :c:enum:`BOOT_MODE_TYPE_BOOTLOADER` to set the retention boot mode value. +Use the :kconfig:option:`SB_CONFIG_BM_BOOTLOADER_MCUBOOT_FIRMWARE_LOADER_ENTRANCE_BOOT_MODE` sysbuild Kconfig option to enter this mode. + +The SoC's ``GPREGRET1`` register is used as the retained memory area for that purpose. +The board's DTS must describe this register and its assignment to the ``chosen/zephyr,boot-mode`` property. + +This mode is integrated with the MCUmgr OS reset command when the :kconfig:option:`CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE` Kconfig option is enabled. diff --git a/doc/nrf-bm/app_dev/dfu/index.rst b/doc/nrf-bm/app_dev/dfu/index.rst index 11724e7cf3..a30095074e 100644 --- a/doc/nrf-bm/app_dev/dfu/index.rst +++ b/doc/nrf-bm/app_dev/dfu/index.rst @@ -14,3 +14,4 @@ This chapter provides an overview of the Device Firmware Update (DFU) capabiliti bootloader_keys ug_dfu dfu_name + entering_dfu