Skip to content

Commit dcaf225

Browse files
committed
boards/olimexino-stm32f3: add board definition
1 parent d81c7a0 commit dcaf225

File tree

10 files changed

+29364
-0
lines changed

10 files changed

+29364
-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+
# There 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.txt

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

0 commit comments

Comments
 (0)