1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards: Add support for the WeMos-Zero

This is an Arduino Zero clone without the embedded debugger. Thus, it will be
flashed by default using the U2F bootloader and uses by default USB CDC ACM for
STDIO.
This commit is contained in:
Marian Buschsieweke 2020-06-03 22:13:13 +02:00
parent de189a33f4
commit 8b9a98233e
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
5 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,6 @@
MODULE = board
DIRS += $(RIOTBOARD)/common/samd21-arduino-bootloader
DIRS += $(RIOTBOARD)/common/arduino-zero
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,12 @@
include $(RIOTBOARD)/common/arduino-zero/Makefile.dep
# use arduino-bootloader only if no other stdio_% other than stdio_cdc_acm
# is requested
ifeq (,$(filter-out stdio_cdc_acm,$(filter stdio_%,$(USEMODULE))))
USEMODULE += boards_common_samd21-arduino-bootloader
endif
ifneq (,$(filter boards_common_samd21-arduino-bootloader,$(USEMODULE)))
# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.dep
endif

View File

@ -0,0 +1,3 @@
include $(RIOTBOARD)/common/arduino-zero/Makefile.features
FEATURES_PROVIDED += bootloader_arduino

View File

@ -0,0 +1,18 @@
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
CFLAGS += -DBOOTLOADER_UF2
# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
# setup the flash tool used
ifeq ($(PROGRAMMER),jlink)
# in case J-Link is attached to SWD pins, use a plain CPU memory model
JLINK_DEVICE := atsamd21
include $(RIOTMAKE)/tools/jlink.inc.mk
endif
# Include all definitions for flashing with bossa other USB
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.include
include $(RIOTBOARD)/common/arduino-zero/Makefile.include

61
boards/wemos-zero/doc.txt Normal file
View File

@ -0,0 +1,61 @@
/**
@defgroup boards_wemos-zero WeMos Arduino Zero Clone
@ingroup boards
@brief Support for the WeMos Arduino Zero Clone board.
## Overview
The WeMos Zero is a cheap clone of Arduino Zero featuring a ATSAMD21G18A.
Unlike the original Zero, it does not include an embedded debugger/programmer.
Instead, the [UF2 Bootloader](https://github.com/microsoft/uf2-samdx1) is
used to program this board. The SAMD21 is a ARM Cortex-M0+ micro-controller.
It has 256KiB of flash memory and 32KiB of RAM.
Note: The official Arduino Zero using the native USB port and the Adafruit
Metro M0 Express should also work with board definition.
## Hardware
![wemos-zero](https://forum.arduino.cc/index.php?action=dlattach;topic=526753.0;attach=244160)
### MCU
| MCU | ATSAMD21G18A |
|:------------- |:------------------------------------- |
| Family | ARM Cortex-M0+ |
| Vendor | Atmel |
| RAM | 32KiB |
| Flash | 256KiB |
| Frequency | up to 48MHz |
| FPU | no |
| Timers | 6 (1x 16-bit, 2x 24-bit, 3x 32-bit) |
| ADCs | 6x 12-bit channels) |
| UARTs | 2 |
| SPIs | max 6 (see UART) |
| I2Cs | max 6 (see UART) |
| Vcc | 1.8V - 3.6V |
| Datasheet | [Datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/SAM_D21_DA1_Family_Data%20Sheet_DS40001882E.pdf) |
### User Interface
1 LED:
| Device | PIN |
|:------ |:---- |
| LED0 | PA17 |
## Flashing the device
Assuming the [UF2 Bootloader](https://github.com/microsoft/uf2-samdx1) is
installed, just run:
```
make BOARD=wemos-zero flash
```
Hint: You can you press the reset button twice to manually enter the bootloader.
This is helpful if the board has crashed (e.g. due to a failed assert() during
start up).
*/