services/device_mgmt/dfu.html · services/device_mgmt/dfu.rst 공식 원문 ↗

Zephyr 3.7.0 · Device Management

Device Firmware Upgrade

실행 중 firmware image를 관리하고 MCUboot-compatible partition과 image로 다음 boot를 준비합니다.

Official pathservices/device_mgmt/dfu.html
Source fileservices/device_mgmt/dfu.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Flash Image chunk 기록, MCUboot status·image 선택과 partition·Kconfig·flash 순서를 설명합니다.

Modules

boot · img_util

Storage

Flash Stream

Bootloader

MCUboot

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 2659C6988F9729A18DB66C9DB21389A999052EDEF9E888DDF6C173365AEC3184
.. _dfu:

Device Firmware Upgrade
#######################

Overview
********

The Device Firmware Upgrade subsystem provides the necessary frameworks to
upgrade the image of a Zephyr-based application at run time. It currently
consists of two different modules:

* :zephyr_file:`subsys/dfu/boot/`: Interface code to bootloaders
* :zephyr_file:`subsys/dfu/img_util/`: Image management code

The DFU subsystem deals with image management, but not with the transport
or management protocols themselves required to send the image to the target
device. For information on these protocols and frameworks please refer to the
:ref:`device_mgmt` section.

.. _flash_img_api:

Flash Image
===========

The flash image API as part of the Device Firmware Upgrade (DFU) subsystem
provides an abstraction on top of Flash Stream to simplify writing firmware
image chunks to flash.

API Reference
-------------

.. doxygengroup:: flash_img_api

.. _mcuboot_api:

MCUBoot API
===========

The MCUboot API is provided to get version information and boot status of
application images. It allows to select application image and boot type
for the next boot.

API Reference
-------------

.. doxygengroup:: mcuboot_api

Bootloaders
***********

.. _mcuboot:

MCUboot
=======

Zephyr is directly compatible with the open source, cross-RTOS
`MCUboot boot loader`_. It interfaces with MCUboot and is aware of the image
format required by it, so that Device Firmware Upgrade is available when MCUboot
is the boot loader used with Zephyr. The source code itself is hosted in the
`MCUboot GitHub Project`_ page.

In order to use MCUboot with Zephyr you need to take the following into account:

1. You will need to define the flash partitions required by MCUboot; see
   :ref:`flash_map_api` for details.
2. You will have to specify your flash partition as the chosen code partition

.. code-block:: devicetree

   / {
      chosen {
         zephyr,code-partition = &slot0_partition;
      };
   };

3. Your application's :file:`.conf` file needs to enable the
   :kconfig:option:`CONFIG_BOOTLOADER_MCUBOOT` Kconfig option in order for Zephyr to
   be built in an MCUboot-compatible manner
4. You need to build and flash MCUboot itself on your device
5. You might need to take precautions to avoid mass erasing the flash and also
   to flash the Zephyr application image at the correct offset (right after the
   bootloader)

More detailed information regarding the use of MCUboot with Zephyr  can be found
in the `MCUboot with Zephyr`_ documentation page on the MCUboot website.

.. _MCUboot boot loader: https://mcuboot.com/
.. _MCUboot with Zephyr: https://docs.mcuboot.com/readme-zephyr
.. _MCUboot GitHub Project: https://github.com/runtimeco/mcuboot

Part 3

한국어 전문 번역

개요

Device Firmware Upgrade(DFU) subsystem은 실행 중인 Zephyr application image를 upgrade하는 데 필요한 framework를 제공합니다. 현재 두 module로 구성됩니다.

  • subsys/dfu/boot/: bootloader와 연결하는 interface code
  • subsys/dfu/img_util/: image management code

DFU subsystem은 image management를 담당하지만 image를 target device에 보내는 transport나 management protocol 자체는 다루지 않습니다. 이러한 protocol과 framework는 Device Management 절을 참고합니다.

Flash Image

DFU subsystem의 Flash Image API는 Flash Stream 위에 abstraction을 제공해 firmware image chunk를 flash에 기록하는 작업을 단순화합니다.

API Reference

원문의 Doxygen group flash_img_api에 Flash Image API가 수록됩니다.

MCUboot API

MCUboot API는 application image의 version information과 boot status를 가져옵니다. 다음 boot에 사용할 application image와 boot type도 선택할 수 있습니다.

API Reference

원문의 Doxygen group mcuboot_api에 MCUboot 연동 API가 수록됩니다.

Bootloader

MCUboot

Zephyr는 open-source cross-RTOS MCUboot bootloader와 직접 호환됩니다. MCUboot interface와 필요한 image format을 이해하므로 Zephyr에서 MCUboot를 bootloader로 사용하면 DFU를 이용할 수 있습니다. Source code는 MCUboot GitHub project에 있습니다.

Zephyr에서 MCUboot를 사용하려면 다음 사항을 적용합니다.

  1. MCUboot가 요구하는 flash partition을 정의합니다. 세부 사항은 Flash Map API를 참고합니다.
  2. Flash partition을 chosen code partition으로 지정합니다.
    / {
       chosen {
          zephyr,code-partition = &slot0_partition;
       };
    };
  3. Application의 .conf에서 CONFIG_BOOTLOADER_MCUBOOT Kconfig option을 enable해 Zephyr를 MCUboot-compatible 방식으로 build합니다.
  4. MCUboot 자체를 build해 device에 flash합니다.
  5. Flash 전체가 mass erase되지 않게 주의하고, Zephyr application image를 bootloader 바로 뒤의 올바른 offset에 flash해야 할 수 있습니다.

더 자세한 내용은 MCUboot website의 MCUboot with Zephyr 문서를 참고합니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.