Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/components/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Install updates over-the-air (OTA).
"OTA Core","components/ota/index","system-update.svg","dark-invert"
"OTA Updates","components/ota/esphome","system-update.svg","dark-invert"
"OTA Updates via HTTP Request","components/ota/http_request","system-update.svg","dark-invert"
"OTA Updates for nRF52","components/ota/zephyr_mcumgr","system-update.svg","dark-invert"
{{< /imgtable >}}

## Update Management
Expand Down
1 change: 1 addition & 0 deletions content/components/ota/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Available platforms:
- **esphome**: The default OTA method using ESPHome's native protocol (used by the dashboard and CLI)
- **http_request**: Pull firmware updates from a remote web server
- **web_server**: Enable firmware uploads through the device's web interface
- **zephyr_mcumgr**: Enable firmware upload support for the `nRF52` platform

```yaml
# Example configuration entry
Expand Down
73 changes: 73 additions & 0 deletions content/components/ota/zephyr_mcumgr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
description: "Instructions for setting up ESPHome's nRF52 platform to allow remote firmware updates of devices."
title: "ESPHome nRF52 Firmware Updates"
params:
seo:
description: Instructions for setting up ESPHome's nRF52 platform to allow remote firmware updates of devices.
image: system-update.svg
---

The nRF52 platform supports firmware updates via Over-the-Air (OTA) mechanisms. The **only supported bootloader** for OTA updates is **MCUboot**.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we improve the documentation on what we need around MCUboot? Most of what I read suggests that we only need slot0 partition but I suspect we need at least two slots for MCUBoot? My nice!nano nRF52 currently has an Adarfruit boot loader and I'm not certain what is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best if you could open a PR with redaction of the doc. Push to this branch or just open new PR. I can link it to main PR. nrf52 doc could be improved in few places but I have no much time to think about it.

In the nut shell you need:

  1. flash firmware using SWD e.g. by stlink https://esphome.io/components/nrf52/#flashing-with-mcuboot
  2. From that moment you can flash new firmware using serial, cdc serial or ble

By default it use slot0 and slot1. https://docs.nordicsemi.com/bundle/ncs-latest/page/mcuboot/readme-zephyr.html


To flash firmware onto the device, you can use any of the tools or libraries listed in the [Zephyr MCUmgr documentation](https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr.html#tools-libraries).
Firmware updates are also available via the ESPHome command-line interface.
For flashing over **BLE**, the [MCUmgr Web Tool](https://boogie.github.io/mcumgr-web/) provides a convenient browser-based interface.

```yaml
# Example configuration entry
ota:
- platform: zephyr_mcumgr
```

## Configuration variables

- **transport** (*Optional*, mapping): Specifies the transport method used by Zephyr MCUmgr for OTA updates. By default, Bluetooth Low Energy (`ble: true`) is enabled.

## `transport`

Zephyr MCUmgr can operate over multiple transport protocols, which are selected via configuration options.

```yaml
# Example configuration entry
ota:
- platform: zephyr_mcumgr
transport:
ble: true
hardware_uart: CDC
```

### Configuration variables

- **ble** (*Optional*, boolean): Enable Bluetooth Low Energy transport for MCUmgr OTA. Default `false`.
- **hardware_uart** (*Optional*, enum): Select a hardware UART interface to use for MCUmgr OTA communication. This is used when updating devices over a serial interface rather than BLE. Options: `CDC`, `CDC1`, `UART0`, `UART1`.

## Usage

To connect and update the device over BLE:

```bash
esphome upload h.yaml --device BLE
```

Or connect to a specific BLE address:

```bash
esphome upload h.yaml --device 00:11:22:33:44:55
```

To connect and update the device over serial:

```bash
esphome upload h.yaml
```

Or connect to a specific serial:

```bash
esphome upload h.yaml --device /dev/ttyACM0
```

## See Also

- {{< apiref "ota/ota_component.h" "ota/ota_component.h" >}}
- {{< docref "/components/ota" >}}