-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20337 from benpicco/boards/weact-g030f6
boards/weact-g030f6: add support for minimal break-out board
- Loading branch information
Showing
133 changed files
with
390 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MODULE = board | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ifneq (,$(filter saul_default,$(USEMODULE))) | ||
USEMODULE += saul_gpio | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CPU = stm32 | ||
CPU_MODEL = stm32g030f6 | ||
|
||
# Put defined MCU peripherals here (in alphabetical order) | ||
FEATURES_PROVIDED += periph_gpio | ||
FEATURES_PROVIDED += periph_timer | ||
FEATURES_PROVIDED += periph_uart | ||
FEATURES_PROVIDED += periph_rtc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# we use shared STM32 configuration snippets | ||
INCLUDES += -I$(RIOTBASE)/boards/common/stm32/include | ||
|
||
# define the default port depending on the host OS | ||
PORT_LINUX ?= /dev/ttyACM0 | ||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) | ||
|
||
# setup serial terminal | ||
include $(RIOTMAKE)/tools/serial.inc.mk | ||
|
||
PROGRAMMER ?= openocd | ||
OPENOCD_DEBUG_ADAPTER ?= stlink | ||
|
||
# openocd programmer is supported | ||
PROGRAMMERS_SUPPORTED += openocd | ||
|
||
# this board uses openocd | ||
include $(RIOTMAKE)/tools/openocd.inc.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source [find target/stm32g0x.cfg] | ||
|
||
$_TARGETNAME configure -rtos auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
@defgroup boards_weact-g030f6 WeAct-G030F6 board | ||
@ingroup boards | ||
@brief Support for the WeAct-G030F6 board | ||
|
||
## Overview | ||
|
||
WeAct-G030F6 is a cheap little board based on the STM32G030F6P6 MCU. | ||
It does not come with a programmer or USB connection, so an external | ||
programmer (ST-Link, DAP-Link, etc) has to be used. | ||
|
||
It is available on sites like AliExpress for less than 2€. | ||
|
||
## Hardware | ||
|
||
![WeAct-G030F6P4](https://github.com/RIOT-OS/RIOT/assets/1301112/d42a25e0-d331-4cae-ba48-1edfa01f35f9) | ||
|
||
### MCU | ||
| MCU | STM32G030F6P6 | | ||
|:---------------- |:--------------------- | | ||
| Family | ARM Cortex-M0+ | | ||
| Vendor | ST Microelectronics | | ||
| RAM | 8KiB | | ||
| Flash | 32KiB | | ||
| Frequency | up to 64MHz | | ||
| FPU | no | | ||
| Timers | 8 (2x watchdog, 1 SysTick, 5x 16-bit) | | ||
| ADCs | 1x 12-bit | | ||
| UARTs | 2 | | ||
| SPIs | 2 | | ||
| I2Cs | 2 | | ||
| RTC | 1 | | ||
| Vcc | 2.0V - 3.6V | | ||
| Datasheet | [Datasheet](https://www.st.com/resource/en/datasheet/stm32g030f6.pdf) | | ||
| Reference Manual | [Reference Manual](https://www.st.com/resource/en/reference_manual/rm0454-stm32g0x0-advanced-armbased-32bit-mcus-stmicroelectronics.pdf) | | ||
|
||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) 2024 ML!PA Consulting GmbH | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_weact-g030f6 | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific definitions for WeAct-G030F6 | ||
* | ||
* @author Benjamin Valentin <[email protected]> | ||
*/ | ||
|
||
#ifndef BOARD_H | ||
#define BOARD_H | ||
|
||
#include "cpu.h" | ||
#include "periph_conf.h" | ||
#include "periph_cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define LED0_PIN_NUM 4 | ||
#define LED0_PORT_NUM PORT_A | ||
|
||
#define BTN0_PIN GPIO_PIN(PORT_A, 14) | ||
#define BTN0_MODE GPIO_IN | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#include "stm32_leds.h" | ||
|
||
#endif /* BOARD_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) 2024 ML!PA Consulting GmbH | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_weact-g030f6 | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific configuration of direct mapped GPIOs | ||
* | ||
* @author Benjamin Valentin <[email protected]> | ||
*/ | ||
|
||
#ifndef GPIO_PARAMS_H | ||
#define GPIO_PARAMS_H | ||
|
||
#include "board.h" | ||
#include "saul/periph.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief GPIO pin configuration | ||
*/ | ||
static const saul_gpio_params_t saul_gpio_params[] = | ||
{ | ||
{ | ||
.name = "LED(blue)", | ||
.pin = LED0_PIN, | ||
.mode = GPIO_OUT, | ||
.flags= SAUL_GPIO_INVERTED | SAUL_GPIO_INIT_CLEAR, | ||
}, | ||
{ | ||
.name = "Button(A14)", | ||
.pin = BTN0_PIN, | ||
.mode = BTN0_MODE, | ||
}, | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* GPIO_PARAMS_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (C) 2024 ML!PA Consulting GmbH | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_weact-g030f6 | ||
* @{ | ||
* | ||
* @file | ||
* @brief Configuration of CPU peripherals for WeAct-G030F6 | ||
* | ||
* @author Benjamin Valentin <[email protected]> | ||
*/ | ||
|
||
#ifndef PERIPH_CONF_H | ||
#define PERIPH_CONF_H | ||
|
||
#include <stdint.h> | ||
|
||
#include "cpu.h" | ||
#include "periph_cpu.h" | ||
#include "clk_conf.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @name Timer configuration | ||
* @{ | ||
*/ | ||
static const timer_conf_t timer_config[] = { | ||
{ | ||
.dev = TIM1, | ||
.max = 0x0000ffff, | ||
.rcc_mask = RCC_APBENR2_TIM1EN, | ||
.bus = APB12, | ||
.irqn = TIM1_CC_IRQn | ||
} | ||
}; | ||
|
||
#define TIMER_0_ISR isr_tim1_cc | ||
#define TIMER_0_MAX_VALUE 0xffff | ||
|
||
#define TIMER_NUMOF ARRAY_SIZE(timer_config) | ||
/** @} */ | ||
|
||
/** | ||
* @name UART configuration | ||
* @{ | ||
*/ | ||
static const uart_conf_t uart_config[] = { | ||
{ | ||
.dev = USART2, | ||
.rcc_mask = RCC_APBENR1_USART2EN, | ||
.rx_pin = GPIO_PIN(PORT_A, 3), | ||
.tx_pin = GPIO_PIN(PORT_A, 2), | ||
.rx_af = GPIO_AF1, | ||
.tx_af = GPIO_AF1, | ||
.bus = APB1, | ||
.irqn = USART2_IRQn, | ||
}, | ||
}; | ||
|
||
#define UART_0_ISR (isr_usart2) | ||
|
||
#define UART_NUMOF ARRAY_SIZE(uart_config) | ||
/** @} */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* PERIPH_CONF_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ BOARD_INSUFFICIENT_MEMORY := \ | |
stm32l0538-disco \ | ||
telosb \ | ||
waspmote-pro \ | ||
weact-g030f6 \ | ||
z1 \ | ||
zigduino \ | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ BOARD_INSUFFICIENT_MEMORY := \ | |
stm32l0538-disco \ | ||
telosb \ | ||
waspmote-pro \ | ||
weact-g030f6 \ | ||
z1 \ | ||
zigduino \ | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,6 @@ BOARD_INSUFFICIENT_MEMORY := \ | |
stm32l0538-disco \ | ||
telosb \ | ||
waspmote-pro \ | ||
weact-g030f6 \ | ||
z1 \ | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,5 +37,6 @@ BOARD_INSUFFICIENT_MEMORY := \ | |
stm32l0538-disco \ | ||
telosb \ | ||
waspmote-pro \ | ||
weact-g030f6 \ | ||
z1 \ | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.