Skip to content

Commit 9fbb04a

Browse files
including additional stm32c0 cpu and board targets
1 parent faa1003 commit 9fbb04a

File tree

160 files changed

+1002
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+1002
-14
lines changed

boards/nucleo-c071rb/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (C) 2024 BISSELL Homecare, Inc.
2+
#
3+
# This file is subject to the terms and conditions of the GNU Lesser
4+
# General Public License v2.1. See the file LICENSE in the top level
5+
# directory for more details.
6+
#
7+
8+
config BOARD
9+
default "nucleo-c071rb" if BOARD_NUCLEO_C031C6
10+
11+
config BOARD_NUCLEO_C071RB
12+
bool
13+
default y
14+
select BOARD_COMMON_NUCLEO64
15+
select CPU_MODEL_STM32C071RB
16+
17+
source "$(RIOTBOARD)/common/nucleo64/Kconfig"

boards/nucleo-c071rb/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MODULE = board
2+
DIRS = $(RIOTBOARD)/common/nucleo
3+
4+
include $(RIOTBASE)/Makefile.base

boards/nucleo-c071rb/Makefile.dep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include $(RIOTBOARD)/common/nucleo64/Makefile.dep
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CPU = stm32
2+
CPU_MODEL = stm32c071rb
3+
4+
# Put defined MCU peripherals here (in alphabetical order)
5+
FEATURES_PROVIDED += periph_adc
6+
FEATURES_PROVIDED += periph_i2c
7+
FEATURES_PROVIDED += periph_pwm
8+
FEATURES_PROVIDED += periph_spi
9+
FEATURES_PROVIDED += periph_timer
10+
FEATURES_PROVIDED += periph_uart
11+
12+
# Put other features for this board (in alphabetical order)
13+
FEATURES_PROVIDED += riotboot
14+
15+
# load the common Makefile.features for Nucleo boards
16+
include $(RIOTBOARD)/common/nucleo64/Makefile.features
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# load the common Makefile.include for Nucleo boards
2+
include $(RIOTBOARD)/common/nucleo64/Makefile.include

boards/nucleo-c071rb/doc.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
@defgroup boards_nucleo-c071rb STM32 Nucleo-c071rb
3+
@ingroup boards_common_nucleo64
4+
@brief Support for the STM32 Nucleo-c071rb
5+
6+
## Overview
7+
8+
The Nucleo-c071rb is a board from ST's Nucleo family supporting a ARM
9+
Cortex-M0+ STM32C071RB microcontroller with 24KiB of RAM and 128KiB of Flash.
10+
11+
## Pinout
12+
13+
See Board Manual referenced below, section 7 pages 19-21.
14+
15+
### MCU
16+
17+
| MCU | STM32c071rb |
18+
|:---------- |:------------------- |
19+
| Family | ARM Cortex-M0+ |
20+
| Vendor | ST Microelectronics |
21+
| RAM | 24KiB |
22+
| Flash | 128KiB |
23+
| Frequency | up to 48MHz |
24+
| FPU | no |
25+
| Timers | 12 (2x watchdog, 1 SysTick, 5x 16-bit) |
26+
| ADCs | 1x 12-bit (up to 19 channels) |
27+
| UARTs | 2 |
28+
| SPIs | 1 |
29+
| I2Cs | 1 |
30+
| RTC | 1 |
31+
| Vcc | 2.0V - 3.6V |
32+
| Datasheet | [Datasheet](https://www.st.com/resource/en/datasheet/stm32c071rb.pdf) |
33+
| Reference Manual | [Reference Manual](https://www.st.com/resource/en/reference_manual/rm0490-stm32c0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf) |
34+
| Programming Manual | [Programming Manual](https://www.st.com/resource/en/programming_manual/pm0223-stm32-cortexm0-mcus-programming-manual-stmicroelectronics.pdf) |
35+
| Board Manual | [Board Manual](https://www.st.com/resource/en/user_manual/um3353-stm32-nucleo64-board-mb2046-stmicroelectronics.pdf) |
36+
37+
## Flashing the Board Using ST-LINK Removable Media
38+
39+
On-board ST-LINK programmer provides via composite USB device removable media.
40+
Copying the HEX file causes reprogramming of the board. This task
41+
could be performed manually; however, the cpy2remed (copy to removable
42+
media) PROGRAMMER script does this automatically. To program board in
43+
this manner, use the command:
44+
45+
```
46+
make BOARD=nucleo-c071rb PROGRAMMER=cpy2remed flash
47+
```
48+
49+
@note This PROGRAMMER was tested using ST-LINK firmware 2.37.26. Firmware updates
50+
could be found on [this STM webpage](https://www.st.com/en/development-tools/stsw-link007.html).
51+
52+
*/
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/*
2+
* Copyright (C) 2024 BISSELL Homecare, Inc.
3+
*
4+
* This file is subject to the terms and conditions of the GNU Lesser
5+
* General Public License v2.1. See the file LICENSE in the top level
6+
* directory for more details.
7+
*/
8+
9+
/**
10+
* @ingroup boards_nucleo-c071rb
11+
* @{
12+
*
13+
* @file
14+
* @brief Peripheral MCU configuration for the nucleo-c031c6 board
15+
*
16+
* @author Jason Parker <[email protected]>
17+
*/
18+
19+
#ifndef PERIPH_CONF_H
20+
#define PERIPH_CONF_H
21+
22+
/* Add specific clock configuration (HSE, LSE) for this board here */
23+
#ifndef CONFIG_BOARD_HAS_LSE
24+
#define CONFIG_BOARD_HAS_LSE 1
25+
#endif
26+
27+
#include "clk_conf.h"
28+
#include "cfg_i2c1_pb8_pb9.h"
29+
#include "cfg_rtt_default.h"
30+
31+
#ifdef __cplusplus
32+
extern "C" {
33+
#endif
34+
35+
/**
36+
* @name Timer configuration
37+
* @{
38+
*/
39+
static const timer_conf_t timer_config[] = {
40+
{
41+
.dev = TIM3,
42+
.max = 0x0000ffff,
43+
.rcc_mask = RCC_APBENR1_TIM3EN,
44+
.bus = APB1,
45+
.irqn = TIM3_IRQn
46+
}
47+
};
48+
49+
#define TIMER_0_ISR isr_tim3
50+
51+
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
52+
/** @} */
53+
54+
/**
55+
* @name UART configuration
56+
* @{
57+
*/
58+
static const uart_conf_t uart_config[] = {
59+
{
60+
.dev = USART2,
61+
.rcc_mask = RCC_APBENR1_USART2EN,
62+
.rx_pin = GPIO_PIN(PORT_A, 3),
63+
.tx_pin = GPIO_PIN(PORT_A, 2),
64+
.rx_af = GPIO_AF1,
65+
.tx_af = GPIO_AF1,
66+
.bus = APB1,
67+
.irqn = USART2_IRQn,
68+
},
69+
{ /* Arduino pinout on D0/D1 */
70+
.dev = USART1,
71+
.rcc_mask = RCC_APBENR2_USART1EN,
72+
.rx_pin = GPIO_PIN(PORT_B, 7),
73+
.tx_pin = GPIO_PIN(PORT_B, 6),
74+
.rx_af = GPIO_AF0,
75+
.tx_af = GPIO_AF0,
76+
.bus = APB12, //?
77+
.irqn = USART1_IRQn,
78+
},
79+
};
80+
81+
#define UART_0_ISR (isr_usart2)
82+
#define UART_1_ISR (isr_usart1)
83+
84+
#define UART_NUMOF ARRAY_SIZE(uart_config)
85+
/** @} */
86+
87+
/**
88+
* @name ADC configuration
89+
*
90+
* Note that we do not configure all ADC channels,
91+
* and not in the STM32C071 order. Instead, we
92+
* just define 6 ADC channels, for the Nucleo
93+
* Arduino header pins A0-A5.
94+
*
95+
* To find appropriate device and channel find in the
96+
* board manual, table showing pin assignments and
97+
* information about ADC - a text similar to ARD_A[N]_IN[X],
98+
* where:
99+
* [N] - describes analog pin number,
100+
* [X] - describes used channel - indexed from 1,
101+
* for example ARD_A5_IN16 is channel 16
102+
*
103+
* For Nucleo-C071RB this information is in board manual
104+
*
105+
* STM32C031C6 do not have internal channel for VBAT, more details provided
106+
* in the MCU datasheet - section 3.14, page 20.
107+
*
108+
* @{
109+
*/
110+
static const adc_conf_t adc_config[] = {
111+
{ .pin = GPIO_PIN(PORT_A, 0), .dev = 0, .chan = 0 }, /* ARD_A0_IN0 */
112+
{ .pin = GPIO_PIN(PORT_A, 1), .dev = 0, .chan = 1 }, /* ARD_A1_IN1 */
113+
{ .pin = GPIO_PIN(PORT_A, 4), .dev = 0, .chan = 4 }, /* ARD_A2_IN4 */
114+
{ .pin = GPIO_PIN(PORT_B, 1), .dev = 0, .chan = 18 }, /* ARD_A3_IN18 */
115+
{ .pin = GPIO_PIN(PORT_A, 11), .dev = 0, .chan = 11 }, /* ARD_A4_IN11 */
116+
{ .pin = GPIO_PIN(PORT_A, 12), .dev = 0, .chan = 12 }, /* ARD_A5_IN12 */
117+
};
118+
119+
#define ADC_NUMOF ARRAY_SIZE(adc_config)
120+
/** @} */
121+
122+
/**
123+
* @name PWM configuration
124+
* @{
125+
*
126+
* To find appriopate device and channel find in the MCU datasheet table
127+
* concerning "Alternate function AF0 to AF7" a text similar to TIM[X]_CH[Y],
128+
* where:
129+
* TIM[X] - is device,
130+
* [Y] - describes used channel (indexed from 0), for example TIM2_CH1 is
131+
* channel 0 in configuration structure (cc_chan - field),
132+
* Port column in the table describes connected port.
133+
*
134+
* For Nucleo-c071rb this information is in the MCU datasheet, Table 13, page 35.
135+
*
136+
*/
137+
static const pwm_conf_t pwm_config[] = {
138+
{
139+
.dev = TIM3,
140+
.rcc_mask = RCC_APBENR1_TIM3EN,
141+
.chan = { { .pin = GPIO_PIN(PORT_B, 5) /*CN9 D6 */, .cc_chan = 1 },
142+
{ .pin = GPIO_PIN(PORT_B, 0) /*CN5 D10 */, .cc_chan = 2 },
143+
{ .pin = GPIO_PIN(PORT_B, 1) /*CN8 A3 */, .cc_chan = 3 },
144+
{ .pin = GPIO_UNDEF, .cc_chan = 0 } },
145+
.af = GPIO_AF1,
146+
.bus = APB1
147+
},
148+
};
149+
150+
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
151+
/** @} */
152+
153+
/**
154+
* @name SPI configuration
155+
* @{
156+
*/
157+
static const spi_conf_t spi_config[] = {
158+
{
159+
.dev = SPI1,
160+
.mosi_pin = GPIO_PIN(PORT_A, 7), /* Arduino D11 */
161+
.miso_pin = GPIO_PIN(PORT_A, 6), /* Arduino D12 */
162+
.sclk_pin = GPIO_PIN(PORT_A, 5), /* Arduino D13 */
163+
.cs_pin = GPIO_UNDEF,
164+
.mosi_af = GPIO_AF0,
165+
.miso_af = GPIO_AF0,
166+
.sclk_af = GPIO_AF0,
167+
.cs_af = GPIO_AF0,
168+
.rccmask = RCC_APBENR2_SPI1EN,
169+
.apbbus = APB12,
170+
},
171+
};
172+
173+
#define SPI_NUMOF ARRAY_SIZE(spi_config)
174+
/** @} */
175+
176+
#ifdef __cplusplus
177+
}
178+
#endif
179+
180+
#endif /* PERIPH_CONF_H */
181+
/** @} */

boards/stm32c0116-dk/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (C) 2024 BISSELL Homecare, Inc.
2+
#
3+
# This file is subject to the terms and conditions of the GNU Lesser
4+
# General Public License v2.1. See the file LICENSE in the top level
5+
# directory for more details.
6+
#
7+
8+
config BOARD
9+
default "stm32c0116-dk" if BOARD_STM32C0116_DK
10+
11+
config BOARD_STM32C0116_DK
12+
bool
13+
default y
14+
select CPU_MODEL_STM32C011F6

boards/stm32c0116-dk/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODULE = board
2+
3+
include $(RIOTBASE)/Makefile.base

boards/stm32c0116-dk/Makefile.dep

Whitespace-only changes.

0 commit comments

Comments
 (0)