From 851e2c5a9a16e0d8635ae5b9cbfb8b28bdcdf9e3 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 8 Oct 2020 21:06:25 +0200 Subject: [PATCH] boards/weact-f401cc: add WeAct-f401cc --- boards/weact-f401cc/Kconfig | 17 +++++++ boards/weact-f401cc/Makefile | 5 ++ boards/weact-f401cc/Makefile.dep | 3 ++ boards/weact-f401cc/Makefile.features | 3 ++ boards/weact-f401cc/Makefile.include | 1 + boards/weact-f401cc/doc.txt | 70 +++++++++++++++++++++++++++ tests/unittests/Makefile.ci | 1 + 7 files changed, 100 insertions(+) create mode 100644 boards/weact-f401cc/Kconfig create mode 100644 boards/weact-f401cc/Makefile create mode 100644 boards/weact-f401cc/Makefile.dep create mode 100644 boards/weact-f401cc/Makefile.features create mode 100644 boards/weact-f401cc/Makefile.include create mode 100644 boards/weact-f401cc/doc.txt diff --git a/boards/weact-f401cc/Kconfig b/boards/weact-f401cc/Kconfig new file mode 100644 index 0000000000..44b01a5f83 --- /dev/null +++ b/boards/weact-f401cc/Kconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Benjamin Valentin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config BOARD + default "weact-f401cc" if BOARD_WEACT_F401CC + +config BOARD_WEACT_F401CC + bool + default y + select BOARD_COMMON_WEACT_F41XCX + select CPU_MODEL_STM32F401CC + +source "$(RIOTBOARD)/common/weact-f4x1cx/Kconfig" diff --git a/boards/weact-f401cc/Makefile b/boards/weact-f401cc/Makefile new file mode 100644 index 0000000000..82b562c121 --- /dev/null +++ b/boards/weact-f401cc/Makefile @@ -0,0 +1,5 @@ +MODULE = board + +DIRS = $(RIOTBOARD)/common/weact-f4x1cx + +include $(RIOTBASE)/Makefile.base diff --git a/boards/weact-f401cc/Makefile.dep b/boards/weact-f401cc/Makefile.dep new file mode 100644 index 0000000000..1087582e39 --- /dev/null +++ b/boards/weact-f401cc/Makefile.dep @@ -0,0 +1,3 @@ +USEMODULE += boards_common_weact-f4x1cx + +include $(RIOTBOARD)/common/weact-f4x1cx/Makefile.dep diff --git a/boards/weact-f401cc/Makefile.features b/boards/weact-f401cc/Makefile.features new file mode 100644 index 0000000000..49c258a11a --- /dev/null +++ b/boards/weact-f401cc/Makefile.features @@ -0,0 +1,3 @@ +CPU_MODEL = stm32f401cc + +include $(RIOTBOARD)/common/weact-f4x1cx/Makefile.features diff --git a/boards/weact-f401cc/Makefile.include b/boards/weact-f401cc/Makefile.include new file mode 100644 index 0000000000..9d911ae4e5 --- /dev/null +++ b/boards/weact-f401cc/Makefile.include @@ -0,0 +1 @@ +include $(RIOTBOARD)/common/weact-f4x1cx/Makefile.include diff --git a/boards/weact-f401cc/doc.txt b/boards/weact-f401cc/doc.txt new file mode 100644 index 0000000000..b6c452992b --- /dev/null +++ b/boards/weact-f401cc/doc.txt @@ -0,0 +1,70 @@ +/** +@defgroup boards_weact-f401cc WeAct-F401CC board +@ingroup boards +@brief Support for the WeAct-F401CC Board + +## Overview + +WeAct-F401CC is a board with the same form-factor as the blue/blackpill, +but with an STM32F401CCU6 and a USB-C connector. + +It is available on sites like AliExpress for less than 3€. + +## Hardware + +![WeAct-F401CC](https://user-images.githubusercontent.com/1301112/69389644-eb5fb080-0ccc-11ea-8002-67d3db851250.png) + +### MCU +| MCU | STM32F401CCU6 | +|:---------------- |:--------------------- | +| Family | ARM Cortex-M4F | +| Vendor | ST Microelectronics | +| RAM | 64KiB | +| Flash | 256KiB | +| Frequency | up to 84MHz | +| FPU | yes | +| Timers | 8 (2x watchdog, 1 SysTick, 6x 16-bit) | +| ADCs | 1x 12-bit | +| UARTs | 3 | +| SPIs | 4 | +| I2Cs | 3 | +| RTC | 1 | +| Vcc | 2.0V - 3.6V | +| Datasheet | [Datasheet](https://www.st.com/resource/en/datasheet/stm32f401cc.pdf) | +| Reference Manual | [Reference Manual](https://www.st.com/content/ccc/resource/technical/document/reference_manual/9b/53/39/1c/f7/01/4a/79/DM00119316.pdf/files/DM00119316.pdf/jcr:content/translations/en.DM00119316.pdf) | + +## Flashing the device +The device comes with a bootloader that allows flashing via `dfu-util`. + +If RIOT is already running on the board, you can upload your RIOT-firmware by typing + +``` +make BOARD=weact-f401cc flash +``` + +RIOT will make sure to enter the bootloader automatically. + +If RIOT crashed or you have the plain board with the stock firmware, you have to enter +the bootloader manually. + +There are two buttons on the board labeled `BOOT0` and `NRST`. + + - Hold down `BOOT0` + - Shortly press `NRST` to reset the CPU while keeping `BOOT0` held down + +The board will now show up as `0483:df11` - `STM32 BOOTLOADER` and will accept +firmware using the DFU protocol. + +*Note:* You need to have write permissions to the device. +On Linux you could add yourself to the `plugdev` group and store the following as `/etc/udev/rules.d/99-weact-f401cc.rules`: + +``` +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", GROUP="plugdev", MODE="660" +``` + +## UART + +stdio is provided through USB CDC ACM so the board can be used +without any extra hardware, save for a USB-C cable. + + */ diff --git a/tests/unittests/Makefile.ci b/tests/unittests/Makefile.ci index f148d5c04f..4d5790d173 100644 --- a/tests/unittests/Makefile.ci +++ b/tests/unittests/Makefile.ci @@ -99,6 +99,7 @@ BOARD_INSUFFICIENT_MEMORY := \ teensy31 \ telosb \ waspmote-pro \ + weact-f401cc \ yarm \ yunjia-nrf51822 \ z1 \