feat(boards): Add support for nRF5340 DK

Added overlays to support building for the nRF5340 development kit.

Also added some documentation on how to build and flash ZMK for dual-
chip Bluetooth configurations, with an example for the nRF5340.
This commit is contained in:
Joel Spadin 2022-12-01 12:34:22 -06:00 committed by Pete Johanson
parent 001105e318
commit 593db85378
2 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,15 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
# Default main stack size is too small for HCI RPMsg
CONFIG_MAIN_STACK_SIZE=2048

View file

@ -140,3 +140,23 @@ your board and run the following command to flash:
```
west flash
```
## Multi-CPU and Dual-Chip Bluetooth Boards
Zephyr supports running the Bluetooth host and controller on separate processors. In such a configuration, ZMK always runs on the host processor, but you may need to build and flash separate firmware for the controller. Zephyr provides sample code which can be used as the controller firmware for Bluetooth HCI over [RPMsg](https://docs.zephyrproject.org/latest/samples/bluetooth/hci_rpmsg/README.html), [SPI](https://docs.zephyrproject.org/latest/samples/bluetooth/hci_spi/README.html), [UART](https://docs.zephyrproject.org/latest/samples/bluetooth/hci_uart/README.html), and [USB](https://docs.zephyrproject.org/latest/samples/bluetooth/hci_usb/README.html). See [Zephyr's Bluetooth Stack Architecture documentation](https://docs.zephyrproject.org/latest/connectivity/bluetooth/bluetooth-arch.html) for more details.
The following documentation shows how to build and flash ZMK for boards that use a dual-chip configuration.
### nRF5340
To build and flash the firmware for the nRF5340 development kit's network core, run the following command from the root of the ZMK repo:
```sh
cd zephyr/samples/bluetooth/hci_rpmsg
west build -b nrf5340dk_nrf5340_cpunet
west flash
```
You can then build and flash ZMK firmware using the normal steps described above. The network core's firmware only needs to be updated whenever ZMK upgrades to a new version of Zephyr.
For a custom nRF5340-based board, you will need to define two Zephyr boards: one for the application core and one for the network core. The [nRF5340 DK's board definition](https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/arm/nrf5340dk_nrf5340) can be used as reference. Replace `nrf5340dk_nrf5340_cpunet` with the name of your network core board.