Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
samples: cert-provsioning: add nRF52840
Browse files Browse the repository at this point in the history
Add board files and documentation to support nRF52840dk in this sample.

Signed-off-by: Mike Szczys <[email protected]>
  • Loading branch information
szczys committed Aug 30, 2023
1 parent a5e81e5 commit c0331f4
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
54 changes: 54 additions & 0 deletions samples/certificate_provisioning/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,60 @@ sample application (i.e. ``samples/certificate_provisioning``) and type:
See `ESP32`_ for details on how to use ESP32 board.

nRF52840 DK + ESP32-WROOM-32
----------------------------

This subsection documents using nRF52840 DK running Zephyr with offloaded ESP-AT
WiFi driver and ESP32-WROOM-32 module based board (such as ESP32 DevkitC rev.
4) running WiFi stack. See `AT Binary Lists`_ for links to ESP-AT binaries and
details on how to flash ESP-AT image on ESP chip. Flash ESP chip with following
command:

.. code-block:: console
esptool.py write_flash --verify 0x0 PATH_TO_ESP_AT/factory/factory_WROOM-32.bin
Connect nRF52840 DK and ESP32-DevKitC V4 (or other ESP32-WROOM-32 based board)
using wires:

+-----------+--------------+
|nRF52840 DK|ESP32-WROOM-32|
| | |
+-----------+--------------+
|P1.01 (RX) |IO17 (TX) |
+-----------+--------------+
|P1.02 (TX) |IO16 (RX) |
+-----------+--------------+
|P1.03 (CTS)|IO14 (RTS) |
+-----------+--------------+
|P1.04 (RTS)|IO15 (CTS) |
+-----------+--------------+
|P1.05 |EN |
+-----------+--------------+
|GND |GND |
+-----------+--------------+

Configure the following Kconfig options based on your WiFi AP credentials:

- GOLIOTH_SAMPLE_WIFI_SSID - WiFi SSID
- GOLIOTH_SAMPLE_WIFI_PSK - WiFi PSK

by adding these lines to configuration file (e.g. ``prj.conf`` or
``board/nrf52840dk_nrf52840.conf``):

.. code-block:: cfg
CONFIG_GOLIOTH_SAMPLE_WIFI_SSID="my-wifi"
CONFIG_GOLIOTH_SAMPLE_WIFI_PSK="my-psk"
On your host computer open a terminal window, locate the source code of this
sample application (i.e., ``samples/certificate_provisioning``) and type:

.. code-block:: console
$ west build -b nrf52840dk_nrf52840 samples/certificate_provisioning
$ west flash
nRF9160 DK
----------

Expand Down
18 changes: 18 additions & 0 deletions samples/certificate_provisioning/boards/nrf52840dk_nrf52840.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# WiFi
CONFIG_WIFI=y
CONFIG_WIFI_ESP_AT=y
CONFIG_WIFI_ESP_AT_MDM_RX_BUF_COUNT=40

CONFIG_NET_L2_WIFI_SHELL=y
CONFIG_GOLIOTH_SAMPLE_WIFI=y

# General config
CONFIG_HEAP_MEM_POOL_SIZE=4096

# MCU Manager
CONFIG_MCUBOOT_BOOTUTIL_LIB=y
CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y
CONFIG_MCUMGR_GRP_FS_FILE_ACCESS_HOOK=y

# Allow reboot from shell after loading certificates
CONFIG_REBOOT=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2021 Golioth, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&uart1_default {
cts-rts {
psels = <NRF_PSEL(UART_CTS, 1, 3)>,
<NRF_PSEL(UART_RTS, 1, 4)>;
};
};

&uart1_sleep {
cts-rts {
psels = <NRF_PSEL(UART_CTS, 1, 3)>,
<NRF_PSEL(UART_RTS, 1, 4)>;
low-power-enable;
};
};

&uart1 {
status = "okay";
hw-flow-control;

esp_wifi: esp-wifi {
compatible = "espressif,esp-at";
power-gpios = <&gpio1 5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
status = "okay";
};
};

0 comments on commit c0331f4

Please sign in to comment.