From cc0cf6c93552e7fcfbcb6889990952559785999d Mon Sep 17 00:00:00 2001 From: Stanimir Petev Date: Wed, 8 Jul 2020 13:07:12 +0300 Subject: [PATCH 1/7] New variant Added Olimexino-STM32F3 variant and boards.txt dscirption. --- boards.txt | 87 ++++++ variants/Olimexino-STM32F3/PeripheralPins.c | 282 ++++++++++++++++++++ variants/Olimexino-STM32F3/PinNamesVar.h | 30 +++ variants/Olimexino-STM32F3/ldscript.ld | 208 +++++++++++++++ variants/Olimexino-STM32F3/variant.cpp | 135 ++++++++++ variants/Olimexino-STM32F3/variant.h | 214 +++++++++++++++ 6 files changed, 956 insertions(+) create mode 100644 variants/Olimexino-STM32F3/PeripheralPins.c create mode 100644 variants/Olimexino-STM32F3/PinNamesVar.h create mode 100644 variants/Olimexino-STM32F3/ldscript.ld create mode 100644 variants/Olimexino-STM32F3/variant.cpp create mode 100644 variants/Olimexino-STM32F3/variant.h diff --git a/boards.txt b/boards.txt index 65074d3a9f..d788d0ae16 100644 --- a/boards.txt +++ b/boards.txt @@ -2995,3 +2995,90 @@ Midatronics.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf Midatronics.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float Midatronics.menu.rtlib.full=Newlib Standard Midatronics.menu.rtlib.full.build.flags.ldspecs= + +################################################################################ +Olimexino-STM32F3.name=Olimexino-STM32F3 + +Olimexino-STM32F3.build.core=arduino +Olimexino-STM32F3.build.board=OLIMEXINO_STM32F3 +Olimexino-STM32F3.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} {build.bootloader_flags} +Olimexino-STM32F3.build.mcu=cortex-m4 +Olimexino-STM32F3.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard +Olimexino-STM32F3.build.series=STM32F3xx +Olimexino-STM32F3.build.cmsis_lib_gcc=arm_cortexM4lf_math +Olimexino-STM32F3.build.product_line=STM32F303xC +Olimexino-STM32F3.build.variant=OLIMEXINO-STM32F3 + +Olimexino-STM32F3.upload.maximum_size=262144 +Olimexino-STM32F3.upload.maximum_data_size=40960 + +Olimexino-STM32F3.menu.upload_method.dfuMethod=STM32CubeProgrammer (DFU) +Olimexino-STM32F3.menu.upload_method.dfuMethod.upload.protocol=2 +Olimexino-STM32F3.menu.upload_method.dfuMethod.upload.options=-g +Olimexino-STM32F3.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg + +Olimexino-STM32F3.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD) +Olimexino-STM32F3.menu.upload_method.swdMethod.upload.protocol=0 +Olimexino-STM32F3.menu.upload_method.swdMethod.upload.options=-g +Olimexino-STM32F3.menu.upload_method.swdMethod.upload.tool=stm32CubeProg + +Olimexino-STM32F3.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial) +Olimexino-STM32F3.menu.upload_method.serialMethod.upload.protocol=1 +Olimexino-STM32F3.menu.upload_method.serialMethod.upload.options={serial.port.file} -s +Olimexino-STM32F3.menu.upload_method.serialMethod.upload.tool=stm32CubeProg + +Olimexino-STM32F3.menu.upload_method.bmpMethod=BMP (Black Magic Probe) +Olimexino-STM32F3.menu.upload_method.bmpMethod.upload.protocol=gdb_bmp +Olimexino-STM32F3.menu.upload_method.bmpMethod.upload.tool=bmp_upload + + +Olimexino-STM32F3.menu.xserial.generic=Enabled (generic 'Serial') +Olimexino-STM32F3.menu.xserial.none=Enabled (no generic 'Serial') +Olimexino-STM32F3.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE +Olimexino-STM32F3.menu.xserial.disabled=Disabled (no Serial support) +Olimexino-STM32F3.menu.xserial.disabled.build.xSerial= + + +Olimexino-STM32F3.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART) +Olimexino-STM32F3.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC +Olimexino-STM32F3.menu.usb.none=None +Olimexino-STM32F3.menu.usb.CDC=CDC (no generic 'Serial') +Olimexino-STM32F3.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB +Olimexino-STM32F3.menu.usb.HID=HID (keyboard and mouse) +Olimexino-STM32F3.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE +Olimexino-STM32F3.menu.xusb.FS=Low/Full Speed +Olimexino-STM32F3.menu.xusb.HS=High Speed +Olimexino-STM32F3.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS +Olimexino-STM32F3.menu.xusb.HSFS=High Speed in Full Speed mode +Olimexino-STM32F3.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS + + +Olimexino-STM32F3.menu.opt.osstd=Smallest (-Os default) +Olimexino-STM32F3.menu.opt.osstd.build.flags.optimize=-Os +Olimexino-STM32F3.menu.opt.oslto=Smallest (-Os) with LTO +Olimexino-STM32F3.menu.opt.oslto.build.flags.optimize=-Os -flto +Olimexino-STM32F3.menu.opt.o1std=Fast (-O1) +Olimexino-STM32F3.menu.opt.o1std.build.flags.optimize=-O1 +Olimexino-STM32F3.menu.opt.o1lto=Fast (-O1) with LTO +Olimexino-STM32F3.menu.opt.o1lto.build.flags.optimize=-O1 -flto +Olimexino-STM32F3.menu.opt.o2std=Faster (-O2) +Olimexino-STM32F3.menu.opt.o2std.build.flags.optimize=-O2 +Olimexino-STM32F3.menu.opt.o2lto=Faster (-O2) with LTO +Olimexino-STM32F3.menu.opt.o2lto.build.flags.optimize=-O2 -flto +Olimexino-STM32F3.menu.opt.o3std=Fastest (-O3) +Olimexino-STM32F3.menu.opt.o3std.build.flags.optimize=-O3 +Olimexino-STM32F3.menu.opt.o3lto=Fastest (-O3) with LTO +Olimexino-STM32F3.menu.opt.o3lto.build.flags.optimize=-O3 -flto +Olimexino-STM32F3.menu.opt.ogstd=Debug (-g) +Olimexino-STM32F3.menu.opt.ogstd.build.flags.optimize=-g -Og + + +Olimexino-STM32F3.menu.rtlib.nano=Newlib Nano (default) +Olimexino-STM32F3.menu.rtlib.nanofp=Newlib Nano + Float Printf +Olimexino-STM32F3.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float +Olimexino-STM32F3.menu.rtlib.nanofs=Newlib Nano + Float Scanf +Olimexino-STM32F3.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float +Olimexino-STM32F3.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf +Olimexino-STM32F3.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float +Olimexino-STM32F3.menu.rtlib.full=Newlib Standard +Olimexino-STM32F3.menu.rtlib.full.build.flags.ldspecs= \ No newline at end of file diff --git a/variants/Olimexino-STM32F3/PeripheralPins.c b/variants/Olimexino-STM32F3/PeripheralPins.c new file mode 100644 index 0000000000..7a86a355d5 --- /dev/null +++ b/variants/Olimexino-STM32F3/PeripheralPins.c @@ -0,0 +1,282 @@ +/* + ******************************************************************************* + * Copyright (c) 2019, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + * Automatically generated from STM32F303C(B-C)Tx.xml + */ +#include "Arduino.h" +#include "PeripheralPins.h" + +/* ===== + * Note: Commented lines are alternative possibilities which are not used per default. + * If you change them, you will have to know what you do + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +WEAK const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 + {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 + {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 + {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 + {PB_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 + {PB_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 + + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 + {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 + + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +WEAK const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + {PA_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PA_14, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SCL[] = { + {PA_9, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PA_15, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +WEAK const PinMap PinMap_PWM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + // {PA_1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 1, 1)}, // TIM15_CH1N + {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + // {PA_2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 1, 0)}, // TIM15_CH1 + {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + // {PA_3, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 2, 0)}, // TIM15_CH2 + {PA_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + // {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N + // {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + // {PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N + {PA_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1 + {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 0)}, // TIM1_CH1 + {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 0)}, // TIM1_CH2 + // {PA_9, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM2, 3, 0)}, // TIM2_CH3 + {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 0)}, // TIM1_CH3 + // {PA_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM2, 4, 0)}, // TIM2_CH4 + // {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N - USB_DM + // {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_TIM1, 4, 0)}, // TIM1_CH4 + // {PA_11, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 1, 0)}, // TIM4_CH1 + // {PA_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N - USB_DP + // {PA_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 2, 0)}, // TIM4_CH2 + // {PA_12, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + {PA_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 3, 0)}, // TIM4_CH3 + // {PA_13, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N + {PA_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM8, 2, 0)}, // TIM8_CH2 + // {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM8, 1, 0)}, // TIM8_CH1 + // {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N + {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + // {PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 2, 1)}, // TIM8_CH2N + // {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 1)}, // TIM1_CH3N + {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + // {PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 3, 1)}, // TIM8_CH3N + {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + // {PB_3, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N + // {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + // {PB_4, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 2, 1)}, // TIM8_CH2N + {PB_4, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + // {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + // {PB_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PB_5, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM17, 1, 0)}, // TIM17_CH1 + // {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PB_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM8, 1, 0)}, // TIM8_CH1 + // {PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N + // {PB_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM3, 4, 0)}, // TIM3_CH4 + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + // {PB_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + // {PB_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM8, 2, 0)}, // TIM8_CH2 + // {PB_8, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + // {PB_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM8, 3, 0)}, // TIM8_CH3 + // {PB_9, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1 + {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N + // {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N + {PB_14, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 1, 0)}, // TIM15_CH1 + // {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM1, 3, 1)}, // TIM1_CH3N + // {PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM15, 1, 1)}, // TIM15_CH1N + {PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 2, 0)}, // TIM15_CH2 + {PC_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM1, 1, 1)}, // TIM1_CH1N + {PF_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 1)}, // TIM1_CH3N + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_TX[] = { + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D1 + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D6 + //{PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK + //{PB_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TDO_SWO + {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D5 + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT5 I2C_SCL + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RX[] = { + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D0 + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D8 + //{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK + //{PB_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TRST + {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D9 + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT6 I2C_SDA + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // USB_DP + {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // USB_DM + {PA_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_RD[] = { + {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_CAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_TD[] = { + {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, + {NC, NP, 0} +}; +#endif + +//*** USB *** + +#ifdef HAL_PCD_MODULE_ENABLED +WEAK const PinMap PinMap_USB[] = { + {PA_11, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DM + {PA_12, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DP + {NC, NP, 0} +}; +#endif diff --git a/variants/Olimexino-STM32F3/PinNamesVar.h b/variants/Olimexino-STM32F3/PinNamesVar.h new file mode 100644 index 0000000000..26f45e806e --- /dev/null +++ b/variants/Olimexino-STM32F3/PinNamesVar.h @@ -0,0 +1,30 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = PC_13, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_DM = PA_11, + USB_DP = PA_12, +#endif \ No newline at end of file diff --git a/variants/Olimexino-STM32F3/ldscript.ld b/variants/Olimexino-STM32F3/ldscript.ld new file mode 100644 index 0000000000..22cb8c3b6c --- /dev/null +++ b/variants/Olimexino-STM32F3/ldscript.ld @@ -0,0 +1,208 @@ +/* +***************************************************************************** +** + +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F303CC Device with +** 256KByte FLASH, 40KByte RAM, 8KByte CCMRAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x2000A000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 8K +FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text ALIGN(4): + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/variants/Olimexino-STM32F3/variant.cpp b/variants/Olimexino-STM32F3/variant.cpp new file mode 100644 index 0000000000..4f8f1cd88a --- /dev/null +++ b/variants/Olimexino-STM32F3/variant.cpp @@ -0,0 +1,135 @@ +/* + ******************************************************************************* + * Copyright (c) 2018, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +const PinName digitalPin[] = +{ + PA_3, //D0 - RX2 + PA_2, //D1 - TX2 + PA_0, //D2 + PA_1, //D3 - LED2 (yellow) + PB_5, //D4 + PB_6, //D5 - TX1 + PA_8, //D6 + PA_9, //D7 - I2C2 SCL + + PA_10, //D8 - I2C2 SDA + PB_7, //D9 - RX1 + PA_4, //D10 - SS1 + PA_7, //D11 - MOSI1 + PA_6, //D12 - MISO1 + PA_5, //D13 - SCK1, LED1 (green) + PB_8, //D14 - CAN_RX + + PC_0, //D15 - A0 + PC_1, //D16 - A1 + PC_2, //D17 - A2 + PC_3, //D18 - A3 + PC_4, //D19 - A4 + PC_5, //D20 - A5 + + PC_13, //D21 + PC_9, //D22 - Button (not an actual D pin) + + PC_15, //D23 + PB_9, //D24 - CAN_TX + PD_2, //D25 - MMC_CS + PC_10, //D26 + PB_0, //D27 + PB_1, //D28 + PB_10, //D29 - TX3 + PB_11, //D30 - RX3 + PB_12, //D31 - #SS2 + PB_13, //D32 - SCK2 + PB_14, //D33 - MISO2 + PB_15, //D34 - MOSI2 + PC_6, //D35 + PC_7, //D36 + PC_8, //D37 + + PF_4, //D38 - UEXT_PWR (not actual D pin) +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +WEAK void SystemClock_Config(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct = {}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {}; + RCC_PeriphCLKInitTypeDef PeriphClkInit = {}; + + /* Initializes the CPU, AHB and APB busses clocks */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + /* Initializes the CPU, AHB and APB busses clocks */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) + { + Error_Handler(); + } + PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; + PeriphClkInit.USBClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) + { + Error_Handler(); + } +} + +#ifdef __cplusplus +} +#endif diff --git a/variants/Olimexino-STM32F3/variant.h b/variants/Olimexino-STM32F3/variant.h new file mode 100644 index 0000000000..d38571231c --- /dev/null +++ b/variants/Olimexino-STM32F3/variant.h @@ -0,0 +1,214 @@ +/* + ******************************************************************************* + * Copyright (c) 2018, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#ifndef _VARIANT_ARDUINO_STM32_ +#define _VARIANT_ARDUINO_STM32_ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Digital connector 1 +#define PA3 0 +#define PA2 1 +#define PA0 2 +#define PA1 3 +#define PB5 4 +#define PB6 5 +#define PA8 6 +#define PA9 7 + +// Digital connector 2 +#define PA10 8 +#define PB7 9 +#define PA4 10 +#define PA7 11 +#define PA6 12 +#define PA5 13 +#define PB8 14 + +// Analog connector +#define PC0 15 +#define PC1 16 +#define PC2 17 +#define PC3 18 +#define PC4 19 +#define PC5 20 + +#define PC13 21 + +// GPIO extention +#define PC15 23 +#define PB9 24 +#define PD2 25 +#define PC10 26 +#define PB0 27 +#define PB1 28 +#define PB10 29 +#define PB11 30 +#define PB12 31 +#define PB13 32 +#define PB14 33 +#define PB15 34 +#define PC6 35 +#define PC7 36 +#define PC8 37 + +// UEXT_PWR +#define PF4 38 + +// GPIO extention +#define GPIO1 23 +#define GPIO2 24 +#define GPIO3 25 +#define GPIO4 26 +#define GPIO5 27 +#define GPIO6 28 +#define GPIO7 29 +#define GPIO8 30 +#define GPIO9 31 +#define GPIO10 32 +#define GPIO11 33 +#define GPIO12 34 +#define GPIO13 35 +#define GPIO14 36 +#define GPIO15 37 + +// UEXT +#define UEXTPWR 38 +#define UEXT3 29 +#define UEXT4 30 +#define UEXT5 7 +#define UEXT6 8 +#define UEXT7 12 +#define UEXT8 11 +#define UEXT9 13 +#define UEXT10 4 +//#define UEXT10 10 + + +// This must be a literal +#define NUM_DIGITAL_PINS 39 +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 6 +#define NUM_ANALOG_FIRST 15 + +// On-board LED pin number +#define LED1 13 +#define LED_GREEN LED1 +#define LED2 3 +#define LED_YELLOW LED2 + +// On-board button pin button +#define BUTTON 22 + +// SPI Definitions +// SPI1 +#define PIN_SPI_SS PA4 // D10 +#define PIN_SPI_SCK PA5 // D13 +#define PIN_SPI_MISO PA6 // D12 +#define PIN_SPI_MOSI PA7 // D11 + +// SPI2 +#define PIN_SPI2_SS PB12 // D31 +#define PIN_SPI2_SCK PB13 // D32 +#define PIN_SPI2_MISO PB14 // D33 +#define PIN_SPI2_MOSI PB15 // D34 + +// SPI3 +// #define PIN_SPI3_SS -1 // PA_15 +// #define PIN_SPI3_SCK -1 // PB_3 +// #define PIN_SPI3_MISO -1 // PB_4 +// #define PIN_SPI3_MOSI -1 // PB_5 + +// SD card SPI2 definitions +#define SDCARD_SPI SPI_2 +#define SDCARD_SS_PIN PIN_SPI2_SS // D31 SPI2_#SS +#define SDCARD_SCK_PIN PIN_SPI2_SCK // D32 +#define SDCARD_MISO_PIN PIN_SPI2_MISO // D33 +#define SDCARD_MOSI_PIN PIN_SPI2_MOSI // D34 + +// I2C Definitions +#define PIN_WIRE_SDA PA10 +#define PIN_WIRE_SCL PA9 + +// Timer Definitions +// Use TIM6 when possible as servo and tone don't need GPIO output pin +#define TIMER_TONE TIM6 +#define TIMER_SERVO TIM2 + +// UART Definitions +#define HAVE_HWSERIAL1 +#define PIN_SERIAL1_TX PB6 // D5 +#define PIN_SERIAL1_RX PB7 // D9 + +#define HAVE_HWSERIAL2 +#define PIN_SERIAL2_TX PA2 // D1 +#define PIN_SERIAL2_RX PA3 // D0 + +#define HAVE_HWSERIAL3 +#define PIN_SERIAL3_TX PB10 // TX GPIO29 +#define PIN_SERIAL3_RX PB11 // RX GPIO30 + +/* Extra HAL modules */ +#define HAL_DAC_MODULE_ENABLED + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + // These serial port names are intended to allow libraries and architecture-neutral + // sketches to automatically default to the correct port name for a particular type + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, + // the first hardware serial port whose RX/TX pins are not dedicated to another use. + // + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor + // + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial + // + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library + // + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. + // + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX + // pins are NOT connected to anything by default. + #define SERIAL_PORT_MONITOR Serial + #define SERIAL_PORT_HARDWARE Serial1 + #define SERIAL_PORT_USBVIRTUAL SerialUSB +#endif + +#endif /* _VARIANT_ARDUINO_STM32_ */ From c070829750a692b65d1da88c0adc8c5f81150b6f Mon Sep 17 00:00:00 2001 From: Stanimir Petev Date: Wed, 8 Jul 2020 15:07:00 +0300 Subject: [PATCH 2/7] Fixed AStyle Fixed files to meet the AStyle checks of the stm32duino repository. --- variants/Olimexino-STM32F3/PeripheralPins.c | 24 +-- variants/Olimexino-STM32F3/variant.cpp | 101 +++++------ variants/Olimexino-STM32F3/variant.h | 188 ++++++++++---------- 3 files changed, 155 insertions(+), 158 deletions(-) diff --git a/variants/Olimexino-STM32F3/PeripheralPins.c b/variants/Olimexino-STM32F3/PeripheralPins.c index 7a86a355d5..a39d026f84 100644 --- a/variants/Olimexino-STM32F3/PeripheralPins.c +++ b/variants/Olimexino-STM32F3/PeripheralPins.c @@ -176,24 +176,24 @@ WEAK const PinMap PinMap_PWM[] = { #ifdef HAL_UART_MODULE_ENABLED WEAK const PinMap PinMap_UART_TX[] = { - {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D1 - {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D6 - //{PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK - //{PB_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TDO_SWO - {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D5 - {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT5 I2C_SCL + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D1 + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D6 + //{PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK + //{PB_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TDO_SWO + {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D5 + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT5 I2C_SCL {NC, NP, 0} }; #endif #ifdef HAL_UART_MODULE_ENABLED WEAK const PinMap PinMap_UART_RX[] = { - {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D0 - {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D8 - //{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK - //{PB_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TRST - {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D9 - {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT6 I2C_SDA + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D0 + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D8 + //{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK + //{PB_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TRST + {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D9 + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT6 I2C_SDA {NC, NP, 0} }; #endif diff --git a/variants/Olimexino-STM32F3/variant.cpp b/variants/Olimexino-STM32F3/variant.cpp index 4f8f1cd88a..e2c2d16f06 100644 --- a/variants/Olimexino-STM32F3/variant.cpp +++ b/variants/Olimexino-STM32F3/variant.cpp @@ -34,52 +34,52 @@ extern "C" { #endif // Pin number -const PinName digitalPin[] = -{ - PA_3, //D0 - RX2 - PA_2, //D1 - TX2 - PA_0, //D2 - PA_1, //D3 - LED2 (yellow) - PB_5, //D4 - PB_6, //D5 - TX1 - PA_8, //D6 - PA_9, //D7 - I2C2 SCL - - PA_10, //D8 - I2C2 SDA - PB_7, //D9 - RX1 - PA_4, //D10 - SS1 - PA_7, //D11 - MOSI1 - PA_6, //D12 - MISO1 - PA_5, //D13 - SCK1, LED1 (green) - PB_8, //D14 - CAN_RX - - PC_0, //D15 - A0 - PC_1, //D16 - A1 - PC_2, //D17 - A2 - PC_3, //D18 - A3 - PC_4, //D19 - A4 - PC_5, //D20 - A5 - - PC_13, //D21 - PC_9, //D22 - Button (not an actual D pin) - - PC_15, //D23 - PB_9, //D24 - CAN_TX - PD_2, //D25 - MMC_CS - PC_10, //D26 - PB_0, //D27 - PB_1, //D28 - PB_10, //D29 - TX3 - PB_11, //D30 - RX3 - PB_12, //D31 - #SS2 - PB_13, //D32 - SCK2 - PB_14, //D33 - MISO2 - PB_15, //D34 - MOSI2 - PC_6, //D35 - PC_7, //D36 - PC_8, //D37 - - PF_4, //D38 - UEXT_PWR (not actual D pin) +- PF_4, //D38 - UEXT_PWR (not actual D pin) +const PinName digitalPin[] = { + PA_3, //D0 - RX2 + PA_2, //D1 - TX2 + PA_0, //D2 + PA_1, //D3 - LED2 (yellow) + PB_5, //D4 + PB_6, //D5 - TX1 + PA_8, //D6 + PA_9, //D7 - I2C2 SCL + + PA_10, //D8 - I2C2 SDA + PB_7, //D9 - RX1 + PA_4, //D10 - SS1 + PA_7, //D11 - MOSI1 + PA_6, //D12 - MISO1 + PA_5, //D13 - SCK1, LED1 (green) + PB_8, //D14 - CAN_RX + + PC_0, //D15 - A0 + PC_1, //D16 - A1 + PC_2, //D17 - A2 + PC_3, //D18 - A3 + PC_4, //D19 - A4 + PC_5, //D20 - A5 + + PC_13, //D21 + PC_9, //D22 - Button (not an actual D pin) + + PC_15, //D23 + PB_9, //D24 - CAN_TX + PD_2, //D25 - MMC_CS + PC_10, //D26 + PB_0, //D27 + PB_1, //D28 + PB_10, //D29 - TX3 + PB_11, //D30 - RX3 + PB_12, //D31 - #SS2 + PB_13, //D32 - SCK2 + PB_14, //D33 - MISO2 + PB_15, //D34 - MOSI2 + PC_6, //D35 + PC_7, //D36 + PC_8, //D37 + + PF_4, //D38 - UEXT_PWR (not actual D pin) }; #ifdef __cplusplus @@ -106,8 +106,7 @@ WEAK void SystemClock_Config(void) RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /* Initializes the CPU, AHB and APB busses clocks */ @@ -118,14 +117,12 @@ WEAK void SystemClock_Config(void) RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) - { + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { Error_Handler(); } PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; PeriphClkInit.USBClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5; - if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) - { + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } } diff --git a/variants/Olimexino-STM32F3/variant.h b/variants/Olimexino-STM32F3/variant.h index d38571231c..33d75c9ef9 100644 --- a/variants/Olimexino-STM32F3/variant.h +++ b/variants/Olimexino-STM32F3/variant.h @@ -39,82 +39,82 @@ extern "C" { *----------------------------------------------------------------------------*/ // Digital connector 1 -#define PA3 0 -#define PA2 1 -#define PA0 2 -#define PA1 3 -#define PB5 4 -#define PB6 5 -#define PA8 6 -#define PA9 7 +#define PA3 0 +#define PA2 1 +#define PA0 2 +#define PA1 3 +#define PB5 4 +#define PB6 5 +#define PA8 6 +#define PA9 7 // Digital connector 2 -#define PA10 8 -#define PB7 9 -#define PA4 10 -#define PA7 11 -#define PA6 12 -#define PA5 13 -#define PB8 14 +#define PA10 8 +#define PB7 9 +#define PA4 10 +#define PA7 11 +#define PA6 12 +#define PA5 13 +#define PB8 14 // Analog connector -#define PC0 15 -#define PC1 16 -#define PC2 17 -#define PC3 18 -#define PC4 19 -#define PC5 20 +#define PC0 15 +#define PC1 16 +#define PC2 17 +#define PC3 18 +#define PC4 19 +#define PC5 20 -#define PC13 21 +#define PC13 21 // GPIO extention -#define PC15 23 -#define PB9 24 -#define PD2 25 -#define PC10 26 -#define PB0 27 -#define PB1 28 -#define PB10 29 -#define PB11 30 -#define PB12 31 -#define PB13 32 -#define PB14 33 -#define PB15 34 -#define PC6 35 -#define PC7 36 -#define PC8 37 +#define PC15 23 +#define PB9 24 +#define PD2 25 +#define PC10 26 +#define PB0 27 +#define PB1 28 +#define PB10 29 +#define PB11 30 +#define PB12 31 +#define PB13 32 +#define PB14 33 +#define PB15 34 +#define PC6 35 +#define PC7 36 +#define PC8 37 // UEXT_PWR -#define PF4 38 +#define PF4 38 // GPIO extention -#define GPIO1 23 -#define GPIO2 24 -#define GPIO3 25 -#define GPIO4 26 -#define GPIO5 27 -#define GPIO6 28 -#define GPIO7 29 -#define GPIO8 30 -#define GPIO9 31 -#define GPIO10 32 -#define GPIO11 33 -#define GPIO12 34 -#define GPIO13 35 -#define GPIO14 36 -#define GPIO15 37 +#define GPIO1 23 +#define GPIO2 24 +#define GPIO3 25 +#define GPIO4 26 +#define GPIO5 27 +#define GPIO6 28 +#define GPIO7 29 +#define GPIO8 30 +#define GPIO9 31 +#define GPIO10 32 +#define GPIO11 33 +#define GPIO12 34 +#define GPIO13 35 +#define GPIO14 36 +#define GPIO15 37 // UEXT -#define UEXTPWR 38 -#define UEXT3 29 -#define UEXT4 30 -#define UEXT5 7 -#define UEXT6 8 -#define UEXT7 12 -#define UEXT8 11 -#define UEXT9 13 -#define UEXT10 4 -//#define UEXT10 10 +#define UEXTPWR 38 +#define UEXT3 29 +#define UEXT4 30 +#define UEXT5 7 +#define UEXT6 8 +#define UEXT7 12 +#define UEXT8 11 +#define UEXT9 13 +#define UEXT10 4 +//#define UEXT10 10 // This must be a literal @@ -124,39 +124,39 @@ extern "C" { #define NUM_ANALOG_FIRST 15 // On-board LED pin number -#define LED1 13 -#define LED_GREEN LED1 -#define LED2 3 -#define LED_YELLOW LED2 +#define LED1 13 +#define LED_GREEN LED1 +#define LED2 3 +#define LED_YELLOW LED2 // On-board button pin button -#define BUTTON 22 +#define BUTTON 22 // SPI Definitions // SPI1 -#define PIN_SPI_SS PA4 // D10 -#define PIN_SPI_SCK PA5 // D13 -#define PIN_SPI_MISO PA6 // D12 -#define PIN_SPI_MOSI PA7 // D11 +#define PIN_SPI_SS PA4 // D10 +#define PIN_SPI_SCK PA5 // D13 +#define PIN_SPI_MISO PA6 // D12 +#define PIN_SPI_MOSI PA7 // D11 // SPI2 -#define PIN_SPI2_SS PB12 // D31 -#define PIN_SPI2_SCK PB13 // D32 -#define PIN_SPI2_MISO PB14 // D33 -#define PIN_SPI2_MOSI PB15 // D34 +#define PIN_SPI2_SS PB12 // D31 +#define PIN_SPI2_SCK PB13 // D32 +#define PIN_SPI2_MISO PB14 // D33 +#define PIN_SPI2_MOSI PB15 // D34 // SPI3 -// #define PIN_SPI3_SS -1 // PA_15 -// #define PIN_SPI3_SCK -1 // PB_3 -// #define PIN_SPI3_MISO -1 // PB_4 -// #define PIN_SPI3_MOSI -1 // PB_5 +// #define PIN_SPI3_SS -1 // PA_15 +// #define PIN_SPI3_SCK -1 // PB_3 +// #define PIN_SPI3_MISO -1 // PB_4 +// #define PIN_SPI3_MOSI -1 // PB_5 // SD card SPI2 definitions -#define SDCARD_SPI SPI_2 -#define SDCARD_SS_PIN PIN_SPI2_SS // D31 SPI2_#SS -#define SDCARD_SCK_PIN PIN_SPI2_SCK // D32 -#define SDCARD_MISO_PIN PIN_SPI2_MISO // D33 -#define SDCARD_MOSI_PIN PIN_SPI2_MOSI // D34 +#define SDCARD_SPI SPI_2 +#define SDCARD_SS_PIN PIN_SPI2_SS // D31 SPI2_#SS +#define SDCARD_SCK_PIN PIN_SPI2_SCK // D32 +#define SDCARD_MISO_PIN PIN_SPI2_MISO // D33 +#define SDCARD_MOSI_PIN PIN_SPI2_MOSI // D34 // I2C Definitions #define PIN_WIRE_SDA PA10 @@ -168,17 +168,17 @@ extern "C" { #define TIMER_SERVO TIM2 // UART Definitions -#define HAVE_HWSERIAL1 -#define PIN_SERIAL1_TX PB6 // D5 -#define PIN_SERIAL1_RX PB7 // D9 +#define HAVE_HWSERIAL1 +#define PIN_SERIAL1_TX PB6 // D5 +#define PIN_SERIAL1_RX PB7 // D9 -#define HAVE_HWSERIAL2 -#define PIN_SERIAL2_TX PA2 // D1 -#define PIN_SERIAL2_RX PA3 // D0 +#define HAVE_HWSERIAL2 +#define PIN_SERIAL2_TX PA2 // D1 +#define PIN_SERIAL2_RX PA3 // D0 -#define HAVE_HWSERIAL3 -#define PIN_SERIAL3_TX PB10 // TX GPIO29 -#define PIN_SERIAL3_RX PB11 // RX GPIO30 +#define HAVE_HWSERIAL3 +#define PIN_SERIAL3_TX PB10 // TX GPIO29 +#define PIN_SERIAL3_RX PB11 // RX GPIO30 /* Extra HAL modules */ #define HAL_DAC_MODULE_ENABLED From 7b3b458c20c8da4657f0f56bde0b9a5a918f6233 Mon Sep 17 00:00:00 2001 From: Stanimir Petev Date: Wed, 8 Jul 2020 15:17:53 +0300 Subject: [PATCH 3/7] Fix Removed a typo-like paste command. --- variants/Olimexino-STM32F3/variant.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/Olimexino-STM32F3/variant.cpp b/variants/Olimexino-STM32F3/variant.cpp index e2c2d16f06..f86cf19abe 100644 --- a/variants/Olimexino-STM32F3/variant.cpp +++ b/variants/Olimexino-STM32F3/variant.cpp @@ -34,7 +34,6 @@ extern "C" { #endif // Pin number -- PF_4, //D38 - UEXT_PWR (not actual D pin) const PinName digitalPin[] = { PA_3, //D0 - RX2 PA_2, //D1 - TX2 From 55dba4a8c3faf04a1d9ee3a05d4ac4d305d1fe12 Mon Sep 17 00:00:00 2001 From: Stanimir-Petev Date: Fri, 24 Jul 2020 13:39:54 +0300 Subject: [PATCH 4/7] Updated boards.txt Name of the board is now in all capital letters to avoid problems on Linux due to case-sensitive --- boards.txt | 170 ++++++++++++++++++++++++++--------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/boards.txt b/boards.txt index d788d0ae16..6b22c50a00 100644 --- a/boards.txt +++ b/boards.txt @@ -2997,88 +2997,88 @@ Midatronics.menu.rtlib.full=Newlib Standard Midatronics.menu.rtlib.full.build.flags.ldspecs= ################################################################################ -Olimexino-STM32F3.name=Olimexino-STM32F3 - -Olimexino-STM32F3.build.core=arduino -Olimexino-STM32F3.build.board=OLIMEXINO_STM32F3 -Olimexino-STM32F3.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} {build.bootloader_flags} -Olimexino-STM32F3.build.mcu=cortex-m4 -Olimexino-STM32F3.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard -Olimexino-STM32F3.build.series=STM32F3xx -Olimexino-STM32F3.build.cmsis_lib_gcc=arm_cortexM4lf_math -Olimexino-STM32F3.build.product_line=STM32F303xC -Olimexino-STM32F3.build.variant=OLIMEXINO-STM32F3 - -Olimexino-STM32F3.upload.maximum_size=262144 -Olimexino-STM32F3.upload.maximum_data_size=40960 - -Olimexino-STM32F3.menu.upload_method.dfuMethod=STM32CubeProgrammer (DFU) -Olimexino-STM32F3.menu.upload_method.dfuMethod.upload.protocol=2 -Olimexino-STM32F3.menu.upload_method.dfuMethod.upload.options=-g -Olimexino-STM32F3.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg - -Olimexino-STM32F3.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD) -Olimexino-STM32F3.menu.upload_method.swdMethod.upload.protocol=0 -Olimexino-STM32F3.menu.upload_method.swdMethod.upload.options=-g -Olimexino-STM32F3.menu.upload_method.swdMethod.upload.tool=stm32CubeProg - -Olimexino-STM32F3.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial) -Olimexino-STM32F3.menu.upload_method.serialMethod.upload.protocol=1 -Olimexino-STM32F3.menu.upload_method.serialMethod.upload.options={serial.port.file} -s -Olimexino-STM32F3.menu.upload_method.serialMethod.upload.tool=stm32CubeProg - -Olimexino-STM32F3.menu.upload_method.bmpMethod=BMP (Black Magic Probe) -Olimexino-STM32F3.menu.upload_method.bmpMethod.upload.protocol=gdb_bmp -Olimexino-STM32F3.menu.upload_method.bmpMethod.upload.tool=bmp_upload - - -Olimexino-STM32F3.menu.xserial.generic=Enabled (generic 'Serial') -Olimexino-STM32F3.menu.xserial.none=Enabled (no generic 'Serial') -Olimexino-STM32F3.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE -Olimexino-STM32F3.menu.xserial.disabled=Disabled (no Serial support) -Olimexino-STM32F3.menu.xserial.disabled.build.xSerial= - - -Olimexino-STM32F3.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART) -Olimexino-STM32F3.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -Olimexino-STM32F3.menu.usb.none=None -Olimexino-STM32F3.menu.usb.CDC=CDC (no generic 'Serial') -Olimexino-STM32F3.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB -Olimexino-STM32F3.menu.usb.HID=HID (keyboard and mouse) -Olimexino-STM32F3.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE -Olimexino-STM32F3.menu.xusb.FS=Low/Full Speed -Olimexino-STM32F3.menu.xusb.HS=High Speed -Olimexino-STM32F3.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS -Olimexino-STM32F3.menu.xusb.HSFS=High Speed in Full Speed mode -Olimexino-STM32F3.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS - - -Olimexino-STM32F3.menu.opt.osstd=Smallest (-Os default) -Olimexino-STM32F3.menu.opt.osstd.build.flags.optimize=-Os -Olimexino-STM32F3.menu.opt.oslto=Smallest (-Os) with LTO -Olimexino-STM32F3.menu.opt.oslto.build.flags.optimize=-Os -flto -Olimexino-STM32F3.menu.opt.o1std=Fast (-O1) -Olimexino-STM32F3.menu.opt.o1std.build.flags.optimize=-O1 -Olimexino-STM32F3.menu.opt.o1lto=Fast (-O1) with LTO -Olimexino-STM32F3.menu.opt.o1lto.build.flags.optimize=-O1 -flto -Olimexino-STM32F3.menu.opt.o2std=Faster (-O2) -Olimexino-STM32F3.menu.opt.o2std.build.flags.optimize=-O2 -Olimexino-STM32F3.menu.opt.o2lto=Faster (-O2) with LTO -Olimexino-STM32F3.menu.opt.o2lto.build.flags.optimize=-O2 -flto -Olimexino-STM32F3.menu.opt.o3std=Fastest (-O3) -Olimexino-STM32F3.menu.opt.o3std.build.flags.optimize=-O3 -Olimexino-STM32F3.menu.opt.o3lto=Fastest (-O3) with LTO -Olimexino-STM32F3.menu.opt.o3lto.build.flags.optimize=-O3 -flto -Olimexino-STM32F3.menu.opt.ogstd=Debug (-g) -Olimexino-STM32F3.menu.opt.ogstd.build.flags.optimize=-g -Og - - -Olimexino-STM32F3.menu.rtlib.nano=Newlib Nano (default) -Olimexino-STM32F3.menu.rtlib.nanofp=Newlib Nano + Float Printf -Olimexino-STM32F3.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float -Olimexino-STM32F3.menu.rtlib.nanofs=Newlib Nano + Float Scanf -Olimexino-STM32F3.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float -Olimexino-STM32F3.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf -Olimexino-STM32F3.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float -Olimexino-STM32F3.menu.rtlib.full=Newlib Standard -Olimexino-STM32F3.menu.rtlib.full.build.flags.ldspecs= \ No newline at end of file +OLIMEXINO-STM32F3.name=OLIMEXINO-STM32F3 + +OLIMEXINO-STM32F3.build.core=arduino +OLIMEXINO-STM32F3.build.board=OLIMEXINO_STM32F3 +OLIMEXINO-STM32F3.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} {build.bootloader_flags} +OLIMEXINO-STM32F3.build.mcu=cortex-m4 +OLIMEXINO-STM32F3.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard +OLIMEXINO-STM32F3.build.series=STM32F3xx +OLIMEXINO-STM32F3.build.cmsis_lib_gcc=arm_cortexM4lf_math +OLIMEXINO-STM32F3.build.product_line=STM32F303xC +OLIMEXINO-STM32F3.build.variant=OLIMEXINO-STM32F3 + +OLIMEXINO-STM32F3.upload.maximum_size=262144 +OLIMEXINO-STM32F3.upload.maximum_data_size=40960 + +OLIMEXINO-STM32F3.menu.upload_method.dfuMethod=STM32CubeProgrammer (DFU) +OLIMEXINO-STM32F3.menu.upload_method.dfuMethod.upload.protocol=2 +OLIMEXINO-STM32F3.menu.upload_method.dfuMethod.upload.options=-g +OLIMEXINO-STM32F3.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg + +OLIMEXINO-STM32F3.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD) +OLIMEXINO-STM32F3.menu.upload_method.swdMethod.upload.protocol=0 +OLIMEXINO-STM32F3.menu.upload_method.swdMethod.upload.options=-g +OLIMEXINO-STM32F3.menu.upload_method.swdMethod.upload.tool=stm32CubeProg + +OLIMEXINO-STM32F3.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial) +OLIMEXINO-STM32F3.menu.upload_method.serialMethod.upload.protocol=1 +OLIMEXINO-STM32F3.menu.upload_method.serialMethod.upload.options={serial.port.file} -s +OLIMEXINO-STM32F3.menu.upload_method.serialMethod.upload.tool=stm32CubeProg + +OLIMEXINO-STM32F3.menu.upload_method.bmpMethod=BMP (Black Magic Probe) +OLIMEXINO-STM32F3.menu.upload_method.bmpMethod.upload.protocol=gdb_bmp +OLIMEXINO-STM32F3.menu.upload_method.bmpMethod.upload.tool=bmp_upload + + +OLIMEXINO-STM32F3.menu.xserial.generic=Enabled (generic 'Serial') +OLIMEXINO-STM32F3.menu.xserial.none=Enabled (no generic 'Serial') +OLIMEXINO-STM32F3.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE +OLIMEXINO-STM32F3.menu.xserial.disabled=Disabled (no Serial support) +OLIMEXINO-STM32F3.menu.xserial.disabled.build.xSerial= + + +OLIMEXINO-STM32F3.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART) +OLIMEXINO-STM32F3.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC +OLIMEXINO-STM32F3.menu.usb.none=None +OLIMEXINO-STM32F3.menu.usb.CDC=CDC (no generic 'Serial') +OLIMEXINO-STM32F3.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB +OLIMEXINO-STM32F3.menu.usb.HID=HID (keyboard and mouse) +OLIMEXINO-STM32F3.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE +OLIMEXINO-STM32F3.menu.xusb.FS=Low/Full Speed +OLIMEXINO-STM32F3.menu.xusb.HS=High Speed +OLIMEXINO-STM32F3.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS +OLIMEXINO-STM32F3.menu.xusb.HSFS=High Speed in Full Speed mode +OLIMEXINO-STM32F3.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS + + +OLIMEXINO-STM32F3.menu.opt.osstd=Smallest (-Os default) +OLIMEXINO-STM32F3.menu.opt.osstd.build.flags.optimize=-Os +OLIMEXINO-STM32F3.menu.opt.oslto=Smallest (-Os) with LTO +OLIMEXINO-STM32F3.menu.opt.oslto.build.flags.optimize=-Os -flto +OLIMEXINO-STM32F3.menu.opt.o1std=Fast (-O1) +OLIMEXINO-STM32F3.menu.opt.o1std.build.flags.optimize=-O1 +OLIMEXINO-STM32F3.menu.opt.o1lto=Fast (-O1) with LTO +OLIMEXINO-STM32F3.menu.opt.o1lto.build.flags.optimize=-O1 -flto +OLIMEXINO-STM32F3.menu.opt.o2std=Faster (-O2) +OLIMEXINO-STM32F3.menu.opt.o2std.build.flags.optimize=-O2 +OLIMEXINO-STM32F3.menu.opt.o2lto=Faster (-O2) with LTO +OLIMEXINO-STM32F3.menu.opt.o2lto.build.flags.optimize=-O2 -flto +OLIMEXINO-STM32F3.menu.opt.o3std=Fastest (-O3) +OLIMEXINO-STM32F3.menu.opt.o3std.build.flags.optimize=-O3 +OLIMEXINO-STM32F3.menu.opt.o3lto=Fastest (-O3) with LTO +OLIMEXINO-STM32F3.menu.opt.o3lto.build.flags.optimize=-O3 -flto +OLIMEXINO-STM32F3.menu.opt.ogstd=Debug (-g) +OLIMEXINO-STM32F3.menu.opt.ogstd.build.flags.optimize=-g -Og + + +OLIMEXINO-STM32F3.menu.rtlib.nano=Newlib Nano (default) +OLIMEXINO-STM32F3.menu.rtlib.nanofp=Newlib Nano + Float Printf +OLIMEXINO-STM32F3.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float +OLIMEXINO-STM32F3.menu.rtlib.nanofs=Newlib Nano + Float Scanf +OLIMEXINO-STM32F3.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float +OLIMEXINO-STM32F3.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf +OLIMEXINO-STM32F3.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float +OLIMEXINO-STM32F3.menu.rtlib.full=Newlib Standard +OLIMEXINO-STM32F3.menu.rtlib.full.build.flags.ldspecs= \ No newline at end of file From c91f531ed6a8374708c1ff508a496ec5ecd0959a Mon Sep 17 00:00:00 2001 From: Stanimir-Petev Date: Fri, 24 Jul 2020 13:45:12 +0300 Subject: [PATCH 5/7] Removed variant Removed the old variant folder. It will be added now with all capital letters. --- variants/Olimexino-STM32F3/PeripheralPins.c | 282 -------------------- variants/Olimexino-STM32F3/PinNamesVar.h | 30 --- variants/Olimexino-STM32F3/ldscript.ld | 208 --------------- variants/Olimexino-STM32F3/variant.cpp | 131 --------- variants/Olimexino-STM32F3/variant.h | 214 --------------- 5 files changed, 865 deletions(-) delete mode 100644 variants/Olimexino-STM32F3/PeripheralPins.c delete mode 100644 variants/Olimexino-STM32F3/PinNamesVar.h delete mode 100644 variants/Olimexino-STM32F3/ldscript.ld delete mode 100644 variants/Olimexino-STM32F3/variant.cpp delete mode 100644 variants/Olimexino-STM32F3/variant.h diff --git a/variants/Olimexino-STM32F3/PeripheralPins.c b/variants/Olimexino-STM32F3/PeripheralPins.c deleted file mode 100644 index a39d026f84..0000000000 --- a/variants/Olimexino-STM32F3/PeripheralPins.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2019, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - * Automatically generated from STM32F303C(B-C)Tx.xml - */ -#include "Arduino.h" -#include "PeripheralPins.h" - -/* ===== - * Note: Commented lines are alternative possibilities which are not used per default. - * If you change them, you will have to know what you do - * ===== - */ - -//*** ADC *** - -#ifdef HAL_ADC_MODULE_ENABLED -WEAK const PinMap PinMap_ADC[] = { - {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 - {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 - {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 - {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 - {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 - {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 - {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 - {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 - {PB_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 - {PB_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 - - {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 - {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 - {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 - {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 - {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 - {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 - - {NC, NP, 0} -}; -#endif - -//*** DAC *** - -#ifdef HAL_DAC_MODULE_ENABLED -WEAK const PinMap PinMap_DAC[] = { - {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 - {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - {NC, NP, 0} -}; -#endif - -//*** I2C *** - -#ifdef HAL_I2C_MODULE_ENABLED -WEAK const PinMap PinMap_I2C_SDA[] = { - {PA_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, - {PA_14, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_I2C_MODULE_ENABLED -WEAK const PinMap PinMap_I2C_SCL[] = { - {PA_9, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, - {PA_15, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, - {NC, NP, 0} -}; -#endif - -//*** PWM *** - -#ifdef HAL_TIM_MODULE_ENABLED -WEAK const PinMap PinMap_PWM[] = { - {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - // {PA_1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 1, 1)}, // TIM15_CH1N - {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - // {PA_2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 1, 0)}, // TIM15_CH1 - {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - // {PA_3, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 2, 0)}, // TIM15_CH2 - {PA_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - {PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 - // {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N - // {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - // {PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N - {PA_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1 - {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 0)}, // TIM1_CH1 - {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 0)}, // TIM1_CH2 - // {PA_9, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM2, 3, 0)}, // TIM2_CH3 - {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 0)}, // TIM1_CH3 - // {PA_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM2, 4, 0)}, // TIM2_CH4 - // {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N - USB_DM - // {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_TIM1, 4, 0)}, // TIM1_CH4 - // {PA_11, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 1, 0)}, // TIM4_CH1 - // {PA_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N - USB_DP - // {PA_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 2, 0)}, // TIM4_CH2 - // {PA_12, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 - {PA_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 3, 0)}, // TIM4_CH3 - // {PA_13, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N - {PA_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM8, 2, 0)}, // TIM8_CH2 - // {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - {PA_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM8, 1, 0)}, // TIM8_CH1 - // {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N - {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - // {PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 2, 1)}, // TIM8_CH2N - // {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 1)}, // TIM1_CH3N - {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - // {PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 3, 1)}, // TIM8_CH3N - {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - // {PB_3, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N - // {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - // {PB_4, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 2, 1)}, // TIM8_CH2N - {PB_4, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 - // {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - // {PB_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N - {PB_5, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM17, 1, 0)}, // TIM17_CH1 - // {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 - {PB_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM8, 1, 0)}, // TIM8_CH1 - // {PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N - // {PB_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM3, 4, 0)}, // TIM3_CH4 - {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - // {PB_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N - {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - // {PB_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM8, 2, 0)}, // TIM8_CH2 - // {PB_8, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 - {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 - // {PB_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM8, 3, 0)}, // TIM8_CH3 - // {PB_9, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1 - {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N - // {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N - {PB_14, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 1, 0)}, // TIM15_CH1 - // {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM1, 3, 1)}, // TIM1_CH3N - // {PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM15, 1, 1)}, // TIM15_CH1N - {PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 2, 0)}, // TIM15_CH2 - {PC_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM1, 1, 1)}, // TIM1_CH1N - {PF_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 1)}, // TIM1_CH3N - {NC, NP, 0} -}; -#endif - -//*** SERIAL *** - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_TX[] = { - {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D1 - {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D6 - //{PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK - //{PB_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TDO_SWO - {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D5 - {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT5 I2C_SCL - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_RX[] = { - {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D0 - {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D8 - //{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK - //{PB_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TRST - {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D9 - {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT6 I2C_SDA - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_RTS[] = { - {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - // {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // USB_DP - {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_CTS[] = { - {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - // {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // USB_DM - {PA_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {NC, NP, 0} -}; -#endif - -//*** SPI *** - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_MOSI[] = { - {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_MISO[] = { - {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_SCLK[] = { - {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_SSEL[] = { - {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {NC, NP, 0} -}; -#endif - -//*** CAN *** - -#ifdef HAL_CAN_MODULE_ENABLED -WEAK const PinMap PinMap_CAN_RD[] = { - {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_CAN_MODULE_ENABLED -WEAK const PinMap PinMap_CAN_TD[] = { - {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, - {NC, NP, 0} -}; -#endif - -//*** USB *** - -#ifdef HAL_PCD_MODULE_ENABLED -WEAK const PinMap PinMap_USB[] = { - {PA_11, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DM - {PA_12, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DP - {NC, NP, 0} -}; -#endif diff --git a/variants/Olimexino-STM32F3/PinNamesVar.h b/variants/Olimexino-STM32F3/PinNamesVar.h deleted file mode 100644 index 26f45e806e..0000000000 --- a/variants/Olimexino-STM32F3/PinNamesVar.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SYS_WKUP */ -#ifdef PWR_WAKEUP_PIN1 - SYS_WKUP1 = PA_0, -#endif -#ifdef PWR_WAKEUP_PIN2 - SYS_WKUP2 = PC_13, -#endif -#ifdef PWR_WAKEUP_PIN3 - SYS_WKUP3 = NC, -#endif -#ifdef PWR_WAKEUP_PIN4 - SYS_WKUP4 = NC, -#endif -#ifdef PWR_WAKEUP_PIN5 - SYS_WKUP5 = NC, -#endif -#ifdef PWR_WAKEUP_PIN6 - SYS_WKUP6 = NC, -#endif -#ifdef PWR_WAKEUP_PIN7 - SYS_WKUP7 = NC, -#endif -#ifdef PWR_WAKEUP_PIN8 - SYS_WKUP8 = NC, -#endif -/* USB */ -#ifdef USBCON - USB_DM = PA_11, - USB_DP = PA_12, -#endif \ No newline at end of file diff --git a/variants/Olimexino-STM32F3/ldscript.ld b/variants/Olimexino-STM32F3/ldscript.ld deleted file mode 100644 index 22cb8c3b6c..0000000000 --- a/variants/Olimexino-STM32F3/ldscript.ld +++ /dev/null @@ -1,208 +0,0 @@ -/* -***************************************************************************** -** - -** File : LinkerScript.ld -** -** Abstract : Linker script for STM32F303CC Device with -** 256KByte FLASH, 40KByte RAM, 8KByte CCMRAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2014 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x2000A000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K -CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 8K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text ALIGN(4): - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH - - _siccmram = LOADADDR(.ccmram); - - /* CCM-RAM section - * - * IMPORTANT NOTE! - * If initialized variables will be placed in this section, - * the startup code needs to be modified to copy the init-values. - */ - .ccmram : - { - . = ALIGN(4); - _sccmram = .; /* create a global symbol at ccmram start */ - *(.ccmram) - *(.ccmram*) - - . = ALIGN(4); - _eccmram = .; /* create a global symbol at ccmram end */ - } >CCMRAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/variants/Olimexino-STM32F3/variant.cpp b/variants/Olimexino-STM32F3/variant.cpp deleted file mode 100644 index f86cf19abe..0000000000 --- a/variants/Olimexino-STM32F3/variant.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2018, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - */ -#include "pins_arduino.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Pin number -const PinName digitalPin[] = { - PA_3, //D0 - RX2 - PA_2, //D1 - TX2 - PA_0, //D2 - PA_1, //D3 - LED2 (yellow) - PB_5, //D4 - PB_6, //D5 - TX1 - PA_8, //D6 - PA_9, //D7 - I2C2 SCL - - PA_10, //D8 - I2C2 SDA - PB_7, //D9 - RX1 - PA_4, //D10 - SS1 - PA_7, //D11 - MOSI1 - PA_6, //D12 - MISO1 - PA_5, //D13 - SCK1, LED1 (green) - PB_8, //D14 - CAN_RX - - PC_0, //D15 - A0 - PC_1, //D16 - A1 - PC_2, //D17 - A2 - PC_3, //D18 - A3 - PC_4, //D19 - A4 - PC_5, //D20 - A5 - - PC_13, //D21 - PC_9, //D22 - Button (not an actual D pin) - - PC_15, //D23 - PB_9, //D24 - CAN_TX - PD_2, //D25 - MMC_CS - PC_10, //D26 - PB_0, //D27 - PB_1, //D28 - PB_10, //D29 - TX3 - PB_11, //D30 - RX3 - PB_12, //D31 - #SS2 - PB_13, //D32 - SCK2 - PB_14, //D33 - MISO2 - PB_15, //D34 - MOSI2 - PC_6, //D35 - PC_7, //D36 - PC_8, //D37 - - PF_4, //D38 - UEXT_PWR (not actual D pin) -}; - -#ifdef __cplusplus -} -#endif - -// ---------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -WEAK void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {}; - RCC_PeriphCLKInitTypeDef PeriphClkInit = {}; - - /* Initializes the CPU, AHB and APB busses clocks */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - Error_Handler(); - } - /* Initializes the CPU, AHB and APB busses clocks */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { - Error_Handler(); - } - PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; - PeriphClkInit.USBClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5; - if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { - Error_Handler(); - } -} - -#ifdef __cplusplus -} -#endif diff --git a/variants/Olimexino-STM32F3/variant.h b/variants/Olimexino-STM32F3/variant.h deleted file mode 100644 index 33d75c9ef9..0000000000 --- a/variants/Olimexino-STM32F3/variant.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2018, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - */ -#ifndef _VARIANT_ARDUINO_STM32_ -#define _VARIANT_ARDUINO_STM32_ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/*---------------------------------------------------------------------------- - * Pins - *----------------------------------------------------------------------------*/ - -// Digital connector 1 -#define PA3 0 -#define PA2 1 -#define PA0 2 -#define PA1 3 -#define PB5 4 -#define PB6 5 -#define PA8 6 -#define PA9 7 - -// Digital connector 2 -#define PA10 8 -#define PB7 9 -#define PA4 10 -#define PA7 11 -#define PA6 12 -#define PA5 13 -#define PB8 14 - -// Analog connector -#define PC0 15 -#define PC1 16 -#define PC2 17 -#define PC3 18 -#define PC4 19 -#define PC5 20 - -#define PC13 21 - -// GPIO extention -#define PC15 23 -#define PB9 24 -#define PD2 25 -#define PC10 26 -#define PB0 27 -#define PB1 28 -#define PB10 29 -#define PB11 30 -#define PB12 31 -#define PB13 32 -#define PB14 33 -#define PB15 34 -#define PC6 35 -#define PC7 36 -#define PC8 37 - -// UEXT_PWR -#define PF4 38 - -// GPIO extention -#define GPIO1 23 -#define GPIO2 24 -#define GPIO3 25 -#define GPIO4 26 -#define GPIO5 27 -#define GPIO6 28 -#define GPIO7 29 -#define GPIO8 30 -#define GPIO9 31 -#define GPIO10 32 -#define GPIO11 33 -#define GPIO12 34 -#define GPIO13 35 -#define GPIO14 36 -#define GPIO15 37 - -// UEXT -#define UEXTPWR 38 -#define UEXT3 29 -#define UEXT4 30 -#define UEXT5 7 -#define UEXT6 8 -#define UEXT7 12 -#define UEXT8 11 -#define UEXT9 13 -#define UEXT10 4 -//#define UEXT10 10 - - -// This must be a literal -#define NUM_DIGITAL_PINS 39 -// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS -#define NUM_ANALOG_INPUTS 6 -#define NUM_ANALOG_FIRST 15 - -// On-board LED pin number -#define LED1 13 -#define LED_GREEN LED1 -#define LED2 3 -#define LED_YELLOW LED2 - -// On-board button pin button -#define BUTTON 22 - -// SPI Definitions -// SPI1 -#define PIN_SPI_SS PA4 // D10 -#define PIN_SPI_SCK PA5 // D13 -#define PIN_SPI_MISO PA6 // D12 -#define PIN_SPI_MOSI PA7 // D11 - -// SPI2 -#define PIN_SPI2_SS PB12 // D31 -#define PIN_SPI2_SCK PB13 // D32 -#define PIN_SPI2_MISO PB14 // D33 -#define PIN_SPI2_MOSI PB15 // D34 - -// SPI3 -// #define PIN_SPI3_SS -1 // PA_15 -// #define PIN_SPI3_SCK -1 // PB_3 -// #define PIN_SPI3_MISO -1 // PB_4 -// #define PIN_SPI3_MOSI -1 // PB_5 - -// SD card SPI2 definitions -#define SDCARD_SPI SPI_2 -#define SDCARD_SS_PIN PIN_SPI2_SS // D31 SPI2_#SS -#define SDCARD_SCK_PIN PIN_SPI2_SCK // D32 -#define SDCARD_MISO_PIN PIN_SPI2_MISO // D33 -#define SDCARD_MOSI_PIN PIN_SPI2_MOSI // D34 - -// I2C Definitions -#define PIN_WIRE_SDA PA10 -#define PIN_WIRE_SCL PA9 - -// Timer Definitions -// Use TIM6 when possible as servo and tone don't need GPIO output pin -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM2 - -// UART Definitions -#define HAVE_HWSERIAL1 -#define PIN_SERIAL1_TX PB6 // D5 -#define PIN_SERIAL1_RX PB7 // D9 - -#define HAVE_HWSERIAL2 -#define PIN_SERIAL2_TX PA2 // D1 -#define PIN_SERIAL2_RX PA3 // D0 - -#define HAVE_HWSERIAL3 -#define PIN_SERIAL3_TX PB10 // TX GPIO29 -#define PIN_SERIAL3_RX PB11 // RX GPIO30 - -/* Extra HAL modules */ -#define HAL_DAC_MODULE_ENABLED - -#ifdef __cplusplus -} // extern "C" -#endif -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus - // These serial port names are intended to allow libraries and architecture-neutral - // sketches to automatically default to the correct port name for a particular type - // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, - // the first hardware serial port whose RX/TX pins are not dedicated to another use. - // - // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor - // - // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial - // - // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library - // - // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. - // - // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX - // pins are NOT connected to anything by default. - #define SERIAL_PORT_MONITOR Serial - #define SERIAL_PORT_HARDWARE Serial1 - #define SERIAL_PORT_USBVIRTUAL SerialUSB -#endif - -#endif /* _VARIANT_ARDUINO_STM32_ */ From 153204744d395f77edaf7965b90c62e45b5aedb2 Mon Sep 17 00:00:00 2001 From: Stanimir-Petev Date: Fri, 24 Jul 2020 13:45:54 +0300 Subject: [PATCH 6/7] Variant folder added All capital letters --- variants/OLIMEXINO-STM32F3/PeripheralPins.c | 282 ++++++++++++++++++++ variants/OLIMEXINO-STM32F3/PinNamesVar.h | 30 +++ variants/OLIMEXINO-STM32F3/ldscript.ld | 208 +++++++++++++++ variants/OLIMEXINO-STM32F3/variant.cpp | 131 +++++++++ variants/OLIMEXINO-STM32F3/variant.h | 214 +++++++++++++++ 5 files changed, 865 insertions(+) create mode 100644 variants/OLIMEXINO-STM32F3/PeripheralPins.c create mode 100644 variants/OLIMEXINO-STM32F3/PinNamesVar.h create mode 100644 variants/OLIMEXINO-STM32F3/ldscript.ld create mode 100644 variants/OLIMEXINO-STM32F3/variant.cpp create mode 100644 variants/OLIMEXINO-STM32F3/variant.h diff --git a/variants/OLIMEXINO-STM32F3/PeripheralPins.c b/variants/OLIMEXINO-STM32F3/PeripheralPins.c new file mode 100644 index 0000000000..a39d026f84 --- /dev/null +++ b/variants/OLIMEXINO-STM32F3/PeripheralPins.c @@ -0,0 +1,282 @@ +/* + ******************************************************************************* + * Copyright (c) 2019, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + * Automatically generated from STM32F303C(B-C)Tx.xml + */ +#include "Arduino.h" +#include "PeripheralPins.h" + +/* ===== + * Note: Commented lines are alternative possibilities which are not used per default. + * If you change them, you will have to know what you do + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +WEAK const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 + {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 + {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 + {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 + {PB_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 + {PB_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 + + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 + {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 + + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +WEAK const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + {PA_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PA_14, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SCL[] = { + {PA_9, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PA_15, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +WEAK const PinMap PinMap_PWM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + // {PA_1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 1, 1)}, // TIM15_CH1N + {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + // {PA_2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 1, 0)}, // TIM15_CH1 + {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + // {PA_3, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM15, 2, 0)}, // TIM15_CH2 + {PA_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + // {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N + // {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + // {PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N + {PA_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1 + {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 0)}, // TIM1_CH1 + {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 0)}, // TIM1_CH2 + // {PA_9, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM2, 3, 0)}, // TIM2_CH3 + {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 0)}, // TIM1_CH3 + // {PA_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM2, 4, 0)}, // TIM2_CH4 + // {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N - USB_DM + // {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_TIM1, 4, 0)}, // TIM1_CH4 + // {PA_11, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 1, 0)}, // TIM4_CH1 + // {PA_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N - USB_DP + // {PA_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 2, 0)}, // TIM4_CH2 + // {PA_12, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + {PA_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM4, 3, 0)}, // TIM4_CH3 + // {PA_13, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N + {PA_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM8, 2, 0)}, // TIM8_CH2 + // {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM8, 1, 0)}, // TIM8_CH1 + // {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N + {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + // {PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 2, 1)}, // TIM8_CH2N + // {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 1)}, // TIM1_CH3N + {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + // {PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 3, 1)}, // TIM8_CH3N + {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + // {PB_3, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N + // {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + // {PB_4, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 2, 1)}, // TIM8_CH2N + {PB_4, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + // {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + // {PB_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PB_5, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM17, 1, 0)}, // TIM17_CH1 + // {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PB_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM8, 1, 0)}, // TIM8_CH1 + // {PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N + // {PB_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM3, 4, 0)}, // TIM3_CH4 + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + // {PB_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + // {PB_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM8, 2, 0)}, // TIM8_CH2 + // {PB_8, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + // {PB_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_TIM8, 3, 0)}, // TIM8_CH3 + // {PB_9, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1 + {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N + // {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 2, 1)}, // TIM1_CH2N + {PB_14, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 1, 0)}, // TIM15_CH1 + // {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM1, 3, 1)}, // TIM1_CH3N + // {PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM15, 1, 1)}, // TIM15_CH1N + {PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 2, 0)}, // TIM15_CH2 + {PC_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM1, 1, 1)}, // TIM1_CH1N + {PF_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 3, 1)}, // TIM1_CH3N + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_TX[] = { + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D1 + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D6 + //{PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK + //{PB_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TDO_SWO + {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D5 + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT5 I2C_SCL + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RX[] = { + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // D0 + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D8 + //{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TCK_SWCLK + //{PB_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // TRST + {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // D9 + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // UEXT6 I2C_SDA + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // USB_DP + {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // USB_DM + {PA_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_RD[] = { + {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_CAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_TD[] = { + {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, + {NC, NP, 0} +}; +#endif + +//*** USB *** + +#ifdef HAL_PCD_MODULE_ENABLED +WEAK const PinMap PinMap_USB[] = { + {PA_11, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DM + {PA_12, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DP + {NC, NP, 0} +}; +#endif diff --git a/variants/OLIMEXINO-STM32F3/PinNamesVar.h b/variants/OLIMEXINO-STM32F3/PinNamesVar.h new file mode 100644 index 0000000000..26f45e806e --- /dev/null +++ b/variants/OLIMEXINO-STM32F3/PinNamesVar.h @@ -0,0 +1,30 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = PC_13, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_DM = PA_11, + USB_DP = PA_12, +#endif \ No newline at end of file diff --git a/variants/OLIMEXINO-STM32F3/ldscript.ld b/variants/OLIMEXINO-STM32F3/ldscript.ld new file mode 100644 index 0000000000..22cb8c3b6c --- /dev/null +++ b/variants/OLIMEXINO-STM32F3/ldscript.ld @@ -0,0 +1,208 @@ +/* +***************************************************************************** +** + +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F303CC Device with +** 256KByte FLASH, 40KByte RAM, 8KByte CCMRAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x2000A000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 8K +FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text ALIGN(4): + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/variants/OLIMEXINO-STM32F3/variant.cpp b/variants/OLIMEXINO-STM32F3/variant.cpp new file mode 100644 index 0000000000..f86cf19abe --- /dev/null +++ b/variants/OLIMEXINO-STM32F3/variant.cpp @@ -0,0 +1,131 @@ +/* + ******************************************************************************* + * Copyright (c) 2018, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +const PinName digitalPin[] = { + PA_3, //D0 - RX2 + PA_2, //D1 - TX2 + PA_0, //D2 + PA_1, //D3 - LED2 (yellow) + PB_5, //D4 + PB_6, //D5 - TX1 + PA_8, //D6 + PA_9, //D7 - I2C2 SCL + + PA_10, //D8 - I2C2 SDA + PB_7, //D9 - RX1 + PA_4, //D10 - SS1 + PA_7, //D11 - MOSI1 + PA_6, //D12 - MISO1 + PA_5, //D13 - SCK1, LED1 (green) + PB_8, //D14 - CAN_RX + + PC_0, //D15 - A0 + PC_1, //D16 - A1 + PC_2, //D17 - A2 + PC_3, //D18 - A3 + PC_4, //D19 - A4 + PC_5, //D20 - A5 + + PC_13, //D21 + PC_9, //D22 - Button (not an actual D pin) + + PC_15, //D23 + PB_9, //D24 - CAN_TX + PD_2, //D25 - MMC_CS + PC_10, //D26 + PB_0, //D27 + PB_1, //D28 + PB_10, //D29 - TX3 + PB_11, //D30 - RX3 + PB_12, //D31 - #SS2 + PB_13, //D32 - SCK2 + PB_14, //D33 - MISO2 + PB_15, //D34 - MOSI2 + PC_6, //D35 + PC_7, //D36 + PC_8, //D37 + + PF_4, //D38 - UEXT_PWR (not actual D pin) +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +WEAK void SystemClock_Config(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct = {}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {}; + RCC_PeriphCLKInitTypeDef PeriphClkInit = {}; + + /* Initializes the CPU, AHB and APB busses clocks */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + Error_Handler(); + } + /* Initializes the CPU, AHB and APB busses clocks */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { + Error_Handler(); + } + PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; + PeriphClkInit.USBClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { + Error_Handler(); + } +} + +#ifdef __cplusplus +} +#endif diff --git a/variants/OLIMEXINO-STM32F3/variant.h b/variants/OLIMEXINO-STM32F3/variant.h new file mode 100644 index 0000000000..33d75c9ef9 --- /dev/null +++ b/variants/OLIMEXINO-STM32F3/variant.h @@ -0,0 +1,214 @@ +/* + ******************************************************************************* + * Copyright (c) 2018, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#ifndef _VARIANT_ARDUINO_STM32_ +#define _VARIANT_ARDUINO_STM32_ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Digital connector 1 +#define PA3 0 +#define PA2 1 +#define PA0 2 +#define PA1 3 +#define PB5 4 +#define PB6 5 +#define PA8 6 +#define PA9 7 + +// Digital connector 2 +#define PA10 8 +#define PB7 9 +#define PA4 10 +#define PA7 11 +#define PA6 12 +#define PA5 13 +#define PB8 14 + +// Analog connector +#define PC0 15 +#define PC1 16 +#define PC2 17 +#define PC3 18 +#define PC4 19 +#define PC5 20 + +#define PC13 21 + +// GPIO extention +#define PC15 23 +#define PB9 24 +#define PD2 25 +#define PC10 26 +#define PB0 27 +#define PB1 28 +#define PB10 29 +#define PB11 30 +#define PB12 31 +#define PB13 32 +#define PB14 33 +#define PB15 34 +#define PC6 35 +#define PC7 36 +#define PC8 37 + +// UEXT_PWR +#define PF4 38 + +// GPIO extention +#define GPIO1 23 +#define GPIO2 24 +#define GPIO3 25 +#define GPIO4 26 +#define GPIO5 27 +#define GPIO6 28 +#define GPIO7 29 +#define GPIO8 30 +#define GPIO9 31 +#define GPIO10 32 +#define GPIO11 33 +#define GPIO12 34 +#define GPIO13 35 +#define GPIO14 36 +#define GPIO15 37 + +// UEXT +#define UEXTPWR 38 +#define UEXT3 29 +#define UEXT4 30 +#define UEXT5 7 +#define UEXT6 8 +#define UEXT7 12 +#define UEXT8 11 +#define UEXT9 13 +#define UEXT10 4 +//#define UEXT10 10 + + +// This must be a literal +#define NUM_DIGITAL_PINS 39 +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 6 +#define NUM_ANALOG_FIRST 15 + +// On-board LED pin number +#define LED1 13 +#define LED_GREEN LED1 +#define LED2 3 +#define LED_YELLOW LED2 + +// On-board button pin button +#define BUTTON 22 + +// SPI Definitions +// SPI1 +#define PIN_SPI_SS PA4 // D10 +#define PIN_SPI_SCK PA5 // D13 +#define PIN_SPI_MISO PA6 // D12 +#define PIN_SPI_MOSI PA7 // D11 + +// SPI2 +#define PIN_SPI2_SS PB12 // D31 +#define PIN_SPI2_SCK PB13 // D32 +#define PIN_SPI2_MISO PB14 // D33 +#define PIN_SPI2_MOSI PB15 // D34 + +// SPI3 +// #define PIN_SPI3_SS -1 // PA_15 +// #define PIN_SPI3_SCK -1 // PB_3 +// #define PIN_SPI3_MISO -1 // PB_4 +// #define PIN_SPI3_MOSI -1 // PB_5 + +// SD card SPI2 definitions +#define SDCARD_SPI SPI_2 +#define SDCARD_SS_PIN PIN_SPI2_SS // D31 SPI2_#SS +#define SDCARD_SCK_PIN PIN_SPI2_SCK // D32 +#define SDCARD_MISO_PIN PIN_SPI2_MISO // D33 +#define SDCARD_MOSI_PIN PIN_SPI2_MOSI // D34 + +// I2C Definitions +#define PIN_WIRE_SDA PA10 +#define PIN_WIRE_SCL PA9 + +// Timer Definitions +// Use TIM6 when possible as servo and tone don't need GPIO output pin +#define TIMER_TONE TIM6 +#define TIMER_SERVO TIM2 + +// UART Definitions +#define HAVE_HWSERIAL1 +#define PIN_SERIAL1_TX PB6 // D5 +#define PIN_SERIAL1_RX PB7 // D9 + +#define HAVE_HWSERIAL2 +#define PIN_SERIAL2_TX PA2 // D1 +#define PIN_SERIAL2_RX PA3 // D0 + +#define HAVE_HWSERIAL3 +#define PIN_SERIAL3_TX PB10 // TX GPIO29 +#define PIN_SERIAL3_RX PB11 // RX GPIO30 + +/* Extra HAL modules */ +#define HAL_DAC_MODULE_ENABLED + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + // These serial port names are intended to allow libraries and architecture-neutral + // sketches to automatically default to the correct port name for a particular type + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, + // the first hardware serial port whose RX/TX pins are not dedicated to another use. + // + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor + // + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial + // + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library + // + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. + // + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX + // pins are NOT connected to anything by default. + #define SERIAL_PORT_MONITOR Serial + #define SERIAL_PORT_HARDWARE Serial1 + #define SERIAL_PORT_USBVIRTUAL SerialUSB +#endif + +#endif /* _VARIANT_ARDUINO_STM32_ */ From 415ad8c6f6effdb570706f41fa1613501cb693d7 Mon Sep 17 00:00:00 2001 From: Stanimir-Petev Date: Fri, 26 Mar 2021 08:44:30 +0200 Subject: [PATCH 7/7] Updated GPIO1 extention macros Renamed the macros GPIOx to EXT_GPIOx in order to prevent duplication of names (since GPIOx is too generic name) like in the library RDA5807 (https://github.com/pu2clr/RDA5807) where GPIO1, GPIO2, GPIO3 are defined in part of structure "refined", RDA6807.h lines 214-216 --- variants/OLIMEXINO-STM32F3/variant.h | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/variants/OLIMEXINO-STM32F3/variant.h b/variants/OLIMEXINO-STM32F3/variant.h index 33d75c9ef9..5f19147269 100644 --- a/variants/OLIMEXINO-STM32F3/variant.h +++ b/variants/OLIMEXINO-STM32F3/variant.h @@ -88,21 +88,21 @@ extern "C" { #define PF4 38 // GPIO extention -#define GPIO1 23 -#define GPIO2 24 -#define GPIO3 25 -#define GPIO4 26 -#define GPIO5 27 -#define GPIO6 28 -#define GPIO7 29 -#define GPIO8 30 -#define GPIO9 31 -#define GPIO10 32 -#define GPIO11 33 -#define GPIO12 34 -#define GPIO13 35 -#define GPIO14 36 -#define GPIO15 37 +#define EXT_GPIO1 23 +#define EXT_GPIO2 24 +#define EXT_GPIO3 25 +#define EXT_GPIO4 26 +#define EXT_GPIO5 27 +#define EXT_GPIO6 28 +#define EXT_GPIO7 29 +#define EXT_GPIO8 30 +#define EXT_GPIO9 31 +#define EXT_GPIO10 32 +#define EXT_GPIO11 33 +#define EXT_GPIO12 34 +#define EXT_GPIO13 35 +#define EXT_GPIO14 36 +#define EXT_GPIO15 37 // UEXT #define UEXTPWR 38