feat(boards): Add PillBug board, blackpill interconnect.

* Add blackbill interconnect metadata.
* Add config/overlay for upstream blackpill boards to work with ZMK.
* Add pillbug board.
* Updated new shield docs.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
This commit is contained in:
Kyle McCreery 2022-12-10 23:01:37 -05:00 committed by GitHub
parent 36ee1f4e0a
commit 70aa4fa824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 439 additions and 0 deletions

View File

@ -0,0 +1,9 @@
file_format: "1"
id: blackpill_f401ce
name: BlackPill F401CE
type: board
arch: arm
outputs:
- usb
url: https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1
exposes: [blackpill]

View File

@ -0,0 +1,9 @@
file_format: "1"
id: blackpill_f411ce
name: BlackPill F411CE
type: board
arch: arm
outputs:
- usb
url: https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1
exposes: [blackpill]

View File

@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on (BOARD_PILLBUG)

View File

@ -0,0 +1,6 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_PILLBUG
bool "PillBug"
depends on SOC_NRF52840_QIAA

View File

@ -0,0 +1,25 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
if BOARD_PILLBUG
config BOARD
default "PillBug"
if USB_DEVICE_STACK
config USB_NRFX
default y
endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_PILLBUG

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2022 Kyle McCreery
*
* SPDX-License-Identifier: MIT
*/
/ {
blackpill: connector {
compatible = "blackpill";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map
= <2 0 &gpio0 9 0> /* PC13 */
, <3 0 &gpio0 10 0> /* PC14 */
, <4 0 &gpio1 6 0> /* PC15 */
, <10 0 &gpio0 25 0> /* PA0 */
, <11 0 &gpio0 5 0> /* PA1 */
, <12 0 &gpio1 15 0> /* PA2 */
, <13 0 &gpio0 2 0> /* PA3 */
, <14 0 &gpio1 11 0> /* PA4 */
, <15 0 &gpio1 8 0> /* PA5 */
, <16 0 &gpio0 26 0> /* PA6 */
, <17 0 &gpio0 11 0> /* PA7 */
, <18 0 &gpio1 9 0> /* PB0 */
, <19 0 &gpio1 14 0> /* PB1 */
, <20 0 &gpio0 3 0> /* PB2 */
, <21 0 &gpio0 31 0> /* PB10 */
, <25 0 &gpio0 12 0> /* PB12 */
, <26 0 &gpio0 19 0> /* PB13 */
, <27 0 &gpio1 1 0> /* PB14 */
, <28 0 &gpio0 29 0> /* PB15 */
, <29 0 &gpio1 13 0> /* PA8 */
, <30 0 &gpio0 6 0> /* PA9 */
, <31 0 &gpio0 8 0> /* PA10 */
, <38 0 &gpio1 0 0> /* PA15 */
, <39 0 &gpio1 10 0> /* PB3 */
, <40 0 &gpio1 2 0> /* PB4 */
, <41 0 &gpio1 4 0> /* PB5 */
, <42 0 &gpio0 13 0> /* PB6 */
, <43 0 &gpio0 15 0> /* PB7 */
, <45 0 &gpio0 17 0> /* PB8 */
, <46 0 &gpio0 24 0> /* PB9 */
;
};
};
blackpill_i2c: &i2c0 {};
blackpill_spi: &spi1 {};
blackpill_serial: &uart0 {};

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: MIT
set(OPENOCD_NRF5_SUBFAMILY nrf52)
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)

View File

@ -0,0 +1,132 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "blackpill_pins.dtsi"
/ {
model = "PillBug";
compatible = "pillbug";
chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
};
leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
label = "Blue LED";
};
};
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
init-delay-ms = <50>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 820000)>;
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&i2c0 {
compatible = "nordic,nrf-twi";
sda-pin = <15>;
scl-pin = <13>;
};
&spi1{
status = "disabled";
compatible = "nordic,nrf-spim";
sck-pin = <40>;
mosi-pin = <11>;
miso-pin = <26>;
};
&uart0 {
compatible = "nordic,nrf-uarte";
tx-pin = <6>;
rx-pin = <8>;
};
&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
sd_partition: partition@0 {
label = "mbr";
reg = <0x00000000 0x00001000>;
};
code_partition: partition@1000 {
label = "code_partition";
reg = <0x00001000 0x000d3000>;
};
/*
* The flash starting at 0x000d4000 and ending at
* 0x000f3fff is reserved for use by the application.
*/
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@d4000 {
label = "storage";
reg = <0x000d4000 0x00020000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};
};

View File

@ -0,0 +1,15 @@
identifier: pillbug
name: PillBug
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- ble
- ieee802154
- pwm
- watchdog

View File

@ -0,0 +1,10 @@
file_format: "1"
id: pillbug
name: PillBug
type: board
arch: arm
outputs:
- usb
- ble
url: https://mechwild.com/product/pillbug
exposes: [blackpill]

View File

@ -0,0 +1,22 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_PILLBUG=y
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=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

View File

@ -0,0 +1,7 @@
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=n
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y

View File

@ -0,0 +1,51 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/ {
blackpill: connector {
compatible = "blackpill";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map
= <2 0 &gpioc 13 0> /* PC13 */
, <3 0 &gpioc 14 0> /* PC14 */
, <4 0 &gpioc 15 0> /* PC15 */
, <10 0 &gpioa 0 0> /* PA0 */
, <11 0 &gpioa 1 0> /* PA1 */
, <12 0 &gpioa 2 0> /* PA2 */
, <13 0 &gpioa 3 0> /* PA3 */
, <14 0 &gpioa 4 0> /* PA4 */
, <15 0 &gpioa 5 0> /* PA5 */
, <16 0 &gpioa 6 0> /* PA6 */
, <17 0 &gpioa 7 0> /* PA7 */
, <18 0 &gpiob 0 0> /* PB0 */
, <19 0 &gpiob 1 0> /* PB1 */
, <20 0 &gpiob 2 0> /* PB2 */
, <21 0 &gpiob 10 0> /* PB10 */
, <25 0 &gpiob 12 0> /* PB12 */
, <26 0 &gpiob 13 0> /* PB13 */
, <27 0 &gpiob 14 0> /* PB14 */
, <28 0 &gpiob 15 0> /* PB15 */
, <29 0 &gpioa 8 0> /* PA8 */
, <30 0 &gpioa 9 0> /* PA9 */
, <31 0 &gpioa 10 0> /* PA10 */
, <38 0 &gpioa 15 0> /* PA15 */
, <39 0 &gpiob 3 0> /* PB3 */
, <40 0 &gpiob 4 0> /* PB4 */
, <41 0 &gpiob 5 0> /* PB5 */
, <42 0 &gpiob 6 0> /* PB6 */
, <43 0 &gpiob 7 0> /* PB7 */
, <45 0 &gpiob 8 0> /* PB8 */
, <46 0 &gpiob 9 0> /* PB9 */
;
};
};
blackpill_i2c: &i2c1 {};
blackpill_spi: &spi1 {};
blackpill_serial: &usart1 {};

View File

@ -0,0 +1,7 @@
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=n
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y

View File

@ -0,0 +1,51 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/ {
blackpill: connector {
compatible = "blackpill";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map
= <2 0 &gpioc 13 0> /* PC13 */
, <3 0 &gpioc 14 0> /* PC14 */
, <4 0 &gpioc 15 0> /* PC15 */
, <10 0 &gpioa 0 0> /* PA0 */
, <11 0 &gpioa 1 0> /* PA1 */
, <12 0 &gpioa 2 0> /* PA2 */
, <13 0 &gpioa 3 0> /* PA3 */
, <14 0 &gpioa 4 0> /* PA4 */
, <15 0 &gpioa 5 0> /* PA5 */
, <16 0 &gpioa 6 0> /* PA6 */
, <17 0 &gpioa 7 0> /* PA7 */
, <18 0 &gpiob 0 0> /* PB0 */
, <19 0 &gpiob 1 0> /* PB1 */
, <20 0 &gpiob 2 0> /* PB2 */
, <21 0 &gpiob 10 0> /* PB10 */
, <25 0 &gpiob 12 0> /* PB12 */
, <26 0 &gpiob 13 0> /* PB13 */
, <27 0 &gpiob 14 0> /* PB14 */
, <28 0 &gpiob 15 0> /* PB15 */
, <29 0 &gpioa 8 0> /* PA8 */
, <30 0 &gpioa 9 0> /* PA9 */
, <31 0 &gpioa 10 0> /* PA10 */
, <38 0 &gpioa 15 0> /* PA15 */
, <39 0 &gpiob 3 0> /* PB3 */
, <40 0 &gpiob 4 0> /* PB4 */
, <41 0 &gpiob 5 0> /* PB5 */
, <42 0 &gpiob 6 0> /* PB6 */
, <43 0 &gpiob 7 0> /* PB7 */
, <45 0 &gpiob 8 0> /* PB8 */
, <46 0 &gpiob 9 0> /* PB9 */
;
};
};
blackpill_i2c: &i2c1 {};
blackpill_spi: &spi1 {};
blackpill_serial: &usart1 {};

View File

@ -0,0 +1,8 @@
file_format: "1"
id: blackpill
name: BlackPill
type: interconnect
url: https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1
manufacturer: WeAct Studio
description: |
The WeAct Studio BlackPill has grown in popularity due to its low price, availability, and utilization of the powerful STM32F4x1CEU6 microcontroller. The BlackPill features more GPIO than most other boards, but also has a comparatively larger footprint as a result. Many clones and variations of the original BlackPill are available on the market as an affordable and more powerful alternative to many popular boards. The official WeAct variations of the WeAct Studio BlackPill are powered by the STM32F411CEU6 and STM32F401CEU6 microcontrollers.

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 KiB

View File

@ -115,10 +115,34 @@ endif
## Shield Overlays
<Tabs
defaultValue="pro_micro"
values={[
{label: 'Pro Micro Shields', value: 'pro_micro'},
{label: 'BlackPill Shields', value: 'blackpill'},
]}>
<TabItem value="pro_micro">
### Pro Micro Shields
![Labelled Pro Micro pins](../assets/pro-micro/pro-micro-pins-labelled.jpg)
ZMK uses the blue color coded pin names to generate devicetree node references. For example, to refer to the node `0` in the devicetree files, use `&pro_micro 0`.
</TabItem>
<TabItem value="blackpill">
### BlackPill Shields
![Labelled BlackPill pins](../assets/blackpill/blackpill-pins-labelled.png)
ZMK uses the blue color coded pin names to generate devicetree node references. For example, to refer to the node `17` in the devicetree files, use `&blackpill 17`.
</TabItem>
</Tabs>
<Tabs
defaultValue="unibody"
values={[