Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fddfdeb

Browse files
askuricfpistm
andauthoredApr 22, 2025··
variant(l4): add generic L412RB(I-T)xP and Nucleo L412RB-P
Signed-off-by: Antun Skuric <[email protected]> Co-authored-by: Frederic Pillon <[email protected]>
1 parent 5eb19be commit fddfdeb

File tree

6 files changed

+561
-0
lines changed

6 files changed

+561
-0
lines changed
 

‎README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
148148
| :green_heart: | STM32L053R8 | [Nucleo L053R8](http://www.st.com/en/evaluation-tools/nucleo-l053r8.html) | *0.1.0* | |
149149
| :green_heart: | STM32L073RZ | [Nucleo L073RZ](http://www.st.com/en/evaluation-tools/nucleo-l073rz.html) | *1.4.0* | |
150150
| :green_heart: | STM32L152RE | [Nucleo L152RE](http://www.st.com/en/evaluation-tools/nucleo-l152re.html) | *1.0.0* | |
151+
| :yellow_heart: | STM32L412RB-P | [Nucleo L412RC-P](https://www.st.com/en/evaluation-tools/nucleo-l412rb-p.html) | **2.11.0** | |
151152
| :green_heart: | STM32L433RC-P | [Nucleo L433RC-P](https://www.st.com/en/evaluation-tools/nucleo-l433rc-p.html) | *1.9.0* | |
152153
| :green_heart: | STM32L452RE | [Nucleo L452RE](http://www.st.com/en/evaluation-tools/nucleo-l452re.html) | *1.5.0* | |
153154
| :green_heart: | STM32L452RE-P | [Nucleo L452RE-P](http://www.st.com/en/evaluation-tools/nucleo-l452re-p.html) | *1.8.0* | |
@@ -704,6 +705,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
704705
| Status | Device(s) | Name | Release | Notes |
705706
| :----: | :-------: | ---- | :-----: | :---- |
706707
| :green_heart: | STM32L412K8<br>STM32L412KB<br>STM32L422KB | Generic Board | *2.0.0* | |
708+
| :yellow_heart: | STM32L412RBIxP<br>STM32L412RBTxP | Generic Board | **2.11.0** | |
707709
| :green_heart: | STM32L431CB<br>STM32L431CC | Generic Board | *2.8.1* | |
708710
| :green_heart: | STM32L431RB<br>STM32L431RC | Generic Board | *2.3.0* | |
709711
| :green_heart: | STM32L432KB<br>STM32L432KC<br>STM32L442KC | Generic Board | *2.0.0* | |

‎boards.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,21 @@ Nucleo_64.menu.pnum.NUCLEO_L152RE.build.variant=STM32L1xx/L151RET_L152RET_L162RE
758758
Nucleo_64.menu.pnum.NUCLEO_L152RE.openocd.target=stm32l1
759759
Nucleo_64.menu.pnum.NUCLEO_L152RE.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L1xx/STM32L152.svd
760760

761+
# NUCLEO_L412RB_P board
762+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P=Nucleo L412RB-P
763+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.node=NODE_L412RB
764+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.upload.maximum_size=131072
765+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.upload.maximum_data_size=40960
766+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.mcu=cortex-m4
767+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.fpu=-mfpu=fpv4-sp-d16
768+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.float-abi=-mfloat-abi=hard
769+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.board=NUCLEO_L412RB_P
770+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.series=STM32L4xx
771+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.product_line=STM32L412xx
772+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.variant=STM32L4xx/L412RB(I-T)xP
773+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.openocd.target=stm32l4x
774+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
775+
761776
# NUCLEO_L433RC_P board
762777
Nucleo_64.menu.pnum.NUCLEO_L433RC_P=Nucleo L433RC-P
763778
Nucleo_64.menu.pnum.NUCLEO_L433RC_P.node=NODE_L433RC
@@ -11471,6 +11486,24 @@ GenL4.menu.pnum.GENERIC_L412KBUX.build.product_line=STM32L412xx
1147111486
GenL4.menu.pnum.GENERIC_L412KBUX.build.variant=STM32L4xx/L412K(8-B)(T-U)_L422KB(T-U)
1147211487
GenL4.menu.pnum.GENERIC_L412KBUX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
1147311488

11489+
# Generic L412RBIxP
11490+
GenL4.menu.pnum.GENERIC_L412RBIXP=Generic L412RBIxP
11491+
GenL4.menu.pnum.GENERIC_L412RBIXP.upload.maximum_size=131072
11492+
GenL4.menu.pnum.GENERIC_L412RBIXP.upload.maximum_data_size=40960
11493+
GenL4.menu.pnum.GENERIC_L412RBIXP.build.board=GENERIC_L412RBIXP
11494+
GenL4.menu.pnum.GENERIC_L412RBIXP.build.product_line=STM32L412xx
11495+
GenL4.menu.pnum.GENERIC_L412RBIXP.build.variant=STM32L4xx/L412RB(I-T)xP
11496+
GenL4.menu.pnum.GENERIC_L412RBIXP.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
11497+
11498+
# Generic L412RBTxP
11499+
GenL4.menu.pnum.GENERIC_L412RBTXP=Generic L412RBTxP
11500+
GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_size=131072
11501+
GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_data_size=40960
11502+
GenL4.menu.pnum.GENERIC_L412RBTXP.build.board=GENERIC_L412RBTXP
11503+
GenL4.menu.pnum.GENERIC_L412RBTXP.build.product_line=STM32L412xx
11504+
GenL4.menu.pnum.GENERIC_L412RBTXP.build.variant=STM32L4xx/L412RB(I-T)xP
11505+
GenL4.menu.pnum.GENERIC_L412RBTXP.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
11506+
1147411507
# Generic L422KBTx
1147511508
GenL4.menu.pnum.GENERIC_L422KBTX=Generic L422KBTx
1147611509
GenL4.menu.pnum.GENERIC_L422KBTX.upload.maximum_size=131072

‎variants/STM32L4xx/L412RB(I-T)xP/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ add_library(variant_bin STATIC EXCLUDE_FROM_ALL
2222
generic_clock.c
2323
PeripheralPins.c
2424
variant_generic.cpp
25+
variant_NUCLEO_L412RB_P.cpp
2526
)
2627
target_link_libraries(variant_bin PUBLIC variant_usage)
2728

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
/*
2+
******************************************************************************
3+
**
4+
5+
** File : LinkerScript.ld
6+
**
7+
** Author : STM32CubeMX
8+
**
9+
** Abstract : Linker script for STM32L412RBTxP series
10+
** 128Kbytes FLASH and 40Kbytes RAM
11+
**
12+
** Set heap size, stack size and stack location according
13+
** to application requirements.
14+
**
15+
** Set memory bank area and size if external memory is used.
16+
**
17+
** Target : STMicroelectronics STM32
18+
** Distribution: The file is distributed “as is,” without any warranty
19+
** of any kind.
20+
**
21+
*****************************************************************************
22+
** @attention
23+
**
24+
** <h2><center>&copy; COPYRIGHT(c) 2025 STMicroelectronics</center></h2>
25+
**
26+
** Redistribution and use in source and binary forms, with or without modification,
27+
** are permitted provided that the following conditions are met:
28+
** 1. Redistributions of source code must retain the above copyright notice,
29+
** this list of conditions and the following disclaimer.
30+
** 2. Redistributions in binary form must reproduce the above copyright notice,
31+
** this list of conditions and the following disclaimer in the documentation
32+
** and/or other materials provided with the distribution.
33+
** 3. Neither the name of STMicroelectronics nor the names of its contributors
34+
** may be used to endorse or promote products derived from this software
35+
** without specific prior written permission.
36+
**
37+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38+
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39+
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40+
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41+
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42+
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43+
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45+
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46+
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47+
**
48+
*****************************************************************************
49+
*/
50+
51+
/* Entry Point */
52+
ENTRY(Reset_Handler)
53+
54+
/* Highest address of the user mode stack */
55+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
56+
/* Generate a link error if heap and stack don't fit into RAM */
57+
_Min_Heap_Size = 0x200; /* required amount of heap */
58+
_Min_Stack_Size = 0x400; /* required amount of stack */
59+
60+
/* Specify the memory areas */
61+
MEMORY
62+
{
63+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
64+
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 8K
65+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
66+
}
67+
68+
/* Define output sections */
69+
SECTIONS
70+
{
71+
/* The startup code goes first into FLASH */
72+
.isr_vector :
73+
{
74+
. = ALIGN(8);
75+
KEEP(*(.isr_vector)) /* Startup code */
76+
. = ALIGN(8);
77+
} >FLASH
78+
79+
/* The program code and other data goes into FLASH */
80+
.text :
81+
{
82+
. = ALIGN(8);
83+
*(.text) /* .text sections (code) */
84+
*(.text*) /* .text* sections (code) */
85+
*(.glue_7) /* glue arm to thumb code */
86+
*(.glue_7t) /* glue thumb to arm code */
87+
*(.eh_frame)
88+
89+
KEEP (*(.init))
90+
KEEP (*(.fini))
91+
92+
. = ALIGN(8);
93+
_etext = .; /* define a global symbols at end of code */
94+
} >FLASH
95+
96+
/* Constant data goes into FLASH */
97+
.rodata :
98+
{
99+
. = ALIGN(8);
100+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
101+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
102+
. = ALIGN(8);
103+
} >FLASH
104+
105+
.ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
106+
{
107+
. = ALIGN(8);
108+
*(.ARM.extab* .gnu.linkonce.armextab.*)
109+
. = ALIGN(8);
110+
} >FLASH
111+
112+
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
113+
{
114+
. = ALIGN(8);
115+
__exidx_start = .;
116+
*(.ARM.exidx*)
117+
__exidx_end = .;
118+
. = ALIGN(8);
119+
} >FLASH
120+
121+
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
122+
{
123+
. = ALIGN(8);
124+
PROVIDE_HIDDEN (__preinit_array_start = .);
125+
KEEP (*(.preinit_array*))
126+
PROVIDE_HIDDEN (__preinit_array_end = .);
127+
. = ALIGN(8);
128+
} >FLASH
129+
130+
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
131+
{
132+
. = ALIGN(8);
133+
PROVIDE_HIDDEN (__init_array_start = .);
134+
KEEP (*(SORT(.init_array.*)))
135+
KEEP (*(.init_array*))
136+
PROVIDE_HIDDEN (__init_array_end = .);
137+
. = ALIGN(8);
138+
} >FLASH
139+
140+
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
141+
142+
{
143+
. = ALIGN(8);
144+
PROVIDE_HIDDEN (__fini_array_start = .);
145+
KEEP (*(SORT(.fini_array.*)))
146+
KEEP (*(.fini_array*))
147+
PROVIDE_HIDDEN (__fini_array_end = .);
148+
. = ALIGN(8);
149+
} >FLASH
150+
151+
/* used by the startup to initialize data */
152+
_sidata = LOADADDR(.data);
153+
154+
/* Initialized data sections goes into RAM, load LMA copy after code */
155+
.data :
156+
{
157+
. = ALIGN(8);
158+
_sdata = .; /* create a global symbol at data start */
159+
*(.data) /* .data sections */
160+
*(.data*) /* .data* sections */
161+
*(.RamFunc) /* .RamFunc sections */
162+
*(.RamFunc*) /* .RamFunc* sections */
163+
164+
. = ALIGN(8);
165+
_edata = .; /* define a global symbol at data end */
166+
} >RAM AT> FLASH
167+
168+
169+
/* Uninitialized data section */
170+
. = ALIGN(4);
171+
.bss :
172+
{
173+
/* This is used by the startup in order to initialize the .bss section */
174+
_sbss = .; /* define a global symbol at bss start */
175+
__bss_start__ = _sbss;
176+
*(.bss)
177+
*(.bss*)
178+
*(COMMON)
179+
180+
. = ALIGN(4);
181+
_ebss = .; /* define a global symbol at bss end */
182+
__bss_end__ = _ebss;
183+
} >RAM
184+
185+
/* User_heap_stack section, used to check that there is enough RAM left */
186+
._user_heap_stack :
187+
{
188+
. = ALIGN(8);
189+
PROVIDE ( end = . );
190+
PROVIDE ( _end = . );
191+
. = . + _Min_Heap_Size;
192+
. = . + _Min_Stack_Size;
193+
. = ALIGN(8);
194+
} >RAM
195+
196+
197+
198+
/* Remove information from the standard libraries */
199+
/DISCARD/ :
200+
{
201+
libc.a ( * )
202+
libm.a ( * )
203+
libgcc.a ( * )
204+
}
205+
206+
}
207+
208+
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#if defined(ARDUINO_NUCLEO_L412RB_P)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PA_10,
19+
PA_9,
20+
PA_12,
21+
PB_3,
22+
PB_5,
23+
PA_15,
24+
PB_10,
25+
PC_7,
26+
PB_6,
27+
PA_8,
28+
PA_11,
29+
PB_15,
30+
PB_14,
31+
PB_13, // LED
32+
PB_7,
33+
PB_8,
34+
// ST Morpho
35+
// CN5 Left Side
36+
PC_10,
37+
PC_12,
38+
PB_12,
39+
PA_13,
40+
PA_14,
41+
PC_13, // User Button
42+
PC_14,
43+
PC_15,
44+
PH_0,
45+
PH_1,
46+
PB_4,
47+
PB_9,
48+
// CN5 Right Side
49+
PC_11,
50+
// CN6 Left Side
51+
PC_9,
52+
// CN6 Right Side
53+
PC_8,
54+
PC_6,
55+
PB_0,
56+
PB_11,
57+
PB_2,
58+
PB_1,
59+
PA_7,
60+
PA_6,
61+
PA_5,
62+
PA_4,
63+
PC_4,
64+
PA_3, // STLink Rx
65+
PA_2, // STLink Tx
66+
PA_0,
67+
PA_1,
68+
PC_3,
69+
PC_2,
70+
PC_1,
71+
PC_0,
72+
PH_3
73+
};
74+
75+
// Analog (Ax) pin number array
76+
const uint32_t analogInputPin[] = {
77+
43, //A0
78+
44, //A1
79+
45, //A2
80+
46, //A3
81+
47, //A4
82+
48, //A5
83+
32, //A6
84+
35, //A7
85+
36, //A8
86+
37, //A9
87+
38, //A10
88+
39, //A11
89+
40 //A12
90+
};
91+
92+
93+
// ----------------------------------------------------------------------------
94+
95+
#ifdef __cplusplus
96+
extern "C" {
97+
#endif
98+
99+
100+
101+
/**
102+
* @brief System Clock Configuration
103+
* @param None
104+
* @retval None
105+
*/
106+
WEAK void SystemClock_Config(void)
107+
{
108+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
109+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
110+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
111+
112+
/* Configure LSE Drive Capability */
113+
HAL_PWR_EnableBkUpAccess();
114+
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
115+
/*
116+
* Initializes the RCC Oscillators according to the specified parameters
117+
* in the RCC_OscInitTypeDef structure.
118+
*/
119+
/* MSI is enabled after System reset, activate PLL with MSI as source */
120+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_MSI;
121+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
122+
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
123+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
124+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6;
125+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
126+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
127+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
128+
RCC_OscInitStruct.PLL.PLLM = 1;
129+
RCC_OscInitStruct.PLL.PLLN = 40;
130+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLQ_DIV2;
131+
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
132+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
133+
Error_Handler();
134+
}
135+
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
136+
clocks dividers */
137+
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
138+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
139+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
140+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
141+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
142+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) {
143+
Error_Handler();
144+
}
145+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
146+
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
147+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
148+
Error_Handler();
149+
}
150+
/* Configure the main internal regulator output voltage */
151+
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) {
152+
Error_Handler();
153+
}
154+
/* Enable MSI Auto calibration */
155+
HAL_RCCEx_EnableMSIPLLMode();
156+
}
157+
158+
159+
#ifdef __cplusplus
160+
}
161+
#endif
162+
#endif /* ARDUINO_NUCLEO_L412RB_P */
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* Pins
17+
*----------------------------------------------------------------------------*/
18+
19+
#define PA10 0 // SB33 ON / SB32 OFF
20+
#define PA9 1 // SB35 ON / SB34 OFF
21+
#define PA12 2
22+
#define PB3 3
23+
#define PB5 4
24+
#define PA15 5
25+
#define PB10 6
26+
#define PC7 7
27+
#define PB6 8
28+
#define PA8 9
29+
#define PA11 10
30+
#define PB15 11
31+
#define PB14 12
32+
#define PB13 13 // LED
33+
#define PB7 14
34+
#define PB8 15
35+
// ST Morpho
36+
// CN5 Left Side
37+
#define PC10 16
38+
#define PC12 17
39+
#define PB12 18
40+
#define PA13 19
41+
#define PA14 20
42+
#define PC13 21 // User Button
43+
#define PC14 22
44+
#define PC15 23
45+
#define PH0 24
46+
#define PH1 25
47+
#define PB4 26
48+
#define PB9 27
49+
// CN5 Right Side
50+
#define PC11 28
51+
// CN6 Left Side
52+
#define PC9 29
53+
// CN6 Right Side
54+
#define PC8 30
55+
#define PC6 31
56+
#define PB0 PIN_A6
57+
#define PB11 33
58+
#define PB2 34
59+
#define PB1 PIN_A7
60+
#define PA7 PIN_A8
61+
#define PA6 PIN_A9
62+
#define PA5 PIN_A10
63+
#define PA4 PIN_A11
64+
#define PC4 PIN_A12
65+
#define PA3 41 // STLink Rx
66+
#define PA2 42 // STLink Tx
67+
#define PA0 PIN_A0
68+
#define PA1 PIN_A1
69+
#define PC3 PIN_A2
70+
#define PC2 PIN_A3
71+
#define PC1 PIN_A4
72+
#define PC0 PIN_A5
73+
#define PH3 49
74+
75+
// Alternate pins number
76+
#define PA1_ALT1 (PA1 | ALT1)
77+
#define PA2_ALT1 (PA2 | ALT1)
78+
#define PA3_ALT1 (PA3 | ALT1)
79+
#define PA4_ALT1 (PA4 | ALT1)
80+
#define PA6_ALT1 (PA6 | ALT1)
81+
#define PA15_ALT1 (PA15 | ALT1)
82+
#define PB1_ALT1 (PB1 | ALT1)
83+
#define PB3_ALT1 (PB3 | ALT1)
84+
#define PB4_ALT1 (PB4 | ALT1)
85+
#define PB5_ALT1 (PB5 | ALT1)
86+
#define PB13_ALT1 (PB13 | ALT1)
87+
#define PB14_ALT1 (PB14 | ALT1)
88+
#define PB15_ALT1 (PB15 | ALT1)
89+
90+
#define NUM_DIGITAL_PINS 50
91+
#define NUM_ANALOG_INPUTS 13
92+
93+
// On-board LED pin number
94+
#ifndef LED_BUILTIN
95+
#define LED_BUILTIN PB13
96+
#endif
97+
#ifndef LED_GREEN
98+
#define LED_GREEN LED_BUILTIN
99+
#endif
100+
101+
// On-board user button
102+
#ifndef USER_BTN
103+
#define USER_BTN PC13
104+
#endif
105+
106+
// Timer Definitions (optional)
107+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
108+
#ifndef TIMER_TONE
109+
#define TIMER_TONE TIM6
110+
#endif
111+
#ifndef TIMER_SERVO
112+
#define TIMER_SERVO TIM16
113+
#endif
114+
115+
// UART Definitions
116+
// Define here Serial instance number to map on Serial generic name
117+
#define SERIAL_UART_INSTANCE 101
118+
119+
// Default pin used for 'Serial' instance (ex: ST-Link)
120+
// Mandatory for Firmata
121+
#ifndef PIN_SERIAL_RX
122+
#define PIN_SERIAL_RX PA3
123+
#endif
124+
#ifndef PIN_SERIAL_TX
125+
#define PIN_SERIAL_TX PA2
126+
#endif
127+
128+
// Enable QSPI
129+
#if !defined(HAL_QSPI_MODULE_DISABLED)
130+
#define HAL_QSPI_MODULE_ENABLED
131+
#endif
132+
133+
/*----------------------------------------------------------------------------
134+
* Arduino objects - C++ only
135+
*----------------------------------------------------------------------------*/
136+
137+
#ifdef __cplusplus
138+
// These serial port names are intended to allow libraries and architecture-neutral
139+
// sketches to automatically default to the correct port name for a particular type
140+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
141+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
142+
//
143+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
144+
//
145+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
146+
//
147+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
148+
//
149+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
150+
//
151+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
152+
// pins are NOT connected to anything by default.
153+
#define SERIAL_PORT_MONITOR Serial
154+
#define SERIAL_PORT_HARDWARE Serial
155+
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.