-
Notifications
You must be signed in to change notification settings - Fork 2.1k
boards/olimexino-stm32f3: add board definition #21806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maribu
wants to merge
4
commits into
RIOT-OS:master
Choose a base branch
from
maribu:boards/olimexino-stm32f3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,17 @@ | ||
| ifneq (,$(filter saul_default,$(USEMODULE))) | ||
| USEMODULE += saul_gpio | ||
| endif | ||
|
|
||
| include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk | ||
|
|
||
| ifneq (,$(filter stdio_cdc_acm,$(USEMODULE))) | ||
| # The Mask-ROM bootloader provides USB-DFU capability | ||
| FEATURES_REQUIRED += bootloader_stm32 | ||
| USEMODULE += usb_board_reset | ||
| endif | ||
|
|
||
| # default to using fatfs on SD card | ||
| ifneq (,$(filter vfs_default,$(USEMODULE))) | ||
| USEMODULE += fatfs_vfs | ||
| USEMODULE += mtd | ||
| endif |
This file contains hidden or 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 @@ | ||
| CPU = stm32 | ||
| CPU_MODEL = stm32f303rc | ||
|
|
||
| # Put defined MCU peripherals here (in alphabetical order) | ||
| FEATURES_PROVIDED += periph_adc | ||
| FEATURES_PROVIDED += periph_i2c | ||
| FEATURES_PROVIDED += periph_can | ||
| FEATURES_PROVIDED += periph_pwm | ||
| FEATURES_PROVIDED += periph_rtc | ||
| FEATURES_PROVIDED += periph_spi | ||
| FEATURES_PROVIDED += periph_timer | ||
| FEATURES_PROVIDED += periph_uart | ||
| FEATURES_PROVIDED += periph_usbdev | ||
|
|
||
| # Various other features (if any) | ||
| FEATURES_PROVIDED += highlevel_stdio | ||
| FEATURES_PROVIDED += sdcard_spi | ||
| FEATURES_PROVIDED += tinyusb_device |
This file contains hidden or 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,29 @@ | ||
| # we use shared STM32 configuration snippets | ||
| INCLUDES += -I$(RIOTBASE)/boards/common/stm32/include | ||
|
|
||
| # default to flashing over USB | ||
| PROGRAMMER ?= dfu-util | ||
| DFU_USB_ID ?= 0483:df11 | ||
| DFU_USE_DFUSE ?= 1 | ||
| ROM_OFFSET ?= 0x0 | ||
|
|
||
| # CDC ACM is available faster on STM32 | ||
| TERM_DELAY ?= 1 | ||
|
|
||
| # The common stlink variants do not have the 1.27 mm 10 pin SWD connector. But | ||
| # e.g. the formerly cheap J-Link EDU Mini does have this, so this likely makes | ||
| # a better default. | ||
| OPENOCD_DEBUG_ADAPTER ?= jlink | ||
|
|
||
| # The reset pin on the 10 pin 1.27 mm SWD connector requires the solder bridge | ||
| # SJ5 to be manually closed to be useable. This is a good thing to do, but for | ||
| # a better out of the box experience, we disable the use of the RST pin by | ||
| # default. | ||
| OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 0 | ||
|
|
||
| # set default port depending on operating system | ||
| PORT_LINUX ?= /dev/ttyACM0 | ||
|
|
||
| # Setup of programmer and serial is shared between STM32 based boards | ||
| include $(RIOTMAKE)/boards/stm32.inc.mk | ||
| include $(RIOTMAKE)/tools/usb_board_reset.mk |
28,683 changes: 28,683 additions & 0 deletions
28,683
boards/olimexino-stm32f3/dist/OLIMEXINO-STM32F3_Rev_C1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,56 @@ | ||
| @defgroup boards_olimexino-stm32f3 OLIMEXINO-STM32F3 | ||
| @ingroup boards | ||
| @brief Support for the OLIMEXINO-STM32F3 board | ||
|
|
||
| ## Overview | ||
|
|
||
| The OLIMEXINO-STM32F3 is a board sporting the STM32F303RCT6 (Cortex-M4 @ 72 MHz, | ||
| FPU, 40 KiB SRAM, 256 KiB Flash) that is partially compatible with | ||
| Arduino Shields in the Arduino UNO form factor and fully compatible with UEXT | ||
| extensions. | ||
|
|
||
| ## Hardware | ||
|
|
||
| @image html https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32F3/images/OLIMEXINO-STM32F3.jpg "Picture of the OLIMEXINO-STM32F3 Board" | ||
|
|
||
| ### MCU | ||
|
|
||
| | MCU | STM32F303RC | | ||
| |:------------------------- |:------------------------------------------------- | | ||
| | Family | ARM Cortex-M4 | | ||
| | Vendor | ST Microelectronics | | ||
| | RAM | 40 KiB | | ||
| | Flash | 256 KiB | | ||
| | Frequency | up to 72 MHz, RIOT uses 72 MHz by default | | ||
| | FPU | yes | | ||
| | Advanced Control Timers | 2 × 16-bit | | ||
| | General Purpose Timers | 1 × 32-bit, 5 × 16-bit | | ||
| | Basic Timers | 2 × 16-bit | | ||
| | Watchdog Timer | 2 (Independent Watchdog + Window Watchdog) | | ||
| | SysTick Timer | Functional | | ||
| | RTC/RTT | 1 × RTC, 0 × RTT | | ||
| | RTC Memory | 64 Bytes | | ||
| | ADCs | 4 × 12-bit (22 channels) | | ||
| | DACs | 1 × 12-bit (2 channels) | | ||
| | UARTs | 5 (3 × USART, 2 × UART | | ||
| | SPIs | 3 | | ||
| | I2Ss | 2 (two SPI peripherals can be used in I2S mode) | | ||
| | I2Cs | 2 | | ||
| | CAN | 1 | | ||
| | USB | 1 | | ||
| | VCC | 2.0V - 3.6V | | ||
| | MCU Datasheet | [Datasheet][mcu-datasheet] | | ||
| | MCU Reference Manual | [Reference Manual][mcu-manual] | | ||
| | MCU Programming Manual | [Programming Manual][mcu-programming-manual] | | ||
| | Board Manual | [Board Manual][board-manual] | | ||
| | Board Schematics | [Board Schematics][board-schematics] | | ||
|
|
||
| [MCU-datasheet]: https://www.st.com/resource/en/datasheet/stm32f303rc.pdf | ||
| [mcu-manual]: http://www.st.com/web/en/resource/technical/document/reference_manual/DM00043574.pdf | ||
| [mcu-programming-manual]: http://www.st.com/web/en/resource/technical/document/programming_manual/DM00046982.pdf | ||
| [board-manual]: https://github.com/OLIMEX/OLIMEXINO-STM32F3/blob/master/DOCUMENTS/OLIMEXINO-STM32F3.pdf | ||
| [board-schematics]: https://github.com/OLIMEX/OLIMEXINO-STM32F3/blob/master/HARDWARE/OLIMEXINO-STM32F3-revision-C1/OLIMEXINO-STM32F3_Rev_C1.pdf | ||
|
|
||
| ## Schematics | ||
|
|
||
|  |
This file contains hidden or 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,144 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2025 Marian Buschsieweke | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| /** | ||
| * @ingroup boards_olimexino-stm32f3 | ||
| * @{ | ||
| * | ||
| * @file | ||
| * @brief Mapping from MCU pins to Arduino pins | ||
| * | ||
| * You can use the defines in this file for simplified interaction with the | ||
| * Arduino specific pin numbers. | ||
| * | ||
| * @author Marian Buschsieweke <[email protected]> | ||
| */ | ||
|
|
||
| #include "periph/adc.h" | ||
| #include "periph/gpio.h" | ||
| #include "periph/i2c.h" | ||
| #include "periph/pwm.h" | ||
| #include "periph/spi.h" | ||
| #include "periph/uart.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /** | ||
| * @name Arduino's UART devices | ||
| * @{ | ||
| */ | ||
| #define ARDUINO_UART_D0D1 UART_DEV(0) | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name Arduino's SPI buses | ||
| * @{ | ||
| */ | ||
| /** | ||
| * @brief SPI_DEV(0) is connected to the ISP header | ||
| */ | ||
| #define ARDUINO_SPI_ISP SPI_DEV(0) | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name Arduino's I2C buses | ||
| * @{ | ||
| */ | ||
| /** | ||
| * @brief The first I2C bus is next to the AREF pin | ||
| */ | ||
| #define ARDUINO_I2C_UNO I2C_DEV(0) | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name Mapping of MCU pins to Arduino pins | ||
| * @{ | ||
| */ | ||
| #define ARDUINO_PIN_0 GPIO_PIN(PORT_A, 3) | ||
| #define ARDUINO_PIN_1 GPIO_PIN(PORT_A, 2) | ||
| #define ARDUINO_PIN_2 GPIO_PIN(PORT_A, 0) | ||
| #define ARDUINO_PIN_3 GPIO_PIN(PORT_A, 1) | ||
| #define ARDUINO_PIN_4 GPIO_PIN(PORT_B, 5) | ||
| #define ARDUINO_PIN_5 GPIO_PIN(PORT_B, 6) | ||
| #define ARDUINO_PIN_6 GPIO_PIN(PORT_A, 8) | ||
| #define ARDUINO_PIN_7 GPIO_PIN(PORT_A, 9) | ||
|
|
||
| #define ARDUINO_PIN_8 GPIO_PIN(PORT_A, 10) | ||
| #define ARDUINO_PIN_9 GPIO_PIN(PORT_B, 7) | ||
| #define ARDUINO_PIN_10 GPIO_PIN(PORT_A, 4) | ||
| #define ARDUINO_PIN_11 GPIO_PIN(PORT_A, 7) | ||
| #define ARDUINO_PIN_12 GPIO_PIN(PORT_A, 6) | ||
| #define ARDUINO_PIN_13 GPIO_PIN(PORT_A, 5) | ||
| #define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 8) | ||
|
|
||
| /* analog pins as digital pin: */ | ||
| #define ARDUINO_PIN_15 GPIO_PIN(PORT_C, 0) | ||
| #define ARDUINO_PIN_16 GPIO_PIN(PORT_C, 1) | ||
| #define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 2) | ||
| #define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3) | ||
| #define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 4) | ||
| #define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 5) | ||
|
|
||
| #define ARDUINO_PIN_LAST 20 | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name Aliases for analog pins | ||
| * @{ | ||
| */ | ||
| #define ARDUINO_PIN_A0 ARDUINO_PIN_15 | ||
| #define ARDUINO_PIN_A1 ARDUINO_PIN_16 | ||
| #define ARDUINO_PIN_A2 ARDUINO_PIN_17 | ||
| #define ARDUINO_PIN_A3 ARDUINO_PIN_18 | ||
| #define ARDUINO_PIN_A4 ARDUINO_PIN_19 | ||
| #define ARDUINO_PIN_A5 ARDUINO_PIN_20 | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name Mapping of Arduino analog pins to RIOT ADC lines | ||
| * @{ | ||
| */ | ||
| #define ARDUINO_A0 ADC_LINE(0) | ||
| #define ARDUINO_A1 ADC_LINE(1) | ||
| #define ARDUINO_A2 ADC_LINE(2) | ||
| #define ARDUINO_A3 ADC_LINE(3) | ||
| #define ARDUINO_A4 ADC_LINE(4) | ||
| #define ARDUINO_A5 ADC_LINE(5) | ||
|
|
||
| #define ARDUINO_ANALOG_PIN_LAST 5 | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name Arduino's SPI buses | ||
| * @{ | ||
| */ | ||
| /** | ||
| * @brief SPI_DEV(0) is connected to D11/D12/D13 | ||
| */ | ||
| #define ARDUINO_SPI_D11D12D13 SPI_DEV(0) | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name UEXT Connector | ||
| * @{ | ||
| */ | ||
| #define UEXT0_PIN_3 GPIO_PIN(PORT_B, 10) /**< UEXT0: TXD pin */ | ||
| #define UEXT0_PIN_4 GPIO_PIN(PORT_B, 11) /**< UEXT0: RXD pin */ | ||
| #define UEXT0_PIN_5 GPIO_PIN(PORT_A, 9) /**< UEXT0: SCL pin */ | ||
| #define UEXT0_PIN_6 GPIO_PIN(PORT_A, 10) /**< UEXT0: SDA pin */ | ||
| #define UEXT0_PIN_7 GPIO_PIN(PORT_A, 6) /**< UEXT0: MISO pin */ | ||
| #define UEXT0_PIN_8 GPIO_PIN(PORT_A, 7) /**< UEXT0: MOSI pin */ | ||
| #define UEXT0_PIN_9 GPIO_PIN(PORT_A, 5) /**< UEXT0: SCK pin */ | ||
| #define UEXT0_PIN_10 GPIO_PIN(PORT_B, 5) /**< UEXT0: /CS pin */ | ||
| /** @} */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
| /** @} */ |
This file contains hidden or 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,67 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2025 Marian Buschsieweke | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| /** | ||
| * @ingroup boards_olimexino-stm32f3 | ||
| * @{ | ||
| * | ||
| * @file | ||
| * @brief Board specific definitions for the OLIMEXINO STM32F3 board | ||
| * | ||
| * @author Marian Buschsieweke <[email protected]> | ||
| */ | ||
|
|
||
| #include "cpu.h" | ||
| #include "periph_conf.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /** | ||
| * @name LED pin definitions and handlers | ||
| * @{ | ||
| */ | ||
| #define LED0_PIN_NUM 5 /**< GPIO pin number of green LED */ | ||
| #define LED0_PORT GPIO_PORT_A /**< GPIO port of green LED */ | ||
| #define LED0_PORT_NUM PORT_A /**< GPIO port number of green LED */ | ||
|
|
||
| #define LED1_PIN_NUM 1 /**< GPIO pin number of yellow LED */ | ||
| #define LED1_PORT GPIO_PORT_A /**< GPIO port of yellow LED */ | ||
| #define LED1_PORT_NUM PORT_A /**< GPIO port number of yellow LED */ | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name User button | ||
| * @{ | ||
| */ | ||
| #define BTN0_PIN GPIO_PIN(PORT_C, 9) /**< GPIO pin of BOOT button */ | ||
| #define BTN0_MODE GPIO_IN /**< GPIO mode to configure BOOT buttonw ith */ | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name SD card interface configuration | ||
| * | ||
| * SD card interface uses SPI_DEV(0) on this board. This configuration cannot | ||
| * be overridden. | ||
| * @{ | ||
| */ | ||
| #define SDCARD_SPI_PARAM_SPI SPI_DEV(1) | ||
| #define SDCARD_SPI_PARAM_CLK GPIO_PIN(PORT_B, 13) | ||
| #define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15) | ||
| #define SDCARD_SPI_PARAM_MISO GPIO_PIN(PORT_B, 14) | ||
| #define SDCARD_SPI_PARAM_CS GPIO_PIN(PORT_D, 2) | ||
| #define SDCARD_SPI_PARAM_POWER GPIO_UNDEF | ||
| /** @} */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #include "stm32_leds.h" | ||
|
|
||
| /** @} */ |
This file contains hidden or 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,50 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2025 Marian Buschsieweke | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| /** | ||
| * @ingroup boards_olimexino-stm32f3 | ||
| * @{ | ||
| * | ||
| * @file | ||
| * @brief Board specific configuration of direct mapped GPIOs | ||
| * | ||
| * @author Marian Buschsieweke <[email protected]> | ||
| */ | ||
|
|
||
| #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 = "green LED", | ||
| .pin = LED0_PIN, | ||
| .mode = GPIO_OUT | ||
| }, | ||
| { | ||
| .name = "yellow LED", | ||
| .pin = LED1_PIN, | ||
| .mode = GPIO_OUT | ||
| }, | ||
| { | ||
| .name = "BOOT (SW1)", | ||
| .pin = BTN0_PIN, | ||
| .mode = BTN0_MODE | ||
| }, | ||
| }; | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
| /** @} */ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.