1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #14198 from maribu/wemos-zero

boards: Add support for the wemos-zero board
This commit is contained in:
benpicco 2020-06-05 17:55:43 +02:00 committed by GitHub
commit cb11b2d33f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 156 additions and 60 deletions

View File

@ -1,3 +1,5 @@
MODULE = board
DIRS = $(RIOTBOARD)/common/arduino-zero
include $(RIOTBASE)/Makefile.base

View File

@ -1,3 +1 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/arduino-zero/Makefile.dep

View File

@ -1,17 +1 @@
CPU = samd21
CPU_MODEL = samd21g18a
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pwm
include $(RIOTBOARD)/common/arduino-zero/Makefile.features

View File

@ -1 +1 @@
include $(RIOTMAKE)/boards/sam0.inc.mk
include $(RIOTBOARD)/common/arduino-zero/Makefile.include

View File

@ -0,0 +1,3 @@
MODULE = boards_common_arduino_zero
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,5 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
USEMODULE += boards_common_arduino_zero

View File

@ -0,0 +1,17 @@
CPU = samd21
CPU_MODEL ?= samd21g18a
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pwm

View File

@ -0,0 +1,5 @@
INCLUDES += -I$(RIOTBOARD)/common/arduino-zero/include
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/arduino-zero/dist/openocd.cfg
include $(RIOTMAKE)/boards/sam0.inc.mk

View File

@ -8,11 +8,12 @@
*/
/**
* @ingroup boards_arduino-zero
* @ingroup boards_common_arduino_zero
* @{
*
* @file
* @brief Board specific implementations for the Arduino Zero board
* @brief Board specific implementations for the Arduino Zero board and
* clones
*
* @author Hauke Pertersen <hauke.pertersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>

View File

@ -8,7 +8,7 @@
*/
/**
* @ingroup boards_arduino-zero
* @ingroup boards_common_arduino_zero
* @{
*
* @file

View File

@ -7,7 +7,7 @@
*/
/**
* @ingroup boards_arduino-zero
* @ingroup boards_common_arduino_zero
* @{
*
* @file

View File

@ -7,12 +7,13 @@
*/
/**
* @ingroup boards_arduino-zero
* @defgroup boards_common_arduino_zero Common files of Arduino Zero and clones
* @ingroup boards_common
*
* @{
*
* @file
* @brief Board specific definitions for the Arduino Zero
* board
* @brief Board specific definitions for the Arduino Zero board and clones
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/

View File

@ -8,7 +8,7 @@
*/
/**
* @ingroup boards_arduino-zero
* @ingroup boards_common_arduino_zero
* @{
*
* @file

View File

@ -8,11 +8,12 @@
*/
/**
* @ingroup boards_arduino-zero
* @ingroup boards_common_arduino_zero
* @{
*
* @file
* @brief Configuration of CPU peripherals for Arduino Zero board
* @brief Configuration of CPU peripherals for Arduino Zero board and
* clones
*
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>

View File

@ -1,17 +1,6 @@
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 handling of serial and non-bossa programmers (if selected by user)
include $(RIOTMAKE)/boards/sam0.inc.mk

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,5 @@
CFLAGS += -DBOOTLOADER_UF2
# 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).
*/

View File

@ -81,5 +81,6 @@ BOARD_INSUFFICIENT_MEMORY := \
stm32f0discovery \
stm32f3discovery \
stm32l0538-disco \
wemos-zero \
yunjia-nrf51822 \
#

View File

@ -22,30 +22,31 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# Default for these boards is to use a CMSIS-DAP programmer
DEBUG_ADAPTER ?= dap
# EDBG can only be used with a compatible Atmel programmer
ifeq ($(DEBUG_ADAPTER),dap)
# set this to either openocd, jlink or edbg
PROGRAMMER ?= edbg
else ifeq ($(DEBUG_ADAPTER),jlink)
# only use JLinkExe if it's installed
ifneq (,$(shell which JLinkExe))
PROGRAMMER ?= jlink
# If no programmer is set, select a default programmer
ifeq ($(PROGRAMMER),)
# EDBG can only be used with a compatible Atmel programmer
ifeq ($(DEBUG_ADAPTER),dap)
# set this to either openocd, jlink or edbg
PROGRAMMER ?= edbg
else ifeq ($(DEBUG_ADAPTER),jlink)
# only use JLinkExe if it's installed
ifneq (,$(shell which JLinkExe))
PROGRAMMER ?= jlink
else
PROGRAMMER ?= openocd
endif
else
PROGRAMMER ?= openocd
endif
else
PROGRAMMER ?= openocd
endif
# use edbg if selected and a device type has been set
ifeq ($(PROGRAMMER),edbg)
# use edbg for flashing
include $(RIOTMAKE)/tools/edbg.inc.mk
endif
ifeq ($(PROGRAMMER),jlink)
else ifeq ($(PROGRAMMER),jlink)
# this board uses J-Link for debug and possibly flashing
include $(RIOTMAKE)/tools/jlink.inc.mk
else
else ifeq ($(PROGRAMMER),openocd)
# this board uses openocd for debug and possibly flashing
include $(RIOTMAKE)/tools/openocd.inc.mk
endif

View File

@ -50,6 +50,7 @@ LOW_MEMORY_BOARDS += \
opencm904 \
saml10-xpro \
saml11-xpro \
serpente \
sodaq-autonomo \
sodaq-explorer \
sodaq-one \
@ -59,6 +60,7 @@ LOW_MEMORY_BOARDS += \
stm32l0538-disco \
telosb \
waspmote-pro \
wemos-zero \
wsn430-v1_3b \
wsn430-v1_4 \
yunjia-nrf51822 \

View File

@ -1,5 +1,4 @@
BOARD_INSUFFICIENT_MEMORY := \
im880b \
olimexino-stm32 \
serpente \
#