NRF52 Platform¶
This component contains platform-specific options for the NRF52 platform.
Note
Support for all aspects of ESPHome on the NRF52 is still in development.
# Example configuration entry
nrf52:
board: adafruit_feather_nrf52840
Configuration variables:¶
board (Required, string): The board type. Valid options are
adafruit_feather_nrf52840
,adafruit_itsybitsy_nrf52840
,xiao_ble
. Other boards should work with those configuration as well.bootloader (Optional, string): Bootloader type. Valid options are
mcuboot
,adafruit
,adafruit_nrf52_sd132
,adafruit_nrf52_sd140_v6
,adafruit_nrf52_sd140_v7
. Default value depends on board type.
Getting Started¶
The nRF52840 requires a bootloader, with two supported options: MCUboot
and Adafruit nRF52 Bootloader
. It is recommended to use MCUboot as it supports OTA (Over-The-Air) updates. Your board most likely comes with a manufacturer-provided bootloader. ESPHome determines the bootloader type based on the board name.
Examples of low power nRF52840 boards.
Flashing with MCUboot¶
Flashing this bootloader requires an SWD connection, for which a programmer is necessary. A cheap ST-Link V2 can be utilized.
Connect the board to the PC via SWD.
Run
esphome upload yourfile.yaml --device PYOCD
.
# Example configuration entry
nrf52:
board: adafruit_feather_nrf52840
Flashing with Adafruit nRF52 Bootloader¶
For flashing via a flash drive.
Connect the board to the PC via USB.
Quickly short the reset pin to ground twice.
Copy the UF2 package to the flash drive.
This bootloader supports updates over USB CDC.
Connect the board to the PC via USB.
Quickly short the reset pin to ground twice.
Run
esphome upload yourfile.yaml
.
# Example configuration entry
nrf52:
board: adafruit_itsybitsy_nrf52840
GPIO Pin Numbering¶
There are two ways to reference GPIO pins:
By pin name, e.g.,
P0.15
orP1.11
.By pin number, e.g.,
15
or43
.