Skip to content

Commit 145fd81

Browse files
committed
boards/olimexino-stm32f3: add board definition
1 parent ff21252 commit 145fd81

File tree

10 files changed

+29338
-0
lines changed

10 files changed

+29338
-0
lines changed

boards/olimexino-stm32f3/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
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ifneq (,$(filter saul_default,$(USEMODULE)))
2+
USEMODULE += saul_gpio
3+
endif
4+
5+
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk
6+
7+
ifneq (,$(filter stdio_cdc_acm,$(USEMODULE)))
8+
# The Mask-ROM bootloader provides USB-DFU capability
9+
FEATURES_REQUIRED += bootloader_stm32
10+
USEMODULE += usb_board_reset
11+
endif
12+
13+
# default to using fatfs on SD card
14+
ifneq (,$(filter vfs_default,$(USEMODULE)))
15+
USEMODULE += fatfs_vfs
16+
USEMODULE += mtd
17+
endif
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CPU = stm32
2+
CPU_MODEL = stm32f303rc
3+
4+
# Put defined MCU peripherals here (in alphabetical order)
5+
FEATURES_PROVIDED += periph_adc
6+
FEATURES_PROVIDED += periph_i2c
7+
FEATURES_PROVIDED += periph_can
8+
FEATURES_PROVIDED += periph_pwm
9+
FEATURES_PROVIDED += periph_rtc
10+
FEATURES_PROVIDED += periph_spi
11+
FEATURES_PROVIDED += periph_timer
12+
FEATURES_PROVIDED += periph_uart
13+
FEATURES_PROVIDED += periph_usbdev
14+
15+
# Various other features (if any)
16+
FEATURES_PROVIDED += highlevel_stdio
17+
FEATURES_PROVIDED += sdcard_spi
18+
FEATURES_PROVIDED += tinyusb_device
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# we use shared STM32 configuration snippets
2+
INCLUDES += -I$(RIOTBASE)/boards/common/stm32/include
3+
4+
# default to flashing over USB
5+
PROGRAMMER ?= dfu-util
6+
DFU_USB_ID ?= 0483:df11
7+
DFU_USE_DFUSE ?= 1
8+
ROM_OFFSET ?= 0x0
9+
10+
# CDC ACM is available faster on STM32
11+
TERM_DELAY ?= 1
12+
13+
# The common stlink variants do not have the 1.27 mm 10 pin SWD connector. But
14+
# e.g. the formerly cheap J-Link EDU Mini does have this, so this likely makes
15+
# a better default.
16+
OPENOCD_DEBUG_ADAPTER ?= jlink
17+
18+
# The reset pin on the 10 pin 1.27 mm SWD connector requires the solder bridge
19+
# SJ5 to be manually closed to be useable. This is a good thing to do, but for
20+
# a better out of the box experience, we disable the use of the RST pin by
21+
# default.
22+
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 0
23+
24+
# set default port depending on operating system
25+
PORT_LINUX ?= /dev/ttyACM0
26+
27+
# Setup of programmer and serial is shared between STM32 based boards
28+
include $(RIOTMAKE)/boards/stm32.inc.mk
29+
include $(RIOTMAKE)/tools/usb_board_reset.mk

boards/olimexino-stm32f3/dist/OLIMEXINO-STM32F3_Rev_C1.svg

Lines changed: 28683 additions & 0 deletions
Loading

boards/olimexino-stm32f3/doc.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@defgroup boards_olimexino-stm32f3 OLIMEXINO-STM32F3
2+
@ingroup boards
3+
@brief Support for the OLIMEXINO-STM32F3 board
4+
5+
## Overview
6+
7+
The OLIMEXINO-STM32F3 is a board sporting the STM32F303RCT6 (Cortex-M4 @ 72 MHz,
8+
FPU, 40 KiB SRAM, 256 KiB Flash) that is partially compatible with
9+
Arduino Shields in the Arduino UNO form factor and fully compatible with UEXT
10+
extensions.
11+
12+
## Hardware
13+
14+
@image html https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32F3/images/OLIMEXINO-STM32F3.jpg "Picture of the OLIMEXINO-STM32F3 Board"
15+
16+
### MCU
17+
18+
| MCU | STM32F303RC |
19+
|:------------------------- |:------------------------------------------------- |
20+
| Family | ARM Cortex-M4 |
21+
| Vendor | ST Microelectronics |
22+
| RAM | 40 KiB |
23+
| Flash | 256 KiB |
24+
| Frequency | up to 72 MHz, RIOT uses 72 MHz by default |
25+
| FPU | yes |
26+
| Advanced Control Timers | 2 × 16-bit |
27+
| General Purpose Timers | 1 × 32-bit, 5 × 16-bit |
28+
| Basic Timers | 2 × 16-bit |
29+
| Watchdog Timer | 2 (Independent Watchdog + Window Watchdog) |
30+
| SysTick Timer | Functional |
31+
| RTC/RTT | 1 × RTC, 0 × RTT |
32+
| RTC Memory | 64 Bytes |
33+
| ADCs | 4 × 12-bit (22 channels) |
34+
| DACs | 1 × 12-bit (2 channels) |
35+
| UARTs | 5 (3 × USART, 2 × UART |
36+
| SPIs | 3 |
37+
| I2Ss | 2 (two SPI peripherals can be used in I2S mode) |
38+
| I2Cs | 2 |
39+
| CAN | 1 |
40+
| USB | 1 |
41+
| VCC | 2.0V - 3.6V |
42+
| MCU Datasheet | [Datasheet][mcu-datasheet] |
43+
| MCU Reference Manual | [Reference Manual][mcu-manual] |
44+
| MCU Programming Manual | [Programming Manual][mcu-programming-manual] |
45+
| Board Manual | [Board Manual][board-manual] |
46+
| Board Schematics | [Board Schematics][board-schematics] |
47+
48+
[MCU-datasheet]: https://www.st.com/resource/en/datasheet/stm32f303rc.pdf
49+
[mcu-manual]: http://www.st.com/web/en/resource/technical/document/reference_manual/DM00043574.pdf
50+
[mcu-programming-manual]: http://www.st.com/web/en/resource/technical/document/programming_manual/DM00046982.pdf
51+
[board-manual]: https://github.com/OLIMEX/OLIMEXINO-STM32F3/blob/master/DOCUMENTS/OLIMEXINO-STM32F3.pdf
52+
[board-schematics]: https://github.com/OLIMEX/OLIMEXINO-STM32F3/blob/master/HARDWARE/OLIMEXINO-STM32F3-revision-C1/OLIMEXINO-STM32F3_Rev_C1.pdf
53+
54+
## Schematics
55+
56+
![Schmematics of the OLIMEXINO-STM32F3 in Revision C1](dist/OLIMEXINO-STM32F3_Rev_C1.svg)
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Marian Buschsieweke
3+
* SPDX-License-Identifier: LGPL-2.1-only
4+
*/
5+
6+
#pragma once
7+
8+
/**
9+
* @ingroup boards_olimexino-stm32f3
10+
* @{
11+
*
12+
* @file
13+
* @brief Mapping from MCU pins to Arduino pins
14+
*
15+
* You can use the defines in this file for simplified interaction with the
16+
* Arduino specific pin numbers.
17+
*
18+
* @author Marian Buschsieweke <[email protected]>
19+
*/
20+
21+
#include "periph/adc.h"
22+
#include "periph/gpio.h"
23+
#include "periph/i2c.h"
24+
#include "periph/pwm.h"
25+
#include "periph/spi.h"
26+
#include "periph/uart.h"
27+
28+
#ifdef __cplusplus
29+
extern "C" {
30+
#endif
31+
32+
/**
33+
* @name Arduino's UART devices
34+
* @{
35+
*/
36+
#define ARDUINO_UART_D0D1 UART_DEV(0)
37+
/** @} */
38+
39+
/**
40+
* @name Arduino's SPI buses
41+
* @{
42+
*/
43+
/**
44+
* @brief SPI_DEV(0) is connected to the ISP header
45+
*/
46+
#define ARDUINO_SPI_ISP SPI_DEV(0)
47+
/** @} */
48+
49+
/**
50+
* @name Arduino's I2C buses
51+
* @{
52+
*/
53+
/**
54+
* @brief The first I2C bus is next to the AREF pin
55+
*/
56+
#define ARDUINO_I2C_UNO I2C_DEV(0)
57+
/** @} */
58+
59+
/**
60+
* @name Mapping of MCU pins to Arduino pins
61+
* @{
62+
*/
63+
#define ARDUINO_PIN_0 GPIO_PIN(PORT_A, 3)
64+
#define ARDUINO_PIN_1 GPIO_PIN(PORT_A, 2)
65+
#define ARDUINO_PIN_2 GPIO_PIN(PORT_A, 0)
66+
#define ARDUINO_PIN_3 GPIO_PIN(PORT_A, 1)
67+
#define ARDUINO_PIN_4 GPIO_PIN(PORT_B, 5)
68+
#define ARDUINO_PIN_5 GPIO_PIN(PORT_B, 6)
69+
#define ARDUINO_PIN_6 GPIO_PIN(PORT_A, 8)
70+
#define ARDUINO_PIN_7 GPIO_PIN(PORT_A, 9)
71+
72+
#define ARDUINO_PIN_8 GPIO_PIN(PORT_A, 10)
73+
#define ARDUINO_PIN_9 GPIO_PIN(PORT_B, 7)
74+
#define ARDUINO_PIN_10 GPIO_PIN(PORT_A, 4)
75+
#define ARDUINO_PIN_11 GPIO_PIN(PORT_A, 7)
76+
#define ARDUINO_PIN_12 GPIO_PIN(PORT_A, 6)
77+
#define ARDUINO_PIN_13 GPIO_PIN(PORT_A, 5)
78+
#define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 8)
79+
80+
/* analog pins as digital pin: */
81+
#define ARDUINO_PIN_15 GPIO_PIN(PORT_C, 0)
82+
#define ARDUINO_PIN_16 GPIO_PIN(PORT_C, 1)
83+
#define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 2)
84+
#define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3)
85+
#define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 4)
86+
#define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 5)
87+
88+
#define ARDUINO_PIN_LAST 20
89+
/** @} */
90+
91+
/**
92+
* @name Aliases for analog pins
93+
* @{
94+
*/
95+
#define ARDUINO_PIN_A0 ARDUINO_PIN_15
96+
#define ARDUINO_PIN_A1 ARDUINO_PIN_16
97+
#define ARDUINO_PIN_A2 ARDUINO_PIN_17
98+
#define ARDUINO_PIN_A3 ARDUINO_PIN_18
99+
#define ARDUINO_PIN_A4 ARDUINO_PIN_19
100+
#define ARDUINO_PIN_A5 ARDUINO_PIN_20
101+
/** @} */
102+
103+
/**
104+
* @name Mapping of Arduino analog pins to RIOT ADC lines
105+
* @{
106+
*/
107+
#define ARDUINO_A0 ADC_LINE(0)
108+
#define ARDUINO_A1 ADC_LINE(1)
109+
#define ARDUINO_A2 ADC_LINE(2)
110+
#define ARDUINO_A3 ADC_LINE(3)
111+
#define ARDUINO_A4 ADC_LINE(4)
112+
#define ARDUINO_A5 ADC_LINE(5)
113+
114+
#define ARDUINO_ANALOG_PIN_LAST 5
115+
/** @} */
116+
117+
/**
118+
* @name Arduino's SPI buses
119+
* @{
120+
*/
121+
/**
122+
* @brief SPI_DEV(0) is connected to D11/D12/D13
123+
*/
124+
#define ARDUINO_SPI_D11D12D13 SPI_DEV(0)
125+
/** @} */
126+
127+
/**
128+
* @name UEXT Connector
129+
* @{
130+
*/
131+
#define UEXT0_PIN_3 GPIO_PIN(PORT_B, 10) /**< UEXT0: TXD pin */
132+
#define UEXT0_PIN_4 GPIO_PIN(PORT_B, 11) /**< UEXT0: RXD pin */
133+
#define UEXT0_PIN_5 GPIO_PIN(PORT_A, 9) /**< UEXT0: SCL pin */
134+
#define UEXT0_PIN_6 GPIO_PIN(PORT_A, 10) /**< UEXT0: SDA pin */
135+
#define UEXT0_PIN_7 GPIO_PIN(PORT_A, 6) /**< UEXT0: MISO pin */
136+
#define UEXT0_PIN_8 GPIO_PIN(PORT_A, 7) /**< UEXT0: MOSI pin */
137+
#define UEXT0_PIN_9 GPIO_PIN(PORT_A, 5) /**< UEXT0: SCK pin */
138+
#define UEXT0_PIN_10 GPIO_PIN(PORT_B, 5) /**< UEXT0: /CS pin */
139+
/** @} */
140+
141+
#ifdef __cplusplus
142+
}
143+
#endif
144+
/** @} */
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Marian Buschsieweke
3+
* SPDX-License-Identifier: LGPL-2.1-only
4+
*/
5+
6+
#pragma once
7+
8+
/**
9+
* @ingroup boards_olimexino-stm32f3
10+
* @{
11+
*
12+
* @file
13+
* @brief Board specific definitions for the OLIMEXINO STM32F3 board
14+
*
15+
* @author Marian Buschsieweke <[email protected]>
16+
*/
17+
18+
#include "cpu.h"
19+
#include "periph_conf.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
/**
26+
* @name LED pin definitions and handlers
27+
* @{
28+
*/
29+
#define LED0_PIN_NUM 5 /**< GPIO pin number of green LED */
30+
#define LED0_PORT GPIO_PORT_A /**< GPIO port of green LED */
31+
#define LED0_PORT_NUM PORT_A /**< GPIO port number of green LED */
32+
33+
#define LED1_PIN_NUM 1 /**< GPIO pin number of yellow LED */
34+
#define LED1_PORT GPIO_PORT_A /**< GPIO port of yellow LED */
35+
#define LED1_PORT_NUM PORT_A /**< GPIO port number of yellow LED */
36+
/** @} */
37+
38+
/**
39+
* @name User button
40+
* @{
41+
*/
42+
#define BTN0_PIN GPIO_PIN(PORT_C, 9) /**< GPIO pin of BOOT button */
43+
#define BTN0_MODE GPIO_IN /**< GPIO mode to configure BOOT buttonw ith */
44+
/** @} */
45+
46+
/**
47+
* @name SD card interface configuration
48+
*
49+
* SD card interface uses SPI_DEV(0) on this board. This configuration cannot
50+
* be overridden.
51+
* @{
52+
*/
53+
#define SDCARD_SPI_PARAM_SPI SPI_DEV(1)
54+
#define SDCARD_SPI_PARAM_CLK GPIO_PIN(PORT_B, 13)
55+
#define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15)
56+
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(PORT_B, 14)
57+
#define SDCARD_SPI_PARAM_CS GPIO_PIN(PORT_D, 2)
58+
#define SDCARD_SPI_PARAM_POWER GPIO_UNDEF
59+
/** @} */
60+
61+
#ifdef __cplusplus
62+
}
63+
#endif
64+
65+
#include "stm32_leds.h"
66+
67+
/** @} */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Marian Buschsieweke
3+
* SPDX-License-Identifier: LGPL-2.1-only
4+
*/
5+
6+
#pragma once
7+
8+
/**
9+
* @ingroup boards_olimexino-stm32f3
10+
* @{
11+
*
12+
* @file
13+
* @brief Board specific configuration of direct mapped GPIOs
14+
*
15+
* @author Marian Buschsieweke <[email protected]>
16+
*/
17+
18+
#include "board.h"
19+
#include "saul/periph.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
/**
26+
* @brief GPIO pin configuration
27+
*/
28+
static const saul_gpio_params_t saul_gpio_params[] =
29+
{
30+
{
31+
.name = "green LED",
32+
.pin = LED0_PIN,
33+
.mode = GPIO_OUT
34+
},
35+
{
36+
.name = "yellow LED",
37+
.pin = LED1_PIN,
38+
.mode = GPIO_OUT
39+
},
40+
{
41+
.name = "BOOT (SW1)",
42+
.pin = BTN0_PIN,
43+
.mode = BTN0_MODE
44+
},
45+
};
46+
47+
#ifdef __cplusplus
48+
}
49+
#endif
50+
/** @} */

0 commit comments

Comments
 (0)