diff --git a/app/boards/arm/blackpill_f401ce/blackpill_f401ce.zmk.yml b/app/boards/arm/blackpill_f401ce/blackpill_f401ce.zmk.yml new file mode 100644 index 00000000..251d2c27 --- /dev/null +++ b/app/boards/arm/blackpill_f401ce/blackpill_f401ce.zmk.yml @@ -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] diff --git a/app/boards/arm/blackpill_f411ce/blackpill_f411ce.zmk.yml b/app/boards/arm/blackpill_f411ce/blackpill_f411ce.zmk.yml new file mode 100644 index 00000000..eaa714d6 --- /dev/null +++ b/app/boards/arm/blackpill_f411ce/blackpill_f411ce.zmk.yml @@ -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] diff --git a/app/boards/arm/pillbug/Kconfig b/app/boards/arm/pillbug/Kconfig new file mode 100644 index 00000000..3d53e324 --- /dev/null +++ b/app/boards/arm/pillbug/Kconfig @@ -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) diff --git a/app/boards/arm/pillbug/Kconfig.board b/app/boards/arm/pillbug/Kconfig.board new file mode 100644 index 00000000..70232e18 --- /dev/null +++ b/app/boards/arm/pillbug/Kconfig.board @@ -0,0 +1,6 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config BOARD_PILLBUG + bool "PillBug" + depends on SOC_NRF52840_QIAA diff --git a/app/boards/arm/pillbug/Kconfig.defconfig b/app/boards/arm/pillbug/Kconfig.defconfig new file mode 100644 index 00000000..8657f8ae --- /dev/null +++ b/app/boards/arm/pillbug/Kconfig.defconfig @@ -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 diff --git a/app/boards/arm/pillbug/blackpill_pins.dtsi b/app/boards/arm/pillbug/blackpill_pins.dtsi new file mode 100644 index 00000000..e7e35140 --- /dev/null +++ b/app/boards/arm/pillbug/blackpill_pins.dtsi @@ -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 {}; diff --git a/app/boards/arm/pillbug/board.cmake b/app/boards/arm/pillbug/board.cmake new file mode 100644 index 00000000..992f395d --- /dev/null +++ b/app/boards/arm/pillbug/board.cmake @@ -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) diff --git a/app/boards/arm/pillbug/pillbug.dts b/app/boards/arm/pillbug/pillbug.dts new file mode 100644 index 00000000..85c5cccd --- /dev/null +++ b/app/boards/arm/pillbug/pillbug.dts @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +/dts-v1/; + +#include +#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>; + }; + }; +}; diff --git a/app/boards/arm/pillbug/pillbug.yaml b/app/boards/arm/pillbug/pillbug.yaml new file mode 100644 index 00000000..50aa4486 --- /dev/null +++ b/app/boards/arm/pillbug/pillbug.yaml @@ -0,0 +1,15 @@ +identifier: pillbug +name: PillBug +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - usb_device + - ble + - ieee802154 + - pwm + - watchdog diff --git a/app/boards/arm/pillbug/pillbug.zmk.yml b/app/boards/arm/pillbug/pillbug.zmk.yml new file mode 100644 index 00000000..5df11b9e --- /dev/null +++ b/app/boards/arm/pillbug/pillbug.zmk.yml @@ -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] diff --git a/app/boards/arm/pillbug/pillbug_defconfig b/app/boards/arm/pillbug/pillbug_defconfig new file mode 100644 index 00000000..d71d9f62 --- /dev/null +++ b/app/boards/arm/pillbug/pillbug_defconfig @@ -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 diff --git a/app/boards/blackpill_f401ce.conf b/app/boards/blackpill_f401ce.conf new file mode 100644 index 00000000..07e304cf --- /dev/null +++ b/app/boards/blackpill_f401ce.conf @@ -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 diff --git a/app/boards/blackpill_f401ce.overlay b/app/boards/blackpill_f401ce.overlay new file mode 100644 index 00000000..54e360a3 --- /dev/null +++ b/app/boards/blackpill_f401ce.overlay @@ -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 {}; diff --git a/app/boards/blackpill_f411ce.conf b/app/boards/blackpill_f411ce.conf new file mode 100644 index 00000000..07e304cf --- /dev/null +++ b/app/boards/blackpill_f411ce.conf @@ -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 diff --git a/app/boards/blackpill_f411ce.overlay b/app/boards/blackpill_f411ce.overlay new file mode 100644 index 00000000..54e360a3 --- /dev/null +++ b/app/boards/blackpill_f411ce.overlay @@ -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 {}; diff --git a/app/boards/interconnects/blackpill/blackpill.zmk.yml b/app/boards/interconnects/blackpill/blackpill.zmk.yml new file mode 100644 index 00000000..d3fcdc88 --- /dev/null +++ b/app/boards/interconnects/blackpill/blackpill.zmk.yml @@ -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. diff --git a/docs/docs/assets/blackpill/blackpill-pins-labelled.png b/docs/docs/assets/blackpill/blackpill-pins-labelled.png new file mode 100644 index 00000000..3f15c620 Binary files /dev/null and b/docs/docs/assets/blackpill/blackpill-pins-labelled.png differ diff --git a/docs/docs/development/new-shield.md b/docs/docs/development/new-shield.md index 565f424c..ea26f6eb 100644 --- a/docs/docs/development/new-shield.md +++ b/docs/docs/development/new-shield.md @@ -115,10 +115,34 @@ endif ## Shield Overlays + + + + +### 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`. + + + + +### 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`. + + + +